Creates a new Ray.
The direction of the Ray. This must be normalized (with Vector3.normalize) for the methods to operate properly. Default is a Vector3 at (0, 0, -1).
The origin of the Ray. Default is a Vector3 at (0, 0, 0).
Read-only flag to check if a given object is of type Ray.
Creates a new Ray with identical origin and direction to this one.
A new instance just like this ray.
Compute the squared distance of the closest approach between the Ray and the Vector3.
The squared distance.
The Vector3 to compute a distance to.
Get the squared distance between this Ray and a line segment.
Th distance squared.
the start of the line segment.
the end of the line segment.
(optional) if this is provided, it receives the point on this Ray that is closest to the segment.
(optional) if this is provided, it receives the point on the line segment that is closest to this Ray.
Get the distance from origin to the Plane, or null if the Ray doesn't intersect the Plane.
The distance to the plane.
The Plane to get the distance to.
Compute the distance of the closest approach between the Ray and the point.
The distance.
Vector3 The Vector3 to compute a distance to.
Determine if this and the other ray have equal origin and direction.
True if equal.
The Ray to compare to.
Intersect this Ray with a triangle.
The intersection point or null if there is no intersection.
Determine if this Ray intersects with the Box3.
True if this Ray intersects with the Box3.
The Box3 to intersect with.
Determine if this Ray intersects with the Plane.
True if plane intersects this ray.
the Plane to intersect with.
Determine if this Ray intersects with the Sphere.
True if ray intersects the sphere.
the Sphere to intersect with.
Shift the origin of this Ray along its direction by the distance given.
This instance.
The distance along the Ray to interpolate.
Sets this ray's origin and direction properties by copying the values from the given objects.
This instance.
A ray that emits from an origin in a certain direction.