Page 1 of 1

Some General Pointers needed

Posted: Tue May 06, 2008 3:03 am
by instinct-vfx
Hi everyone,

i just started playing with chipmunk and must say that so far i like what i see. I am rather new to
physics implementation (tho i got a not too bad background) and hence i got some general questions
as well as some rather specific questions when comparing chipmunk to other engines.

As a bit of info i am an absolute Ski Stunt Simulator lover and that is the main "Force" driving me :P
I got a bunch of conceptual ideas that will follow a similar path. So basically i am looking to implement
a control scheme similar to Ski Stunt Sim or Diver. This involves a very basic Ragdoll that is controlled
by the user's mouse (up/down = stand/crouch and left/right = lean).

I have taken a look at the Farseer Engine (wich was used by its creator to implement Diver) and it seemed
pretty straight forward for what i plan, but i dont really want to use XNA or Silverlight so i started looking
at other engines.

First of all regarding the general Joint Setup. If i am to create a Ragdoll to be controlled by the mouse, how
would i best create it ? Farseer has a rotational Spring together with a revolute joint that has limits. The
rotational Spring also has a dynamic targetangle. That seems pretty straight forward to me, but how would
i create a similar setup in Chipmunk?

Also if i was to create a bike game for example how can i apply torque ? I only found linear force in the Docs.
And was looking for something like a "motor" force.

And generally how would the Graphics and the Physics Stepping best be synced ? If i go the recommended route
of a fixed time step what is a good way to sync it with the GFX ? I assume best would be having a Physics Loop
that also has the drawing code after updating ?

Thanks a lot in advance and sorry if i missed something obvious in the docs,
Thorsten
Thorsten

Re: Some General Pointers needed

Posted: Thu May 08, 2008 3:26 pm
by maximile
Hey,

I can't help much but until someone else replies:

For a well-documented example of applying torque, have a look at the Moon Buggy tutorial: http://files.slembcke.net/chipmunk/tuto ... ial.tar.gz
That also shows how to create a motor with a maximum speed.

For time timestep issue, updating the graphics once after every physics step is often perfectly good, but you might want to go with something a bit better to make it run more smoothly on all computers. I'd usually recommend looking here: http://www.gaffer.org/game-physics/fix-your-timestep
But it's currently not available, so here's Google's ugly cache: http://66.102.9.104/search?q=cache:bK3o ... =clnk&cd=1

Rotational springs aren't implemented in Chipmunk, but I imagine you could achieve the same effect either by applying torque each step or by using the damped spring functions. The moon buggy tutorial has an example of that too.

Hope that helps a bit.

Re: Some General Pointers needed

Posted: Mon May 12, 2008 1:28 am
by slembcke
Somebody asked a similar question about the rotational spring recently.

viewtopic.php?f=1&t=120&p=575&hilit=#p575

That should probably help.