Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PhysicsRaycastResult

Holds the data for the raycast result

see

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

Hierarchy

  • PhysicsRaycastResult

Index

Accessors

hasHit

  • get hasHit(): boolean
  • Gets if there was a hit

    Returns boolean

hitDistance

  • get hitDistance(): number
  • Gets the distance from the hit

    Returns number

hitNormalWorld

  • Gets the hit normal/direction in the world

    Returns Vector3

hitPointWorld

  • Gets the hit point in the world

    Returns Vector3

rayFromWorld

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

    Returns Vector3

rayToWorld

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

    Returns Vector3

Methods

calculateHitDistanceSearch playground for calculateHitDistance

  • calculateHitDistance(): void
  • Calculates the distance manually

    Returns void

resetSearch playground for reset

  • 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

setHitDataSearch playground for setHitData

  • 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

setHitDistanceSearch playground for setHitDistance

  • setHitDistance(distance: number): void
  • Sets the distance from the start point to the hit point

    Parameters

    • distance: number

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method