
A 3D ray.
Kind: global class
PlaneRayBooleanVector3NumberNumberBooleanBooleanVector3 | nullRayCreate the Ray.
| Param | Type | Description |
|---|---|---|
| origin | Vector3 |
Ray origin point. |
| direction | Vector3 |
Ray 3d direction. |
PlaneSet the ray components.
Kind: instance method of Ray
Returns: Plane - Self.
| Param | Type | Description |
|---|---|---|
| origin | Vector3 |
Ray origin point. |
| direction | Vector3 |
Ray 3d direction. |
RayCopy values from another ray.
Kind: instance method of Ray
Returns: Ray - Self.
| Param | Type | Description |
|---|---|---|
| ray | Ray |
Ray to copy. |
BooleanCheck 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. |
Vector3Get 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. |
NumberCalculate 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. |
NumberCalculate 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. |
BooleanCheck 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. |
BooleanCheck 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 | nullReturn 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. |
RayClone this ray.