stephengold / Libbulletjme

A JNI interface to Bullet Physics and V-HACD
https://stephengold.github.io/Libbulletjme/lbj-en/English/overview.html
Other
84 stars 10 forks source link

protected setCollisionFlags #1

Closed YanisBDF closed 4 years ago

YanisBDF commented 4 years ago

Hello, I want to add a collision flag to my PhysicsRigidBody but I can't beacause the method setCollisionFlag is protected, same for setActivationState.

stephengold commented 4 years ago

There's a PhysicsRigidBody.setContactResponse() method. Do you have some other reason to modify the collision flags?

There's a PhysicsCollisionObject.activate() method and a PhysicsRigidBody.setEnableSleep() method. Do you have some other reason to modify the activation state?

YanisBDF commented 4 years ago

I want to add an activation state because, when I spawn a stack of cube, they switch to "active tag" to "wants desactivation" and finally to "island sleeping" and when I kill a cube in the bottom of the stack, the others won't fall.

stephengold commented 4 years ago

After you kill the bottom cube you should invoke activate() on any bodies that might be affected by the change. That should wake them up (if they're sleeping) and allow them to fall.

stephengold commented 4 years ago

@YanisBDF Are the existing methods sufficient for your needs? If they are, I'll close this issue.

YanisBDF commented 4 years ago

Yes ! Thanks !