# Box2D Forums

 It is currently Sat May 18, 2013 9:54 am

 All times are UTC - 8 hours [ DST ]

 Page 1 of 1 [ 4 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Is a top view car physic possible?Posted: Sun Jan 30, 2011 9:31 am

Joined: Sun Jan 30, 2011 9:24 am
Posts: 2
Hello, I'm new to box2d physics engine and trying to figure out how the things work. Me and a friend working on a project which is a top-view car game (like gta1-2). Anyway, my question is, "is it possible to use friction, joints, bodies and more that box2d promises on a car for a top view game?

Top

 Post subject: Re: Is a top view car physic possible?Posted: Sun Jan 30, 2011 11:38 am

Joined: Mon Dec 27, 2010 10:42 pm
Posts: 23
Yeah

Top

 Post subject: Re: Is a top view car physic possible?Posted: Tue Feb 01, 2011 12:42 am

Joined: Sun Jan 30, 2011 9:24 am
Posts: 2
Gan wrote:
Yeah

Top

 Post subject: Re: Is a top view car physic possible?Posted: Tue Feb 01, 2011 9:56 pm

Joined: Mon Jul 27, 2009 6:46 am
Posts: 230
Lol @ Gan. "Yeah."

There have been other forum posts about it, and an engine made in Flash supports it (the quick box2d one I think).

Anyways, you can try making a rectangle as the car body, then four rectangles on each edge connected via a revolute joint. Then allow the left and right arrows to rotate the two front wheels. Have the wheels control the actual velocity, and the car just goes along with the ride.

My guess is you'd have to modify the linear velocity every time you change the wheel rotation, and have some formula to calculate where the velocity should be going based on the wheels.

EDIT: Here it is:

Quote:
Check out the car physics in QuickB2 (http://quickb2.dougkoellmer.com/bin/qb2DemoReel.swf). They might suit your purposes. Source is at http://code.google.com/p/quickb2/.

-P

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 4 posts ]

 All times are UTC - 8 hours [ DST ]

#### Who is online

Users browsing this forum: No registered users and 3 guests

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

 Search for: