Gravity in spaceship, no gravity outside of spaceship


imagine you have a spaceship, build up of houndreds small parts connected with physics joints (when I find a way to subdivide my models --> You have a chacrater to freely move inside of it. Because it would not do best for the gameplay when there's no gravity inside the ships and you would just fly around I want gravity to be applied only on the nodes who are inside the ship, and I want gravity not to be applied outside the ship. When there're some rockets blowing away some parts of the hull this section inside the ship should be considered as "outside" and all the people and things should fly out of the ship and/or die.

Is there a way to do this?

You could use the 'SimpleAreaInfluence' callback as a start.

The idea is that you disable gravity in the PhysicsSpace and only apply gravity to pysicsnodes which are intersecting with a specified area. The boundingbox of your spaceship for example. If your ship is damaged, i'm you could exclude those sections.