Description
class Ray
Constructor
new Ray(origin, direction, length)
Parameters
|
Name |
Type |
Description |
|
origin |
Vector3 |
|
|
direction |
Vector3 |
|
optional |
length |
number |
|
Members
length : number
Methods
intersectsBoxMinMax(minimum, maximum) → boolean
Parameters
intersectsBox(box) → boolean
Parameters
intersectsSphere(sphere) → boolean
Parameters
intersectsTriangle(vertex0, vertex1, vertex2) → Nullable<IntersectionInfo>
Parameters
intersectsPlane(plane) → Nullable<number>
Parameters
|
Name |
Type |
Description |
|
plane |
Plane |
|
intersectsMesh(mesh, fastCheck) → PickingInfo
Parameters
|
Name |
Type |
Description |
|
mesh |
AbstractMesh |
|
optional |
fastCheck |
boolean |
|
intersectsMeshes(meshes, fastCheck, results) → Array<PickingInfo>
Parameters
intersectionSegment(sega, segb, threshold) → number
Intersection test between the ray and a given segment whithin a given tolerance (threshold)
@return the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection
Parameters
|
Name |
Type |
Description |
|
sega |
Vector3 |
the first point of the segment to test the intersection against |
|
segb |
Vector3 |
the second point of the segment to test the intersection against |
|
threshold |
number |
the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful |
update(x, y, viewportWidth, viewportHeight, world, view, projection) → Ray
Parameters
|
Name |
Type |
Description |
|
x |
number |
|
|
y |
number |
|
|
viewportWidth |
number |
|
|
viewportHeight |
number |
|
|
world |
Matrix |
|
|
view |
Matrix |
|
static Zero() → Ray
static CreateNew(x, y, viewportWidth, viewportHeight, world, view, projection) → Ray
Parameters
|
Name |
Type |
Description |
|
x |
number |
|
|
y |
number |
|
|
viewportWidth |
number |
|
|
viewportHeight |
number |
|
|
world |
Matrix |
|
|
view |
Matrix |
|
static CreateNewFromTo(origin, end, world) → Ray
Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
transformed to the given world matrix.
Parameters
|
Name |
Type |
Description |
|
origin |
Vector3 |
The origin point |
|
end |
Vector3 |
The end point |
optional |
world |
Matrix |
a matrix to transform the ray to. Default is the identity matrix. |
Parameters
Parameters