I wanted to demonstrate a problem with cannon-es appearing not to accelerate a body to which a force is applied, but I can’t get get anything running because I don’t get the Library/Resources/import:
Please explain why.
A body should accelerate when a force is applied.
It looks like the force needs to be applied for each step, i.e. in the loop (that does not make the force stronger).
I assumed the method would set the objects force vector, but each simulation step resets it:
body.applyForce(new CANNON.Vec3(1, 0, 0));
}
function animate() {
console.log(body.force);
// Step the physics world
world.fixedStep()
console.log(body.force);