B.Math.Segment()Represents a segment. To create the object use B.Math.makeSegment(). PROPERTIES:METHODS:clone() Clones this segment to a new segment. RETURNS:this copy(segment) Copies a given segment into this segment. set(start, end) Sets this segment from a start and a end points. fromArray(array, offset) Sets this segment from a part of array. PARAMETERS:{Array.<number>} array {number} [offset] = 0 RETURNS:{number} new offset toArray(array, offset) Sets this segment to a part of array. PARAMETERS:{Array.<number>} array {number} [offset] = 0 RETURNS:{number} new offset translate(offset) Translates this segment by a given offset. transform(matrix) Transforms this segment by a 4x4 matrix. center(result) Gets the center point of this segment. delta(result) Gets the vector from start to end. length() Gets the length of this segment. RETURNS:{number} at(t, result) Gets a point at this segment. PARAMETERS:RETURNS:point projectPoint(point, result) Projects a point to this segment. PARAMETERS:RETURNS:projected point trace(object, point) Finds the point of intersection between this segment and an object. PARAMETERS:{B.Math.Plane | B.Math.Triangle | B.Math.AABox | B.Math.Sphere} object {B.Math.Vector3} [point] point of intersection. RETURNS:{number | null} distance from start or null if no intersections. THROWS:{Error} if the object argument has unsupported type distanceTo(object) Calculates the shortest distance between this segment and an object. PARAMETERS:{B.Math.Vector3} object RETURNS:{number} distance THROWS:{Error} if the object argument has unsupported type equal(segment) Checks for strict equality of this segment and another segment. |
PROPERTIES:METHODS: |