Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

Index

Constructors

Properties

disableAutoAttach: boolean

Should auto-attach be disabled?

isDisposed: boolean

Is this feature disposed?

xrNativeFeatureName: string

The name of the native xr feature name (like anchor, hit-test, or hand-tracking)

Name: "xr-physics-controller" = "xr-physics-controller"

The module's name

Version: 1 = 1

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

  • get attached(): boolean
  • Is this feature attached

    Returns boolean

Methods

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

    Parameters

    Returns void

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

    Returns boolean

    true if successful.

  • detach(): boolean
  • detach this feature. Will usually be called by the features manager

    Returns boolean

    true if successful.

  • dispose(): void
  • Dispose this feature and all of the resources attached

    Returns void

  • Get the headset impostor, if enabled

    Returns undefined | PhysicsImpostor

    the impostor

  • 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: string | WebXRInputSource

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

    Returns Nullable<PhysicsImpostor>

    the impostor or null

  • isCompatible(): boolean
  • This function will be executed during before enabling the feature and can be used to not-allow enabling it. Note that at this point the session has NOT started, so this is purely checking if the browser supports it

    Returns boolean

    whether or not the feature is compatible in this environment

  • setPhysicsProperties(newProperties: { friction?: number; impostorSize?: number | { depth: number; height: number; width: number }; impostorType?: number; restitution?: number }): void
  • Update the physics properties provided in the constructor

    Parameters

    • newProperties: { friction?: number; impostorSize?: number | { depth: number; height: number; width: number }; impostorType?: number; restitution?: number }

      the new properties object

      • Optional friction?: number
      • Optional impostorSize?: number | { depth: number; height: number; width: number }
      • Optional impostorType?: number
      • Optional restitution?: number

    Returns void

Legend

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

Settings

Theme