Box2D Forums

It is currently Sat May 25, 2013 11:48 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Truck car physics
PostPosted: Thu Jun 28, 2012 6:47 am 
Offline

Joined: Thu Jun 28, 2012 1:57 am
Posts: 5
Hi,

I was looking for a good tutorial about box2d and creating some vehicles, but couldn't find a good example for iPhone. Only one link for Flash:
http://www.emanueleferonato.com/2009/04 ... ox2d-cars/

Can some one give an example of such vehicle like Emanuele Feronato gives, but for iPhone? Also I'm interested in creating vehicles like this :
Image

So, with independent suspension for each wheel.


Top
 Profile  
 
 Post subject: Re: Truck car physics
PostPosted: Thu Jun 28, 2012 7:59 am 
Offline

Joined: Tue Jun 24, 2008 8:25 pm
Posts: 1518
Location: Tokyo
The wheel joint does a good job of this. Check out the 'car' test in the testbed for a simple usage example in C++.


Top
 Profile  
 
 Post subject: Re: Truck car physics
PostPosted: Thu Jun 28, 2012 8:53 am 
Offline

Joined: Thu Jun 28, 2012 1:57 am
Posts: 5
Can you please point directly to this? I'm a noob with box2d currently...


Top
 Profile  
 
 Post subject: Re: Truck car physics
PostPosted: Thu Jun 28, 2012 6:35 pm 
Offline

Joined: Tue Jun 24, 2008 8:25 pm
Posts: 1518
Location: Tokyo
Build and run the testbed, then select 'Car' from the list of tests. Specifically, the test is this one:
http://code.google.com/p/box2d/source/b ... ests/Car.h


Top
 Profile  
 
 Post subject: Re: Truck car physics
PostPosted: Fri Jun 29, 2012 1:18 pm 
Offline

Joined: Thu Jun 28, 2012 1:57 am
Posts: 5
Oh, thank you!
Box2d manual must be with detailed description of this. Currently it's so poor.


Top
 Profile  
 
 Post subject: Re: Truck car physics
PostPosted: Wed Jul 25, 2012 7:40 am 
Offline

Joined: Thu Jun 28, 2012 1:57 am
Posts: 5
Ok. I've started some project to build a car.
However I have a very strange issue, when the car body is small. Car start jumping, rotating... well it's do crazy things) How this can be fixed?
I need such small size car body for my game. :arrow:

Complete project http://rghost.ru/39408443


Attachments:
Снимок экрана 2012-07-25 в 17.34.37.png
Снимок экрана 2012-07-25 в 17.34.37.png [ 71 KiB | Viewed 1356 times ]
Снимок экрана 2012-07-25 в 17.34.53.png
Снимок экрана 2012-07-25 в 17.34.53.png [ 70.54 KiB | Viewed 1356 times ]
Top
 Profile  
 
 Post subject: Re: Truck car physics
PostPosted: Thu Jul 26, 2012 4:38 am 
Offline

Joined: Tue Jun 24, 2008 8:25 pm
Posts: 1518
Location: Tokyo
It looks like the joint anchor position is not in the center of the wheels.
I think you'll also need to make the car body much heavier compared to the wheels if you want to keep it stable.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 4 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:
Powered by phpBB® Forum Software © phpBB Group