Ray class final
A ray: an origin and a direction.
The direction is not normalized automatically, and that is deliberate.
Testing a mesh happens in the mesh's local space, which means transforming
the ray by the inverse world matrix — and under scale that changes the
direction's length. Leaving it alone is what keeps the returned t measured
in the original space's units, so distances from differently scaled objects
remain comparable. Call normalizeDirection when you want a unit ray.
A mutable object with out-style methods, because picking runs inside a
pointer-move handler and should not allocate per candidate mesh.
Constructors
Properties
Methods
-
copyFrom(
Ray other) → void -
normalizeDirection(
) → Ray - Normalizes direction in place and returns this ray.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pointAt(
double t, [Vector3? out]) → Vector3 -
The point at distance
talong the ray. -
setFrom(
Vector3 origin, Vector3 direction) → void -
toString(
) → String -
A string representation of this object.
override
-
transformInto(
Matrix4 inverse, Ray out) → Ray -
Rewrites
outas this ray expressed in the spaceinversemaps into.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited