Hello , and happy new year for all !
I have a question :
there is possibility of creating a car movements with just love.physics Body ( one body ?)?
thank
Hello all ! some question ?
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Hello all ! some question ?
Well, you could try, but that's not the sort of thing Box2D excels at.
Rolling your own collision detection will probably be better for car movement.
Rolling your own collision detection will probably be better for car movement.
Help us help you: attach a .love.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Hello all ! some question ?
First assumption: with LÖVE you can do only 2D stuff. No 3D.
You can create a car "in which you always see the side, so you only simulate two wheels". I mean this:
So you can have your "car" go up and down on ramps, jump, have suspension, etc. But you can't make it turn. Granted, it would be more like a bicycle than a car.
You can also do a game in which you "see the car from behind", like in Out Run. But on that case, you probably don't need physics.
You will not be able to simulate a car "in which you see the roof, so there are 4 weels". So this, you can't do:
You can create a car "in which you always see the side, so you only simulate two wheels". I mean this:
So you can have your "car" go up and down on ramps, jump, have suspension, etc. But you can't make it turn. Granted, it would be more like a bicycle than a car.
You can also do a game in which you "see the car from behind", like in Out Run. But on that case, you probably don't need physics.
You will not be able to simulate a car "in which you see the roof, so there are 4 weels". So this, you can't do:
When I write def I mean function.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Hello all ! some question ?
Why not?kikito wrote:You will not be able to simulate a car "in which you see the roof, so there are 4 weels". So this, you can't do:
Help us help you: attach a .love.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Hello all ! some question ?
Damn. You already know my math isn't strong! I'll try to explain myself in layman's terms (which is the way I think).Why not?
The Box2d world is "2D". You to simulate "circles", "polygons", etc... 2D stuff.
You can simulate the car on the ground like a "square" moving around in 2D. It'd "drift", like a block of soap. I've said you can do the "back" because that perspective would kind of "mask" the drifting. But with a "top" perspective it would be too evident.
In order to accurately simulate a car's turning, you need to model "cylinders rolling over a plane" ... which is kind of 3D-ish, and thus out of Box2d's reach, I think. You have to calculate the turning with lua, or have a "soap block".
But please, prove me wrong. I'd love to be wrong on this one.
When I write def I mean function.
Re: Hello all ! some question ?
yop ,
i find for car with box 2 on the net.
you can make topdown view car : look here
http://www.emanueleferonato.com/category/box2d/page/4/
it' s box 2d prog !
i dont understand all the code lol
i find for car with box 2 on the net.
you can make topdown view car : look here
http://www.emanueleferonato.com/category/box2d/page/4/
it' s box 2d prog !
i dont understand all the code lol
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Hello all ! some question ?
I was wrong! great!
So, the answer to your question is yes... it is only a matter of translating now!
So, the answer to your question is yes... it is only a matter of translating now!
When I write def I mean function.
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Re: Hello all ! some question ?
All you'd need to do is apply a force to the top-down car which pushed it left or right if it was moving right or left (respectively), taking into account the car's rotation. Then the car would only be free to go forward or back.The math for this would be a little hairy, but it'd be perfectly doable.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Re: Hello all ! some question ?
i have make a little simulation top view of car with one physics body , i ' m think there is another way to make it .
i 'm not good in math
try , if that can help some
arrow key for control
by all
" soory for bad english i'm french "
i 'm not good in math
try , if that can help some
arrow key for control
by all
" soory for bad english i'm french "
- Attachments
-
- phycar.love
- (4.14 KiB) Downloaded 134 times
Last edited by Neolitik on Fri Jan 29, 2010 4:55 pm, edited 1 time in total.
- TechnoCat
- Inner party member
- Posts: 1612
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: Hello all ! some question ?
It is like the rear wheels are turning. lolNeolitik wrote:i have make a little simulation top view of car with one physics body , i ' m think there is another way to make it .
i 'm not good in math
try , if that can help some
arrow key for control
by all
" soory for bad english i'm french "
Who is online
Users browsing this forum: No registered users and 1 guest