Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IRigidBody

Hierarchy

  • ILifecycle
  • IGroupMask
    • IRigidBody

Implemented by

Index

Properties

fixRotation

fixRotation: (v: boolean) => void

Type declaration

    • (v: boolean): void
    • Parameters

      • v: boolean

      Returns void

Readonly impl

impl: any

Readonly isAwake

isAwake: boolean

Readonly isSleeping

isSleeping: boolean

Readonly isSleepy

isSleepy: boolean

Readonly rigidBody

rigidBody: RigidBody

setAllowSleep

setAllowSleep: (v: boolean) => void

Type declaration

    • (v: boolean): void
    • Parameters

      • v: boolean

      Returns void

setAngularDamping

setAngularDamping: (v: number) => void

Type declaration

    • (v: number): void
    • Parameters

      • v: number

      Returns void

setAngularFactor

setAngularFactor: (v: IVec3Like) => void

Type declaration

setIsKinematic

setIsKinematic: (v: boolean) => void

Type declaration

    • (v: boolean): void
    • Parameters

      • v: boolean

      Returns void

setLinearDamping

setLinearDamping: (v: number) => void

Type declaration

    • (v: number): void
    • Parameters

      • v: number

      Returns void

setLinearFactor

setLinearFactor: (v: IVec3Like) => void

Type declaration

setMass

setMass: (v: number) => void

Type declaration

    • (v: number): void
    • Parameters

      • v: number

      Returns void

useGravity

useGravity: (v: boolean) => void

Type declaration

    • (v: boolean): void
    • Parameters

      • v: boolean

      Returns void

Methods

Optional Private preload

  • preload(component: any): void
  • __preload is called before every onLoad.
    It is used to initialize the builtin components internally,
    to avoid checking whether onLoad is called before every public method calls.
    This method should be removed if script priority is supported.

    Parameters

    • component: any

    Returns void

addGroup

  • addGroup(v: number): void

addMask

  • addMask(v: number): void

applyForce

applyImpulse

applyLocalForce

applyLocalImpulse

applyLocalTorque

applyTorque

clearForces

  • clearForces(): void

clearState

  • clearState(): void

clearVelocity

  • clearVelocity(): void

getAngularVelocity

getGroup

  • getGroup(): number

getLinearVelocity

getMask

  • getMask(): number

getSleepThreshold

  • getSleepThreshold(): number

initialize

Optional lateUpdate

  • lateUpdate(dt: number): void
  • LateUpdate is called every frame, if the Component is enabled.
    This is a lifecycle method. It may not be implemented in the super class.
    You can only call its super class method inside it. It should not be called manually elsewhere.

    Parameters

    • dt: number

      the delta time in seconds it took to complete the last frame

    Returns void

Optional onDestroy

  • onDestroy(): void
  • Called when this component will be destroyed.
    This is a lifecycle method. It may not be implemented in the super class.
    You can only call its super class method inside it. It should not be called manually elsewhere.

    Returns void

Optional onDisable

  • onDisable(): void
  • Called when this component becomes disabled or its node becomes inactive.
    This is a lifecycle method. It may not be implemented in the super class. You can only call its super class method inside it. It should not be called manually elsewhere.

    Returns void

Optional onEnable

  • onEnable(): void
  • Called when this component becomes enabled and its node is active.
    This is a lifecycle method. It may not be implemented in the super class. You can only call its super class method inside it. It should not be called manually elsewhere.

    Returns void

Optional onFocusInEditor

  • onFocusInEditor(): void

Optional onLoad

  • onLoad(): void
  • When attaching to an active node or its node first activated.
    onLoad is always called before any start functions, this allows you to order initialization of scripts.
    This is a lifecycle method. It may not be implemented in the super class.
    You can only call its super class method inside it. It should not be called manually elsewhere.

    Returns void

Optional onLostFocusInEditor

  • onLostFocusInEditor(): void

Optional onRestore

  • onRestore(): void
  • onRestore is called after the user clicks the Reset item in the Inspector's context menu or performs an undo operation on this component.

    If the component contains the "internal state", short for "temporary member variables which not included
    in its CCClass properties", then you may need to implement this function.

    The editor will call the getset accessors of your component to record/restore the component's state
    for undo/redo operation. However, in extreme cases, it may not works well. Then you should implement
    this function to manually synchronize your component's "internal states" with its public properties.
    Once you implement this function, all the getset accessors of your component will not be called when
    the user performs an undo/redo operation. Which means that only the properties with default value
    will be recorded or restored by editor.

    Similarly, the editor may failed to reset your component correctly in extreme cases. Then if you need
    to support the reset menu, you should manually synchronize your component's "internal states" with its
    properties in this function. Once you implement this function, all the getset accessors of your component
    will not be called during reset operation. Which means that only the properties with default value
    will be reset by editor.

    This function is only called in editor mode.

    Returns void

removeGroup

  • removeGroup(v: number): void

removeMask

  • removeMask(v: number): void

Optional resetInEditor

  • resetInEditor(): void
  • Called to initialize the component or node’s properties when adding the component the first time or when the Reset command is used. This function is only called in editor.

    Returns void

setAngularVelocity

setGroup

  • setGroup(v: number): void

setLinearVelocity

setMask

  • setMask(v: number): void

setSleepThreshold

  • setSleepThreshold(v: number): void

sleep

  • sleep(): void

Optional start

  • start(): void
  • Called before all scripts' update if the Component is enabled the first time.
    Usually used to initialize some logic which need to be called after all components' onload methods called.
    This is a lifecycle method. It may not be implemented in the super class.
    You can only call its super class method inside it. It should not be called manually elsewhere.

    Returns void

Optional update

  • update(dt: number): void
  • Update is called every frame, if the Component is enabled.
    This is a lifecycle method. It may not be implemented in the super class.
    You can only call its super class method inside it. It should not be called manually elsewhere.

    Parameters

    • dt: number

      the delta time in seconds it took to complete the last frame

    Returns void

wakeUp

  • wakeUp(): void

Generated using TypeDoc