best way to simulate a glider?

Official forum for the Chipmunk2D Physics Library.
Post Reply
littleblack
Posts: 2
Joined: Thu Aug 06, 2009 10:52 pm
Contact:

best way to simulate a glider?

Post by littleblack »

I am making a game , the main object is a glider, after giving glider a speed, player can control wing's angle to move down or up in the sky. I am considering to apply verticle and horizonal force to the body of glider object depends on the wing's angle. Any better sulotion?
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: best way to simulate a glider?

Post by slembcke »

No, that would be the correct way to do it.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
littleblack
Posts: 2
Joined: Thu Aug 06, 2009 10:52 pm
Contact:

Re: best way to simulate a glider?

Post by littleblack »

cpBodyApplyForce works? it seems that this function apply a force for ever and will accelerate the body.
User avatar
Tam Toucan
Posts: 141
Joined: Tue Jun 23, 2009 4:26 pm
Contact:

Re: best way to simulate a glider?

Post by Tam Toucan »

Yes, you need to call cpBodyResetForces(body). Usually you have a "updateForces" function that you call before each cpSpaceStep and reset them (and recalculate) in there.
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests