RaycastResult Class
Storage for Ray casting hit data.
Constructor
RaycastResult
()
Item Index
Methods
Methods
hasHit
()
Returns true if the ray hit something since the last reset().
reset
()
Reset all result data. Must be done before re-using the result object.
set
(
private
-
normal
-
shape
-
body
-
fraction
stop
()
Can be called while iterating over hits to stop searching for hit points.
Properties
faceIndex
Number
The index of the hit triangle, if the hit shape was indexable.
Default: -1
fraction
Number
Distance to the hit, as a fraction. 0 is at the "from" point, 1 is at the "to" point. Will be set to -1 if there was no hit yet.
Default: -1
isStopped
Boolean
If the ray should stop traversing.
normal
Array
The normal of the hit, oriented in world space.