World constructor
World({})
Implementation
World({
Vector3? gravity,
Vector3? 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.setFrom(gravity);
}
if (frictionGravity != null) {
this.frictionGravity = Vector3.zero();
this.frictionGravity!.setFrom(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);
}