Class RayHelper
Methods
attach To Mesh
-
attachToMesh(
mesh: AbstractMesh,
meshSpaceDirection?: Vector3,
meshSpaceOrigin?: Vector3,
length?: number,
): voidAttach a ray helper to a mesh so that we can easily see its orientation for instance or information like its normals.
Parameters
- mesh: AbstractMesh
Defines the mesh we want the helper attached to
OptionalmeshSpaceDirection: Vector3Defines the direction of the Ray in mesh space (local space of the mesh node)
OptionalmeshSpaceOrigin: Vector3Defines the origin of the Ray in mesh space (local space of the mesh node)
Optionallength: numberDefines the length of the ray
Returns void
- mesh: AbstractMesh
detach From Mesh
-
Detach the ray helper from the mesh it has previously been attached to.
Returns void
dispose
-
Dispose the helper and release its associated resources.
Returns void
hide
-
Hides the ray we are debugging.
Returns void
As raycast might be hard to debug, the RayHelper can help rendering the different rays in order to better appreciate the issue one might have.
See
https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/picking_collisions#debugging