Adding `linearSpeed` to a zero mass mesh - is it a bug or an expected behavior?

As we can see on this playground we’re adding speed to a 0 mass mesh, the Mesh itself don’t move at all, but the speed does move the cylinder above it, this isn’t a bug?

Shouldn’t the ground mesh move with its PhysicsImpostor or the cylinder not move as the mesh below?

Why does the mesh don’t move, but the linearSpeed on the ground mesh affects the cylinder above it?

pinging @Cedric

A static impostor (mesh with mass == 0) will not move when applying forces, impulse, linear/angular velocities. It’s static and that’s expected.

Now, the moving cylinder dynamics is part of the physics engine. In your playground, setting ground friction to 0 makes the cylinder not moving.

The same playground with Ammojs instead makes the cylinder static whatever the ground friction is.

For some reason, Cannon takes the linear velocity into account when computing collision response, even for static bodies. It shall not.

Collision response is hard to do right. Some engines do it differently and better than others.


Should I switch the physics engine? Or it depends of what I want to reach?

It all depends on what you want to do. I would base my physics on edge cases like this. Maybe a newer version will change that behavior. I would stick with well defined behavior.

1 Like