Mass of rigidBodyControl

For a simple example of my problem, I’ll use the physics tutorial code, but change:

floor_phy = new RigidBodyControl(0.0f);

to

floor_phy = new RigidBodyControl(-0.01f);

The floor fell down. I assumed it’s a weight issue, since the tutorial floor supports a bunch of bricks, so I changed it to:
floor_phy = new RigidBodyControl(-100000.0f);

Obviously, with such a large negative weight, the floor should shoot up like a rocket, but instead it simply falls down like before.

This leads to two questions:
1 - is negative mass supported at all?
2 - how can I implement a platform that goes up and can carry other objects on it without caring about their mass, but still has physics? I was thinking about perhaps checking mass of colliding objects and offset for it, but I’m not sure how the physics engine would cope with that.

More specifically, imagine a bunch of platforms floating up like bubbles in water, but there are objects falling down as well - with gravity, like different size of sand thrown into the glass. Player has to jump from one flake to another if the one he’s standing on is about to collide with falling object, else the platform will flip or tilt from collision and loose the ability to support the player. sometimes permanently, sometimes just until settling back.

No, you can’t have negative mass, but you can use RigidBody.setGravity(Vector3f) to override the gravity for a single rigidbody

That helped, thank you!

No clue but it’s best if you abs the value, since negative mass doesn’t make sense, at least in my book :wink:

I believe you want to set the platform to be kinematic. See the tutorial here.

Also, about this:

This is a common misconception. When there is no drag force (from the air), the acceleration of all objects is the same, no matter their mass. See this video for a demonstration of a bowling ball and a feather falling at the same speed, around minute 2:50 (it’s actualliy quite beautiful to watch)