Physic engine doesn't notice a change of size

Hy, i am trying to change the size of a loaded model, but the physic engine doesn't notice that. I have spend a lot of time, but didn't find a solution. Another thing that is not clear to me too is the question, whether the StaticPhysicsObject should be created and added to the PhysicWorld before or after the node (myNode) is added to the rootNode? In the most examples the StaticPhysicsObject is added before.



Here is the code. Please help me to get it to work:





Node myNode;

That's true. ODE does not support changing the scale of an object, the only way would be to recreate the geometry. This in turn is not done by jmephysics.



As a workaround you can (re)create the physics object after changing the scale (and probably disable/remove the old one).

Arghhh, good to hear an explanation. Thank you, now i can go on :slight_smile:



Maybe it would be a good idea to have something like a sticky faq-thread to store physics related information like that?

Hmm another problem. How can i make a locale translation? When i change the line



myNode.setLocalScale(0.1f);



to



myNode.setLocalTranslation(new Vector3f(0, 20, 0));



the physic engine doesn't notice it.




As a workaround you can (re)create the physics object after changing the scale (and probably disable/remove the old one).


Irrisor, maybe we have missunderstood each other? I want to change the size or want to make a translation or want to rotate my model direct after loading it (so before i create the StaticPhysicsObject).

I think this must be possible, or?

Oh! Yes, I did not read your code carefully - thought you were changing that after creating a physics object…



The scale is in deed not regarded for TriMeshes… But at least translation should be… but is not either!!

I unfortunately don't have time to fix this… maybe someone else can…

But at least translation should be... but is not either!!
I unfortunately don't have time to fix this... maybe someone else can...


I think translation and rotation should be possible, otherwise it doesn't make sence to use Trimeshes with the physic engine.

Unfortunately i am not able to do this on my own, so i hope someone else will find the time to do it.

I think this is realy important for jmephysics.

Thanks irrisor.
justin said:

I think this is realy important for jmephysics.

It is!

Ok, scale, translation and rotation are regarded for trimeshes, now. Though scale is not updated by syncWithGraphical() (as explained above).

Please have a try.

Oh that is a wonderful news at the right time! I will test it tomorrow.



Thank you very much XD !

Sorry irrisor i have no time for a full test at the moment. Maybe in one week. I will let you know.