Static node to dynamic node problem

I want to change a spatial from static node to dynamic node (with jmePhysic2).

I have this hierarchy:

StaticNode-Node-Container  (It's the container I want to change to dynamic)


When container become dynamic, instead of staying at is place waiting for a force to move it, it goes nowhere  and turn arownd himself.

It seems static node physicbounds does not refesh.

Is it a bug or i forgot to call a refresh methods (which one ?)?

Here an example code.

Wait 5 secondes to see the change :

package tests.statictodynamic;

import com.acarter.scenemonitor.SceneMonitor;
import com.jme.math.Vector3f;
import com.jme.scene.Node;
import com.jme.scene.shape.Box;
import com.jmex.physics.DynamicPhysicsNode;
import com.jmex.physics.StaticPhysicsNode;
import com.jmex.physics.util.SimplePhysicsGame;

public class StaticToDynamic extends SimplePhysicsGame{
   boolean activa = true;
   boolean activa1 = false;
   StaticPhysicsNode staticNode;
   Box visualFallingBox;
   Node n = null;
    protected void simpleInitGame() {

        staticNode = getPhysicsSpace().createStaticNode();

        rootNode.attachChild( staticNode );

        n = new Node("StaticNode");
        final Box visualFloorBox = new Box( "floor", new Vector3f(), 5, 0.25f, 5 );
        //staticNode.attachChild( visualFloorBox );

        visualFallingBox = new Box( "falling box", new Vector3f(), 0.5f, 0.5f, 0.5f );
        visualFallingBox.getLocalTranslation().set( 0, 1f, 0 );



   protected void simpleUpdate() {
           //Remove static node :
           DynamicPhysicsNode dynamicNode = getPhysicsSpace().createDynamicNode();
           rootNode.attachChild( dynamicNode );
           dynamicNode.attachChild( visualFallingBox );

     * The main method to allow starting this class as application.
     * @param args command line arguments
    public static void main( String[] args ) {
        new StaticToDynamic().start();


I'm going to fill a bug report to JME Physics 2 developpers.

I think the cube shouldn't move like this after it's transformation in dynamicNode

Someone know if the project is always active ?

You need to remove the physics collision geometry from the static node. Detaching the visuals does not remove the generated physics bounds. To make this easier you should make the detachable part a separate static physics node initially and delete it when converting to dynamic.

Thank you for your reply.

I did some test. It's the .generatePhysicsGeometry() method which cause the problem.

But I found something weird. When I move the mesh to dynamic node, and detach his physics collision geometry in the static node(I don't call .generatePhysicsGeometry() method). The the dynamic node don't have any physics collision geometry but it detect collision and I can be moved by force.

Is there any cache where the physics collision geometry is stored ?