Skip to main content
gamedev.net
🔒 Locked

ODE physics question

Started by nekoflux Mar 31, 2004 at 3:49 PM 8 replies 1k views
Original Post
nekoflux
nekoflux
I''ve implemented A basic ode example in my engine that acts similar to the boxstack example they ship with it. The physics works great, and the simulation seems to model collisions etc very realistically it runs really slow. I have about 10 boxes in my simlulation and I the standard earth gravity vector of (0.0, -9.81, 0.0) using the stand worldstep function (i dont use faststep). the physics step function runs approximately 20 times per second, and each time I call stepworld with a float representing the number of seconds since I last ran physics.step. (This value is approximately 0.05 since it runs 20 times per second and 1.0 seconds / 20fps = 0.05) buit for some reason it runs really slow, as though it were only running at about 1/4 the speed it should be my rendering and all other code is executing very fast still, so I dont think Im bogging the system down....anybody experience this before? Any feedback would be appreciated. Neko
nekoflux
oliii
oliii
depends on the size of the boxes. if the boxes are like 100 meters a side, then yeah, it''s gonna look like slow motion. Depends also if the timestep you provide is accurate and equal to the real world time step, which it should be, since you pass the elapsed time.
Everything is better with Metal.
oliii
oliii
you can check the timings as well. drop a box of size 2 meters (1 meter half size), with centre at (0, 9.81 + 1.0f, 0), and put a plane ((0, 1, 0), 0), and see how long it takes to collide. should be roughly one second. if it''s not, you got the timings wrong somehow.
Everything is better with Metal.
nekoflux
nekoflux
comment 1 is interesting can you explain what you mean by If the boxes are 100m on each side.

Are you saying its a field of view issu. It seems to me that the size of the box wouldnt make it appear to fall more slowly, and rigid body physics systems generally dont model wind resistance so it should be falling at the same right as a boc with 1meter on each side.

plz explain

thanks

neko
nekoflux
nekoflux
nekoflux
i''ll try the test you describe
nekoflux
Ratman
Ratman
You may want to try joining the mail discussion group for ODE. Theres a lot of good info going back and forth there; try asking there if you still have problems.

ratman
nekoflux
nekoflux
do you have a link to the mailing group?


-N
nekoflux
oliii
oliii
the gravity is the gravity. if the box is 10 meters side and falls down, it will travel it''s body size in one second. for a 100 meters box, it will travel it''s body size in 10 seconds. So it will look a lot slower for the same gravity value. It''s like a "this is small, this is far away" situation, don''t get confused .
Everything is better with Metal.
nekoflux
nekoflux
ollii, you are right, it was entirely a perspective issue.
Thanks for your helpfull insight!

gratefully yours,

neko
nekoflux
oliii
oliii
cool
Everything is better with Metal.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.