A 3D ray.
Kind: global class
Plane
Ray
Boolean
Vector3
Number
Number
Boolean
Boolean
Vector3
| null
Ray
Create the Ray.
Param | Type | Description |
---|---|---|
origin | Vector3 |
Ray origin point. |
direction | Vector3 |
Ray 3d direction. |
Plane
Set the ray components.
Kind: instance method of Ray
Returns: Plane
- Self.
Param | Type | Description |
---|---|---|
origin | Vector3 |
Ray origin point. |
direction | Vector3 |
Ray 3d direction. |
Ray
Copy values from another ray.
Kind: instance method of Ray
Returns: Ray
- Self.
Param | Type | Description |
---|---|---|
ray | Ray |
Ray to copy. |
Boolean
Check if this ray equals another ray.
Kind: instance method of Ray
Returns: Boolean
- True if equal, false otherwise.
Param | Type | Description |
---|---|---|
ray | Ray |
Other ray to compare to. |
Vector3
Get the 3d point on the ray by distance from origin.
Kind: instance method of Ray
Returns: Vector3
- Point on ray from origin.
Param | Type | Description |
---|---|---|
distance | Number |
Distance from origin to travel. |
Number
Calculate distance to a 3d point.
Kind: instance method of Ray
Returns: Number
- Distance to point.
Param | Type | Description |
---|---|---|
point | Vector3 |
Point to calculate distance to. |
Number
Calculate squared distance to a 3d point.
Kind: instance method of Ray
Returns: Number
- Squared distance to point.
Param | Type | Description |
---|---|---|
point | Vector3 |
Point to calculate distance to. |
Boolean
Check if this ray collides with a sphere.
Kind: instance method of Ray
Returns: Boolean
- True if collide with sphere, false otherwise.
Param | Type | Description |
---|---|---|
sphere | Sphere |
Sphere to test collision with. |
Boolean
Check if this ray collides with a box.
Kind: instance method of Ray
Returns: Boolean
- True if collide with box, false otherwise.
Param | Type | Description |
---|---|---|
box | Box |
Box to test collision with. |
Vector3
| null
Return the collision point between the ray and a box, or null if they don’t collide.
Kind: instance method of Ray
Returns: Vector3
| null
- Collision point or null.
Param | Type | Description |
---|---|---|
box | Box |
Box to get collision with. |
Ray
Clone this ray.