World constructor
World({})
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);
}