Tokamak problem with objects going throw each other

Started by
3 comments, last by guvidu 15 years, 12 months ago
Hi there, Im using tokamak to do 2d collision. I know its not the ideal way for doing 2d physics.But im almost there and tokamak is good for what i need. The problem im facing is like this. in the update function im puting all objects at position z = 0, Angular momentum x and y at 0 velocity z = 0; Now i dont think this creates the problem im facing. With gravity set to 9.8 (its not a negative number becouse im doing 2d and y = 0 in the top of the screen - but you guys know that:P ) the object behave ok - but the objects move slow with larger gravity like 50 - the objects move as i want - but when let to stay on ground they slowly enter in the ground object - and get throw it. I'm updating relative to frame time - an i have 700fps - so it should be enaugh for calculation. What am i doing wrong? Can you guys tell me? Thanks alot
Advertisement
Quote:Original post by guvidu
I'm updating relative to frame time - an i have 700fps - so it should be enaugh for calculation.
At that kind of framerate relatively small fluctuations can cause instability in the physics simulation. Try capping your physics update to a fixed 60hz and see if that produces more stable results.

Regards,
ViLiO
Richard 'ViLiO' Thomasv.net | Twitter | YouTube
done that -now the objects go throw each other much faster
[lol]

Clearly the issue lies elsewhere then [smile]

What kind of world units are you using for your objects? I think any time I'd used Tokamak I'd gone with 1:1 for units to metres and it seemed good enough.

The only last thing I can think of is that by forcefully changing the velocity.z to 0.f you are not allowing objects to move apart when they are intersecting. Ignoring the velocity and only modifying the positional z might be enough to prevent objects sinking into each other but if that doesn't do it then I'm afraid I'm stumped.

Regards,
ViLiO
Richard 'ViLiO' Thomasv.net | Twitter | YouTube
well - i've tried not setting velocity z to 0 or angular momentum - or both - the problem is not from there. The objects are still sinking.

my window 640x480 sphere diameter 60 - mass 5 - friction 0.4, bounce 0.9 - gravity 500;

:|

Thanks

This topic is closed to new replies.

Advertisement