Localized Physics/Gravity/Collisions

This isn’t so much trouble-shooting but rather a complete noob question about what’s possible in JME and the general direction I should go about doing it. I apologize if this is in the wrong forum.



I’m looking to make a first person space flight game, meaning you control a person who, in turn, controls a ship. I want to make it so you can freely roam the game area but be bound by gravity on whatever ship you’re on.



Preferably, this would mean ships that can be at any angle and speed in 3d space and still have their occupants grounded to the floor and able to walk around inside. I’m not sure where to start in producing this effect.



If it’s impossible, is there a way to do the movement and collision detections without using any physics (i.e. move player nodes’ positions relative to their parent ship node but still collidable with the layout of the ships)?



Any help would be greatly appreciated.

For physics you can use multiple physics spaces and local physics applying (see TestLocalPhysics)

Thanks for your prompt reply. Is there any documentation on working with multiple physics spaces in the same scene?

Just create and attach multiple BulletAppStates, each has one separate physics space.

Just for your information, this trick could do to the Wiki and complete this paragraph :

(Deprecated) Bullet Physics Nodes

Physics Nodes have Bullet Controllers attached and wrap their methods to “simulate” the old physics nodes that were available before alpha-4. The setLocalTranslation/Rotation() info is transferred to the Bullet Objects for simplicity. Do not use Physics Nodes, use PhysicsControls instead. Package: com.jme3.bullet.nodes


It took me one good hour to find the right way to implement different PhysicSpaces :)

Why should I add something to a deprecated section?