Raycaster constructor
CameraRenderer object or GPUCurtains class object used to create this Raycaster
The type of the Raycaster.
The CameraRenderer used.
The Camera used.
Pointer position in normalized device coordinates (in the [-1, 1] range).
Ray used to test for intersections.
New CameraRenderer or GPUCurtains instance to use.
Set the pointer normalized device coordinates values (in the [-1, 1] range) based on a mouse/pointer/touch event and the renderer bounding rectangle. Useful if the canvas has a fixed position for example, but you might need to directly use setFromNDCCoords if not.
Mouse, pointer or touch event.
Set the pointer normalized device coordinates (in the [-1, 1] range).
input position along the X axis in the [-1, 1] range where -1
represents the left edge and 1
the right edge.
input position along the Y axis in the [-1, 1] range where -1
represents the bottom edge and 1
the top edge.
Ray-Triangle Intersection with Möller–Trumbore Algorithm.
Set our input vector with the desired attribute value at the given offset defined by our triangleIndex, offset and whether we're using and indexed geometry or not.
Index of the triangle for which to look our attribute value.
Index of the point inside our triangle (0
, 1
or 2
).
Indexed geometry array if defined or null
.
Vertex buffer attribute to get the value from.
Test whether the ray is intersecting a given object, if the is object is actually a projected mesh.
Then, if the recursive flag is set to true
, test if the object's children are intersecting as well.
object to test against.
Whether we should also test against the object's children. Default to true
.
Already existing intersections if any.
Test whether the ray is intersecting a given array of objects.
If the recursive flag is set to true
, test if each object's children are intersecting as well.
Array of objects to test against.
Whether we should also test against each object's children. Default to true
.
Already existing intersections if any.
Utility to help with raycasting (determining what objects in the 3d space the mouse is over).
Example