PhysicsRaycastResult

Holds the data for the raycast result

see

https://doc.babylonjs.com/how_to/using_the_physics_engine

Hierarchy

  • PhysicsRaycastResult

Index

Properties

hasHit

Find examples in Playground
hasHit: boolean

Gets if there was a hit

hitDistance

Find examples in Playground
hitDistance: number

Gets the distance from the hit

hitNormalWorld

Find examples in Playground
hitNormalWorld: Vector3

Gets the hit normal/direction in the world

hitPointWorld

Find examples in Playground
hitPointWorld: Vector3

Gets the hit point in the world

rayFromWorld

Find examples in Playground
rayFromWorld: Vector3

Gets the ray "start point" of the ray in the world

rayToWorld

Find examples in Playground
rayToWorld: Vector3

Gets the ray "end point" of the ray in the world

Methods

calculateHitDistance

Find examples in Playground
  • calculateHitDistance(): void
  • Calculates the distance manually

    Returns void

reset

Find examples in Playground
  • Resets all the values to default

    Parameters

    • Optional from: Vector3

      The from point on world space

    • Optional to: Vector3

      The to point on world space

    Returns void

setHitData

Find examples in Playground
  • setHitData(hitNormalWorld: IXYZ, hitPointWorld: IXYZ): void
  • Sets the hit data (normal & point in world space)

    Parameters

    • hitNormalWorld: IXYZ

      defines the normal in world space

    • hitPointWorld: IXYZ

      defines the point in world space

    Returns void

setHitDistance

Find examples in Playground
  • setHitDistance(distance: number): void
  • Sets the distance from the start point to the hit point

    Parameters

    • distance: number

    Returns void

Generated using TypeDoc