Manages the OIMO physics engine for FUDGE. Multiple instances may be created, one is active at a time. All methods are static and use the currently active instance. At startup, a default instance is created and become the active instance Attaching a ComponentRigidbody to a Node places a physics collider in the physics instance active at that time.

Author

Marko Fehrenbach, HFU 2020

Constructors

Properties

settings: PhysicsSettings = ...

The SETTINGS that apply to the physical world. Ranging from things like sleeping, collisionShapeThickness and others

Accessors

Methods

  • Returns the actual used world of the OIMO physics engine. No user interaction needed - Only for advanced users that need to access it directly

    Returns World

  • Add a new OIMO Joint/Constraint to the active instance, happens automatically when adding a FUDGE Joint Component

    Parameters

    Returns void

  • Called internally to inform the physics system that a joint has a change of core properties and needs to be recreated.

    Parameters

    Returns void

  • Connect all joints that are not connected yet. Used internally no user interaction needed. This functionality is called and needed to make sure joints connect/disconnect if any of the two paired ComponentRigidbodies change.

    Returns void

  • Giving a ComponentRigidbody a specific identification number so it can be referenced in the loading process. And removed rb's can receive a new id.

    Returns number

  • Cast a RAY into the physical world from a origin point in a certain direction. Receiving informations about the hit object and the hit point. Do not specify a _group to raycast the whole world, else only bodies within the specific group can be hit.

    Parameters

    Returns RayHitInfo

  • Remove the OIMO Joint/Constraint to the active instance, happens automatically when removing a FUDGE Joint Component

    Parameters

    Returns void

  • Simulates the physical world. _deltaTime is the amount of time between physical steps in seconds. Default is Loop.timeFrameGame / 1000 to run in sync with the Loop. The maximum value is 1/30 of a second, to have more consistent frame calculations.

    Parameters

    • _deltaTime: number = ...

    Returns void