[Plib-users] ssg physics
Brought to you by:
sjbaker
From: Simon <sim...@ho...> - 2004-04-22 07:33:55
|
Hi, heres a summary of it all: =20 I said - Hi, a while ago I posted about trying to hook up a physics = engine to ssg. I don't recall getting any replies. I was wondering if someone could give me an over view of how they go about adding things like = gravity to each object. I have the feeling that I'm missing something really = basic. =20 Wolfram said - Normally, you do something like this per iteration of the physics engine: =20 calc forces=20 convert to accelaration speed =3D speed + accelaration * deltatime position =3D position + speed * deltatime =20 In your case, accelaration is constant =20 Then I said - Hi, thanks Wolfram its great to get a reply although I = don't think I explained myself very well. The aim I'm trying to reach is to = have a stack of blocks on top of each other. I then want to knock them down. = I found this great physics example to do with dice falling down some = stairs. I can get it to work with a non plib scene but I was trying to link it = to an ssg tree. What I really want to know is how everyone goes about that. = =20 In the non plib demo each object maintains a set of physics related properties. There is also a physics class that each inherits from. Basically the physics engine runs constantly and checks then updates = each object in relation to each other object. I think in just writing this I = am beginning to work the answer out myself. Isnt it funny how sometimes = just writing or saying something out loud can make things so much clearer. =20 So now I guess the question is should the physics engine class be added = to the tree or left to run outside of it? It's a little difficult for me = to recall everything as the project has been on hold until this bit gets = worked out. For anyone interested; the demo that I'm basing this on for now is from Chris Haag. I got it off his site originally but that seems to be = down at the moment. Theres a copy of it on the NeHe site: =20 http://nehe.gamedev.net/data/downloads/download.asp?letter=3DS =20 It's called Stairs by Chris Haag. =20 Thanks for the patience, if I get it to work then I could submit it as = an ssg example. I'm using the 3D Studio loader for the dice and the stairs = so the example would incorporate that as well. =20 At that point Adam said - (Feel free to correctme here guys.. ) My understanding is that with game design, the graphics engine (which=20 utilized the scene graph) and the physiscs engines are kept separate. = An=20 object in question (say a car or a block in your example) has access to = both a physics model that represents it's behavior, as well as a pointer to = it's=20 relevant information in the scene graph. That way, everytime you update = an=20 object, it gathers information from it's current state and the physics=20 model, and then uses that information to manupulate it's characteristics = within the scene graph. =20 And that's when I sent the mail that you got and didn't know what it was about. |