aerys / minko

3D framework for web, desktop and mobile devices.
http://minko.io
Other
906 stars 210 forks source link

Bullet fixed timestep #174

Closed martonperei closed 8 years ago

martonperei commented 10 years ago

Hi!

Are there any plans on creating a separate 'update' signal to decouple rendering and logic updates? It would be nice to be able to run bullet with a fixed timestep unrelated to the fps.

Thanks!

warrenseine commented 10 years ago

Basically, you want to call PhysicsWorld::frameBeginHandler on your own. I don't think there's a way to do that right now, but you can try to remove frameBegin registration and run a timer to call the handler yourself.

JMLX42 commented 10 years ago

For now you should implement a public PhysicsWorld::step method that does what PhysicsWorld::frameBeginHandler does today, and make PhysicsWorld::frameBeginHandler call PhysicsWorld::step.

About creating a separate 'update' signal to decouple rendering and logic updates: yes. They are not nammed properly, but the SceneManager::frameBegin and frameEnd signals are supposed to do this. We'll have to clarify that in the next beta, especially as we want to facilitate the creation of worker/threaded components that will have to mess with this kind of sync.

martonperei commented 9 years ago

I think bullet uses fixed timesteps internally anyways, so this is a non-issue. A separate update signal would be nice for other components, though.