Get all velocities of body.

serengeor
Posts: 22
Joined: Mon Dec 20, 2010 7:13 pm

Get all velocities of body.

Post by serengeor »

How do I get all velocities applied to rigid body? I need them all so I could save them to xml and load them back when I need them.
I know theres a serializer, but it won't do what I need.

What data do I need to get in order to get the body move the same as before saving to xml?

I tried just getting linear and angular velocities and load them back to the same body, but it gave me not the same results.
XMight
Posts: 32
Joined: Tue Feb 22, 2011 1:00 pm

Re: Get all velocities of body.

Post by XMight »

I don't imagine how such a thing can be done. First of all, all the simulation must be deterministic, and if it is, the simples way is to recreate the simulation to the point when it matches with the result that you want, but this will take time. Other thing is to get all the forces and the stuff for all the objects is the scene, and save them(I never played with). Anyway, it seems that you do something like that, so maybe you don't save everything. How about the worldTransform of the body, you didn't mention it?

I'm interested too if something like that is possible :D
serengeor
Posts: 22
Joined: Mon Dec 20, 2010 7:13 pm

Re: Get all velocities of body.

Post by serengeor »

It should be possible, as long as I can find which velocities/forces/torques? are needed to make the object behave the same as it did before saving its values.

Now I only have position rotation saving, though it should be fine for a level editor, it might not be enough if I plan in game level saving.

I guess I'll just have to try to save everything I can and load it back :)
rraallvv
Posts: 30
Joined: Thu Feb 09, 2012 2:39 am

Re: Get all velocities of body.

Post by rraallvv »

I'm interested too!