Box2D Forums

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

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Jan 30, 2011 9:31 am 
Offline

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
 Profile  
 
PostPosted: Sun Jan 30, 2011 11:38 am 
Offline

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


Top
 Profile  
 
PostPosted: Tue Feb 01, 2011 12:42 am 
Offline

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

How so? Can you please explain more? I've read some posts of people asking about this but i couldnt find any about rigid-body from top-view..


Top
 Profile  
 
PostPosted: Tue Feb 01, 2011 9:56 pm 
Offline

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
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 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 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:
cron
Powered by phpBB® Forum Software © phpBB Group