Truck car physics

Discuss issues specific to using Box2D on the iPhone
irresistible force
Posts: 1991
Joined: Tue Jun 24, 2008 8:25 pm
Location: Tokyo
Contact:

Re: Truck car physics

Postby irresistible force » Thu Mar 27, 2014 5:08 pm

If lowered its center of gravity, would it flip?

I can't do this.. because of game mechanics

I didn't understand that part... can't you add some weight below the car, like this:
Image

KAMIKAZE
Posts: 17
Joined: Thu Jun 28, 2012 1:57 am

Re: Truck car physics

Postby KAMIKAZE » Fri Mar 28, 2014 11:11 am

Aha, I've tried this - works very well, now car very stable and not flip when start moving.
But another problem - when car rotating during falling down(for example fell from the hill ) - it's visually has very strange rotation.. it's because center of mass is not in the center of the car...
Also this circle bellow car - I've created it just as another fixture(sensor of course) added to car, maybe I need add another body and connect it with car using distance joint or something?
Attachments
123.png
center of the car
123.png (757 Bytes) Viewed 2169 times

irresistible force
Posts: 1991
Joined: Tue Jun 24, 2008 8:25 pm
Location: Tokyo
Contact:

Re: Truck car physics

Postby irresistible force » Fri Mar 28, 2014 3:08 pm

I don't think you can have it both ways. I guess you could connect the counterweight with a prismatic joint and slide it up and down to adjust the influence it has, but it seems like a complex solution and not really getting at the original problem.
Have you tried increasing the motor speed gradually instead of making it full speed instantaneously (since that was the original cause of the problem)?

KAMIKAZE
Posts: 17
Joined: Thu Jun 28, 2012 1:57 am

Re: Truck car physics

Postby KAMIKAZE » Mon Mar 31, 2014 8:27 am

I forgot to say - yes, I tried before this - increasing motor speed gradually and currently use it.
So, for now I'm thinking about deleting fixture of that circle bellow and when needed add it again.. need more time to practice this. Thanks anyway.


Return to “iPhone”



Who is online

Users browsing this forum: No registered users and 1 guest