World constructor

World({
  1. Vec3? gravity,
  2. Vec3? frictionGravity,
  3. bool allowSleep = false,
  4. Broadphase? broadphase,
  5. Solver? solver,
  6. bool quatNormalizeFast = false,
  7. int quatNormalizeSkip = 0,
  8. bool verbose = false,
})

Implementation

World({
  Vec3? gravity,
  Vec3? frictionGravity,
  this.allowSleep = false,
  Broadphase? broadphase,
  Solver? solver,
  this.quatNormalizeFast = false,
  this.quatNormalizeSkip = 0,
  this.verbose = false
}):super(){
  logger = NRFLogger(verbose);
  if (gravity != null) {
    this.gravity.copy(gravity);
  }
  if (frictionGravity != null) {
    this.frictionGravity = Vec3();
    this.frictionGravity!.copy(frictionGravity);
  }
  this.broadphase = broadphase ?? NaiveBroadphase();
  this.solver = solver ?? GSSolver();
  defaultContactMaterial = ContactMaterial(defaultMaterial, defaultMaterial,
    friction: 0.3,
    restitution: 0.0,
  );
  narrowphase = Narrowphase(this);
  performance.init();
  this.broadphase.setWorld(this);
}