RapierPhysicsManager

RapierPhysicsManager

The Rapier physics manager is a model-side service with the public name "RapierPhysicsManager". It creates a Rapier world to manage a physics simulation using Worldcore objects. Actors can add the AM_RapierPhysics mixin to give them access to the simulation. Objects in the simulation will automatically have their physics state synched and snapshotted.

When it's created, the physic manager can be passed an options object containing the gravity vector in meters/second, and how often the simulation will run in milliseconds.

class MyModelRoot extends ModelRoot {
  static modelServices() { return [{service: RapierPhysicsManager, options: {gravity: [0,-9.8, 0], timeStep: 15}}] }
}

Extends

  • ModelService