Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Oct 14, 2011 3:55 am 
Offline

Joined: Fri Oct 14, 2011 3:48 am
Posts: 1
Hi guys,
as topic,how to integrate it into my game loop link this:
while(true)
{
input();
updateGameWorlds(delta time);
updatePhysics(delta time);
updateCollisions(delta time);
updateAnimations(delta time);
updateAudios(delta time);
render();
}
Besides,how to avoid the data duplication in game worlds,physics engine,render engine!
Thanks a lot!


Top
 Profile  
 
PostPosted: Mon Oct 17, 2011 1:51 pm 
Offline

Joined: Fri May 13, 2011 1:11 pm
Posts: 62
Asuming your physics engine is leading, your controls would control a kinematic object, directly driving said object in the physics engine.

You then step the physics engine each "tick".
You slap on an update callback to each object and have this callback update the visual world.

There is no way to avoid data "duplication" though, as both the physics and the visual world need their own object representation, where they are being kept in sync with the callback.

Update audio just looks weird, tbh, you should first start reading up general game-engine information and how they are put together, and how everything works.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group