Ray
A ray that emits from an origin in a certain direction.
Constructor
origin --
Vector3 The origin of the
Ray.
direction --
Vector3 The direction of the
Ray. This must be normalized (with
Vector3.normalize) for the methods to operate properly.
Initialises the origin and direction properties to the provided values.
Properties
The direction of the
Ray. This must be normalized (with
Vector3.normalize) for the methods to operate properly.
Methods
t --
Float The distance along the
Ray to retrieve a position for.
optionalTarget --
Vector3 Receives the position along the
Ray if passed; otherwise a new
Vector3 is created.
Get a
Vector3 that is a given distance along this
Ray.
Create a clone of this
Ray.
point --
Vector3 The point to get the closest approach to.
optionalTarget --
Vector3 Receives the return value if passed; otherwise a new
Vector3 is created.
Get the point along this
Ray that is closest to the
Vector3 provided.
ray --
Ray The
Ray to copy values from.
Copy the properties of the provided
Ray, then return this
Ray.
v0 --
Vector3 The start of the line segment.
v1 --
Vector3 The end of the line segment.
optionalPointOnRay --
Vector3 If this is provided, it receives the point on this
Ray that is closest to the segment.
optionalPointOnSegment --
Vector3 If this is provided, it receives the point on the line segment that is closest to this
Ray.
Get the squared distance between this
Ray and a line segment.
Get the distance from the origin to the
Plane, or
null if the
Ray doesn't intersect the
Plane.
Get the distance of the closest approach between the
Ray and the
Vector3.
Get the squared distance of the closest approach between the
Ray and the
Vector3.
ray --
Ray The
Ray to compare to.
Return whether this and the other
Ray have equal offsets and directions.
Intersect this
Ray with a
Box3, returning the intersection point or
null if there is no intersection.
Intersect this
Ray with a
Plane, returning the intersection point or
null if there is no intersection.
function ( a, b, c, backfaceCulling, optionalTarget )
Intersect this
Ray with a triangle, returning the intersection point or
null if there is no intersection.
Return whether or not this
Ray intersects with the
Box3.
Return whether or not this
Ray intersects with the
Plane.
Return whether or not this
Ray intersects with the
Sphere.
t -- The distance along the
Ray to interpolate.
Shift the origin of this
Ray along its direction by the distance given.
origin --
Vector3 The origin of the
Ray.
direction --
Vector3 The direction of the
Ray. This must be normalized (with
Vector3.normalize) for the methods to operate properly.
Copy the parameters to the origin and direction properties.
v --
Vector3 The vector to look at.
Adjusts the direction of the ray to point at the vector in world coordinates.
Source
src/math/Ray.js
Edit