RayHelper

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

http://doc.babylonjs.com/babylon101/raycasts#debugging

Hierarchy

  • RayHelper

Index

Constructors

constructor

Find examples in Playground

Properties

ray

Find examples in Playground

Defines the ray we are currently tryin to visualize.

Methods

attachToMesh

Find examples in Playground
  • Attach 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

    • Optional meshSpaceDirection: Vector3

      Defines the direction of the Ray in mesh space (local space of the mesh node)

    • Optional meshSpaceOrigin: Vector3

      Defines the origin of the Ray in mesh space (local space of the mesh node)

    • Optional length: number

      Defines the length of the ray

    Returns void

detachFromMesh

Find examples in Playground
  • detachFromMesh(): void
  • Detach the ray helper from the mesh it has previously been attached to.

    Returns void

dispose

Find examples in Playground
  • dispose(): void
  • Dispose the helper and release its associated resources.

    Returns void

hide

Find examples in Playground
  • hide(): void
  • Hides the ray we are debugging.

    Returns void

show

Find examples in Playground
  • Shows the ray we are willing to debug.

    Parameters

    • scene: Scene

      Defines the scene the ray needs to be rendered in

    • Optional color: Color3

      Defines the color the ray needs to be rendered in

    Returns void

Static CreateAndShow

Find examples in Playground
  • Helper function to create a colored helper in a scene in one line.

    Parameters

    • ray: Ray

      Defines the ray we are currently tryin to visualize

    • scene: Scene

      Defines the scene the ray is used in

    • color: Color3

      Defines the color we want to see the ray in

    Returns RayHelper

    The newly created ray helper.

Generated using TypeDoc