Box2D Forums

It is currently Fri Aug 01, 2014 5:21 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 47 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
PostPosted: Wed Oct 01, 2008 7:10 am 
Offline

Joined: Fri May 16, 2008 2:52 pm
Posts: 280
Because a couple of people have been asking about this in the past few weeks.

I also hosted it for your convenience: http://files.noio.nl/wheeledcar.swf


Attachments:
File comment: The demo + source.

I'm sorry that I put all the code in frame1, I wanted to keep it simple, but it turned out to be more code than i thought. (mostly because of doing everything 4 times).

Box2DAS3-wheeledcardemo.zip [201.74 KiB]
Downloaded 5903 times
Top
 Profile  
 
PostPosted: Wed Oct 01, 2008 11:48 am 
Offline

Joined: Mon Apr 21, 2008 1:42 pm
Posts: 9
sure, now you post this, after I have my game out! :lol:

thanks for the code! I was going to spend some time and update my game, but now I only have to spend a little time ctrl-c ctrl-v. :D


Top
 Profile  
 
PostPosted: Wed Oct 01, 2008 5:46 pm 
Offline

Joined: Sun Dec 23, 2007 6:41 pm
Posts: 14
Ooh, cool! Thanks for the contribution =).


Top
 Profile  
 
PostPosted: Thu Oct 02, 2008 12:39 am 
Offline

Joined: Tue Apr 29, 2008 1:55 am
Posts: 102
nice! Does weight distribution have any effect? Can one make wheels skid upon greater lateral forces?


Top
 Profile  
 
PostPosted: Thu Oct 02, 2008 2:56 am 
Offline

Joined: Fri May 16, 2008 2:52 pm
Posts: 280
zappBrannigan wrote:
nice! Does weight distribution have any effect? Can one make wheels skid upon greater lateral forces?

At this moment, wheels do not skid, because it is not friction that is applied to the wheels, I just call "SetLinearVelocity" every frame. I did not really think about it long enough to come up with a way that friction should be applied. (If an opposing force is applied in stead of SetLinearVelocity, some very chaotic behavior starts occurring). Feel free to come up with a way though! That would be much nicer!


Top
 Profile  
 
PostPosted: Tue Oct 14, 2008 1:32 pm 
Offline

Joined: Tue Oct 14, 2008 1:30 pm
Posts: 65
thanks for sharing.
one problem I cant catch is why the "car" moves faster in X direction? you can hold right + up to see what I mean.


Top
 Profile  
 
PostPosted: Tue Oct 14, 2008 2:36 pm 
Offline

Joined: Fri May 16, 2008 2:52 pm
Posts: 280
I don't really see what you mean actually.

But Boris has created a better solution for simulating the wheel behavior, in stead of the rather crude 'kill orthogonal velocity'. http://www.box2d.org/forum/viewtopic.php?f=8&t=1567


Top
 Profile  
 
PostPosted: Tue Oct 14, 2008 10:56 pm 
Offline

Joined: Tue Oct 14, 2008 1:30 pm
Posts: 65
well, here it looks like while the car speeds up at the top/bottom of circle (when it moving horizontally) and slows down at sides (when it moves vertically). you can see jagged motion where you would expect smooth motion.

this probably became more apparent when I tweaked settings such as HORSEPOWERS up to 300, etc. looks like some kind of resonanse.


Top
 Profile  
 
PostPosted: Fri Oct 24, 2008 1:06 am 
Offline

Joined: Mon Sep 29, 2008 12:22 am
Posts: 18
Location: Italy
Hi again guys,
after moving from my old apartment, i'm back in business and struggling with my top-view car game

i've built a first demo on top of the idea of android and it worked well, but then i noticed the problems thack mack also noticed.
The car seems to go faster at some angle and sometimes it steers faster then normal. I guess it has something to do with the killOrthogonalVelocity function, but i wasn't able to find out a solution.

Now I've read about the lib created by Boris and I'm trying to integrate the previews demo with that.
Someone already tried that and have some suggestion about how to implement it?


Top
 Profile  
 
PostPosted: Tue Nov 04, 2008 6:39 am 
Offline

Joined: Mon Mar 03, 2008 4:38 pm
Posts: 127
Location: Scotland
Hi lads.

I too am interested in this.

One of the things i am confused about, is that people are forwarding to a post related to bouyancy, tensor and gravity by our talented Boris.

I might just be missing something, but how is this related to top down car phyiscs? I am sure it is of course, but from playing with the demos i see no relation between this example and boris's work.

Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 47 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 5 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