Options
All
  • Public
  • Public/Protected
  • All
Menu

Used to show the physics impostor around the specific mesh

Hierarchy

  • PhysicsViewer

Index

Constructors

  • Creates a new PhysicsViewer

    Parameters

    • Optional scene: Scene

      defines the hosting scene

    Returns PhysicsViewer

Methods

  • dispose(): void
  • Clean up physics debug display

    Returns void

  • Hides a body from the physics engine.

    Parameters

    • body: Nullable<PhysicsBody>

      The body to hide.

      This function is useful for hiding a body from the physics engine. It removes the body from the utility layer scene and disposes the mesh associated with it. It also unregisters the render function if the number of bodies is 0. This is useful for hiding a body from the physics engine without deleting it.

    Returns void

  • Hide a physics constraint from the viewer utility layer

    Parameters

    Returns void

  • Hides an impostor from the scene.

    Parameters

    • impostor: Nullable<PhysicsImpostor>

      The impostor to hide.

      This method is useful for hiding an impostor from the scene. It removes the impostor from the utility layer scene, disposes the mesh, and removes the impostor from the list of impostors. If the impostor is the last one in the list, it also unregisters the render function.

    Returns void

  • Shows a debug mesh for a given physics body.

    Parameters

    Returns Nullable<AbstractMesh>

    The debug mesh, or null if the body is already shown.

    This function is useful for visualizing the physics body in the scene. It creates a debug mesh for the given body and adds it to the scene. It also registers a before render function to update the debug mesh position and rotation.

  • Shows a debug mesh for a given physics constraint.

    Parameters

    Returns Nullable<AbstractMesh>

    the debug mesh, or null if the constraint is already shown

  • Renders a specified physic impostor

    Parameters

    • impostor: PhysicsImpostor

      defines the impostor to render

    • Optional targetMesh: Mesh

      defines the mesh represented by the impostor

    Returns Nullable<AbstractMesh>

    the new debug mesh used to render the impostor

  • Shows a debug box corresponding to the inertia of a given body

    Parameters

    Returns Nullable<AbstractMesh>

Legend

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

Settings

Theme