Class OimoPhysicsStrategy

Physics strategy implementation using the Oimo.js physics engine. This class provides physics simulation capabilities for 3D objects in the scene. It implements the PhysicsStrategy interface to integrate with the Rhodonite framework.

Implements

Constructors

Properties

__world: any

The shared Oimo physics world instance. All physics bodies are added to this single world for simulation.

__worldProperty: PhysicsWorldProperty = ...

Global physics world properties shared across all instances. Contains gravity settings and randomization options.

Methods

  • Sets the rotation of the physics body using Euler angles. Recreates the physics body with the new rotation while preserving other properties.

    Parameters

    • eulerAngles: IVector3

      The new Euler angles (in radians) to set for the physics body

    Returns void

  • Sets the world position of the physics body. Recreates the physics body with the new position while preserving other properties.

    Parameters

    • worldPosition: IVector3

      The new world position to set for the physics body

    Returns void

  • Sets the scale of the physics body. Recreates the physics body with the new scale applied to the original local scale while preserving other properties.

    Parameters

    • scale: IVector3

      The scale factors to apply to the physics body's dimensions

    Returns void

  • Sets up the physics shape for the given entity with specified properties. Creates a physics body in the Oimo world with the provided configuration.

    Parameters

    • prop: PhysicsPropertyInner

      The physics properties defining the shape, size, position, and material properties

    • entity: ISceneGraphEntity

      The scene graph entity to associate with this physics body

    Returns void

  • Advances the physics simulation by one time step. This static method should be called once per frame to update all physics bodies in the shared world. It processes collisions, applies forces, and updates positions.

    Returns void