B.Math.Ray()Represents a ray. To create the object use B.Math.makeRay(). PROPERTIES:METHODS:clone() Clones this ray to a new ray. RETURNS:this copy(ray) Copies a given ray into this ray. set(origin, direction) Sets this ray from an origin and a direction. fromArray(array, offset) Sets this ray from a part of array. PARAMETERS:{Array.<number>} array {number} [offset] = 0 RETURNS:{number} new offset toArray(array, offset) Sets this ray to a part of array. PARAMETERS:{Array.<number>} array {number} [offset] = 0 RETURNS:{number} new offset fromOriginTarget(origin, target) Sets this ray from an origin and a target. translate(offset) Translates this ray by a given offset. transform(matrix) Transforms this ray by a 4x4 matrix. at(t, result) Gets a point at this ray. PARAMETERS:RETURNS:point projectPoint(point, result) Projects a point to this ray. PARAMETERS:RETURNS:projected point trace(object, point) Finds the point of intersection between this ray 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 origin or null if no intersections THROWS:{Error} if the object argument has unsupported type distanceTo(object) Calculates the shortest distance between this ray and an object. PARAMETERS:{B.Math.Vector3 | B.Math.Ray} object RETURNS:{number} distance THROWS:{Error} if the object argument has unsupported type equal(ray) Checks for strict equality of this ray and another ray. |
PROPERTIES:METHODS: |