Sign in to follow this  
guvidu

Tokamak problem with objects going throw each other

Recommended Posts

guvidu    102
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

Share this post


Link to post
Share on other sites
ViLiO    1326
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

Share this post


Link to post
Share on other sites
ViLiO    1326
[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

Share this post


Link to post
Share on other sites
guvidu    102
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this