An infinite ray.
Creates a new Ray instance. The ray is infinite, starting at a given origin and pointing in a given direction.
Optional
The starting point of the ray. The constructor copies this parameter. Defaults to the origin (0, 0, 0).
The direction of the ray. The constructor copies this parameter. Defaults to a direction down the world negative Z axis (0, 0, -1).
// Create a new ray starting at the position of this entity and pointing down// the entity's negative Z axisconst ray = new pc.Ray(this.entity.getPosition(), this.entity.forward); Copy
// Create a new ray starting at the position of this entity and pointing down// the entity's negative Z axisconst ray = new pc.Ray(this.entity.getPosition(), this.entity.forward);
Readonly
The direction of the ray.
The starting point of the ray.
Returns a clone of the Ray.
A duplicate Ray.
Copies the contents of a source Ray.
The Ray to copy from.
Self for chaining.
Sets origin and direction to the supplied vector values.
An infinite ray.