PhysicsImpostor

Hierarchy

  • PhysicsImpostor

Index

Constructors

constructor

Properties

afterStep

afterStep: function

this function is executed by the physics engine.

Type declaration

    • (): void
    • Returns void

beforeStep

beforeStep: function

this function is executed by the physics engine.

Type declaration

    • (): void
    • Returns void

friction

friction: number

isDisposed

isDisposed: boolean

mass

mass: number

object

onCollide

onCollide: function

Type declaration

    • (e: object): void
    • Parameters

      • e: object
        • body: any

      Returns void

onCollideEvent

onCollideEvent: Nullable<function>

Legacy collision detection event support

parent

physicsBody

physicsBody: any

Set the physics body. Used mainly by the physics engine/plugin

restitution

restitution: number

type

type: number

uniqueId

uniqueId: number

Static BoxImpostor

BoxImpostor: number

Static CylinderImpostor

CylinderImpostor: number

Static DEFAULT_OBJECT_SIZE

DEFAULT_OBJECT_SIZE: Vector3

Static HeightmapImpostor

HeightmapImpostor: number

Static IDENTITY_QUATERNION

IDENTITY_QUATERNION: Quaternion

Static MeshImpostor

MeshImpostor: number

Static NoImpostor

NoImpostor: number

Static ParticleImpostor

ParticleImpostor: number

Static PlaneImpostor

PlaneImpostor: number

Static SphereImpostor

SphereImpostor: number

Methods

addJoint

applyForce

applyImpulse

clone

createJoint

dispose

  • dispose(): void
  • Returns void

executeNativeFunction

  • executeNativeFunction(func: function): void
  • Execute a function with the physics plugin native code. Provide a function the will have two variables - the world object and the physics body object.

    Parameters

    • func: function
        • (world: any, physicsBody: any): void
        • Parameters

          • world: any
          • physicsBody: any

          Returns void

    Returns void

forceUpdate

  • forceUpdate(): void
  • Force a regeneration of this or the parent's impostor's body. Use under cautious - This will remove all joints already implemented.

    Returns void

getAngularVelocity

getBoxSizeToRef

getLinearVelocity

getObjectCenter

getObjectExtendSize

getParam

  • getParam(paramName: string): any
  • Get a specific parametes from the options parameter.

    Parameters

    • paramName: string

    Returns any

getParentsRotation

getRadius

  • getRadius(): number
  • Returns number

isBodyInitRequired

  • isBodyInitRequired(): boolean
  • Should a new body be generated.

    Returns boolean

registerAfterPhysicsStep

  • registerAfterPhysicsStep(func: function): void
  • Register a function that will be executed after the physics step

    Parameters

    Returns void

registerBeforePhysicsStep

  • registerBeforePhysicsStep(func: function): void
  • Register a function that will be executed before the physics world is stepping forward.

    Parameters

    Returns void

registerOnPhysicsCollide

resetUpdateFlags

  • resetUpdateFlags(): void
  • Returns void

setAngularVelocity

setDeltaPosition

  • setDeltaPosition(position: Vector3): void
  • Parameters

    Returns void

setDeltaRotation

setLinearVelocity

setMass

  • setMass(mass: number): void
  • Specifically change the body's mass option. Won't recreate the physics body object

    Parameters

    • mass: number

    Returns void

setParam

  • setParam(paramName: string, value: number): void
  • Sets a specific parameter in the options given to the physics plugin

    Parameters

    • paramName: string
    • value: number

    Returns void

setScalingUpdated

  • setScalingUpdated(updated: boolean): void
  • Parameters

    • updated: boolean

    Returns void

sleep

syncBoneWithImpostor

  • Sync a bone with this impostor

    Parameters

    • bone: Bone

      The bone to sync to the impostor.

    • boneMesh: AbstractMesh

      The mesh that the bone is influencing.

    • jointPivot: Vector3

      The pivot of the joint / bone in local space.

    • Optional distToJoint: number

      Optional distance from the impostor to the joint.

    • Optional adjustRotation: Quaternion

      Optional quaternion for adjusting the local rotation of the bone.

    Returns void

syncImpostorWithBone

  • Sync impostor to a bone

    Parameters

    • bone: Bone

      The bone that the impostor will be synced to.

    • boneMesh: AbstractMesh

      The mesh that the bone is influencing.

    • jointPivot: Vector3

      The pivot of the joint / bone in local space.

    • Optional distToJoint: number

      Optional distance from the impostor to the joint.

    • Optional adjustRotation: Quaternion

      Optional quaternion for adjusting the local rotation of the bone.

    • Optional boneAxis: Vector3

      Optional vector3 axis the bone is aligned with

    Returns void

unregisterAfterPhysicsStep

  • unregisterAfterPhysicsStep(func: function): void

unregisterBeforePhysicsStep

  • unregisterBeforePhysicsStep(func: function): void

unregisterOnPhysicsCollide

wakeUp

Generated using TypeDoc