Hi Guys,
I’m currently struggling with an issue regarding PhysicsNodes. I’m modelling a solar system, and I’ve created a class for my planets etc (see http://hub.jmonkeyengine.org/groups/physics/forum/topic/issues-with-spheres-textures-and-physics-nodes/) that builds two spheres and a physics node for the planet. The physics node is attached directly to the bulletAppState in Main. The two spheres are attached to a Node within my planet class.
I initialise these objects within another class called SolarSystem. This has a method which creates a planet at a specific location, and a sun. These objects are then attached to a node internal to the SolarSystem object. Lastly the solar system node object is attached to my rootNode in Main.
So the basic node chain is:
Planet/Sun > Node in Planet object > Node in SolarSystem object > rootNode
To get my specific locations for planets/sun, I specify setLocalTranslation on the “Node in Planet Object”. The node in my SolarSystem object gets attach at Vector3f.ZERO.
The problem I am running into now is that whilst my objects are showing up correctly. Only one of my Physics nodes is. I.e. I’ve created a solar system with 1 sun and 1 planet. They both show up fine, but only the physics node around my sun (at Vector3f.ZERO) is working. I can fly straight through my planet.
My questions would be:
- Am I doing things the right way with regard to my node chaining? Or should I be attaching everything directly to the rootNode?
- How can I debug my physics nodes? I’ve tried using .attachDebugShape() on them, but that doesn’t show up.
Any help gratefully received!