You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
world = new oimo.dynamics.World(oimo.collision.broadphase.BroadPhaseType.BVH);
const geoBox = new oimo.collision.geometry.BoxGeometry(new oimo.common.Vec3(1, 1, 1));
const sc = new oimo.dynamics.rigidbody.ShapeConfig();
sc.geometry = geoBox;
const bc = new oimo.dynamics.rigidbody.RigidBodyConfig();
const b = new oimo.dynamics.rigidbody.RigidBody(bc);
// this line
b.setType(oimo.dynamics.rigidbody.RigidBodyType.DYNAMIC);
b.addShape(new oimo.dynamics.rigidbody.Shape(sc));
world.addRigidBody(b);
// (b as any).updateMass();
world.step(0.01);
// 0, 0, 0
console.log(b.getPosition())
If move the setType line after b.addShape, it's OK.
The text was updated successfully, but these errors were encountered:
Code:
If move the
setType
line afterb.addShape
, it's OK.The text was updated successfully, but these errors were encountered: