Physics3D constructor

Physics3D({
  1. PhysicsEngine3D? engine,
  2. Vector3? gravity,
  3. int workerThreads = -1,
  4. int maxBodies = 10240,
  5. bool reportContactStay = false,
  6. bool reportActivation = false,
  7. bool addSystem = true,
})

3-D physics on engine, or on the platform's physics engine when that is null, with workerThreads threads in its job system (below 0: cores minus one). gravity is (0, 9.81, 0) — down — unless given. addSystem false leaves adding system to a world to the game.

Implementation

Physics3D({
  PhysicsEngine3D? engine,
  Vector3? gravity,
  this.workerThreads = -1,
  this.maxBodies = 10240,
  this.reportContactStay = false,
  this.reportActivation = false,
  this.addSystem = true,
}) : _given = engine,
     gravity =
         gravity ?? Vector3(0, PhysicsWorldSettings3D.standardGravity, 0);