Some issues

Hi their irrisor,



While working with the physics editor, I have come up with some minor issue, it might be something that I am missing, or features that will be added later.


  1. Do the jMePhysics2 have the ability to remove the joints from the physics world ?
  2. When trying to save a DynamicPhysicsNode with geometry attached to it, it give me that saving geometry maps are currently not supported. Do I need to make something ?



    Thanks in advance.
  1. it should, is there a setActive or delete method? (I don't have the code at hand)
  2. it's just a warning, right? if you don't use geometry maps (or don't know what they are), please ignore it for now

Hi their irrisor,



For the joints:



You are right, the setActive(false) will remove the joint from the update, but I have had some complications here.

I have to give the user the choice to rollback the deletion of the physics joint, so in the undo method their, setActive(true) will not re add it. I don't know if this is a work around, but I made the physics world to create another joint, while keeping all the information about the previous node their, then coppied the attributes to the new created one ( NodesList, Axis List ), worked like charm, but I figured out another little issue with the axis copy method.



In the copy method of the JointAxis

 setRelativeToSecondObject( toCopy.isRotationalAxis() );


Which must be changed.

Second, if the setRelativeToSecondObject is set to true, the physics world just hangs.

I am working with it right now, and will supply more info about the model issue. But its not a warning, the editor refuses save correctly and don't load the model corretly.
  1. you are not taking about geometry maps, right? but about trimesh geometry. That's not implemented and won't work. You can implement it in OdeMesh if you really need it. It cannot be implemented in PhysicsMesh as no geometry data is kept there, currently.


Outrunner said:
setActive(true) will not re add it.

but it should - can you provide a short testcase? (works over here)

Outrunner said:

 setRelativeToSecondObject( toCopy.isRotationalAxis() );



fixed

Outrunner said:

Second, if the setRelativeToSecondObject is set to true, the physics world just hangs.

Works in the tests (TestMarble, TestVehicle). Do you have a failing testcase?
Works in the tests (TestMarble, TestVehicle). Do you have a failing testcase?



I think it was my bad, as I didn't check if their is another rotationalAxis created by the same joint, I should disable this option if their is one rotational axis. This case happened when their is only one rotationalAxis and you set it relative.


Still irrisor in the TestBasicJoints, I tried this.

       
        InputAction dJoint = new InputAction() {
            public void performAction( InputActionEvent evt ) {
                if ( evt.getTriggerPressed() ) {
                   joint2.setActive(false);
                }
            }
        };
       
        InputAction aJoint = new InputAction() {
            public void performAction( InputActionEvent evt ) {
                if ( evt.getTriggerPressed() ) {
                   joint2.setActive(true);
                }
            }
        };

        input.addAction( dJoint, InputHandler.DEVICE_KEYBOARD, KeyInput.KEY_1, InputHandler.AXIS_NONE, false );
        input.addAction( aJoint, InputHandler.DEVICE_KEYBOARD, KeyInput.KEY_2, InputHandler.AXIS_NONE, false );



When the joint is removed the physicsSpace re add it when set to active. Or I am doing something wrong ?


It cannot be implemented in PhysicsMesh as no geometry data is kept there, currently.

Its not that critical for me know, but are you planning to add this soon, I don't want to add anything out side.
Outrunner said:

It cannot be implemented in PhysicsMesh as no geometry data is kept there, currently.

Its not that critical for me know, but are you planning to add this soon, I don't want to add anything out side.

No I don't plan anything about it. But patches are welcome :)

regarding active: your code should work, if it does not it is most probably a bug