How to properly rotate and move objects in JBullet?

Ok, I’ve just about gotten JBullet integrated into my game engine now. I have a couple of issues/questions though before I can proceed further:

  1. With an animated mesh, what happens if the mesh “animates” itself into a collidable object? Will JBullet back it out? Or will everything “explode?”

  2. How do I properly rotate or move an object from user input? Once again, I’m worried that if I directly setRotation() or setLocation() into a collidable object that things might “explode.” Is there a proper way to handle user input for these things and still maintain fluid user control?

I’m still a bullet newbie so take my answers with a grain of salt.

  1. The collidable object will be backed out. Check out the Static Concave Mesh Demo on the JBullet site. Press g to start animating the mesh.

  2. If you need to move an object you should use a kinamatic rigid body. Read more about it in the user manual. Also most of the demos switch between kinematic an dynamic when you drag an object with the mouse.

Yep, that explained it! I also discovered that if you manually set the Mass to 0 you can also take control of the object.

Thanks!