WebXRControllerPhysics

Add physics impostor to your webxr controllers, including naive calculation of their linear and angular velocity

Hierarchy

Implements

Index

Constructors

constructor

Find examples in Playground

Properties

disableAutoAttach

Find examples in Playground
disableAutoAttach: boolean

Should auto-attach be disabled?

Static Name

Find examples in Playground
Name: string

The module's name

Static Version

Find examples in Playground
Version: number

The (Babylon) version of this module. This is an integer representing the implementation version. This number does not correspond to the webxr specs version

Accessors

attached

Find examples in Playground
  • get attached(): boolean

Methods

addController

Find examples in Playground
  • Manually add a controller (if no xrInput was provided or physics engine was not enabled)

    Parameters

    Returns void

attach

Find examples in Playground
  • attach(): boolean
  • attach this feature Will usually be called by the features manager

    Returns boolean

    true if successful.

detach

Find examples in Playground
  • detach(): boolean

dispose

Find examples in Playground
  • dispose(): void

getHeadsetImpostor

Find examples in Playground
  • Get the headset impostor, if enabled

    Returns PhysicsImpostor | undefined

    the impostor

getImpostorForController

Find examples in Playground
  • Get the physics impostor of a specific controller. The impostor is not attached to a mesh because a mesh for each controller is not obligatory

    Parameters

    • controller: WebXRInputSource | string

      the controller or the controller id of which to get the impostor

    Returns Nullable<PhysicsImpostor>

    the impostor or null

setPhysicsProperties

Find examples in Playground
  • setPhysicsProperties(newProperties: object): void
  • Update the physics properties provided in the constructor

    Parameters

    • newProperties: object

      the new properties object

      • Optional friction?: number
      • Optional impostorSize?: number | object
      • Optional impostorType?: number
      • Optional restitution?: number

    Returns void

Generated using TypeDoc