Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / vehicle physics- need a bit of help.

Author
Message
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 25th Jun 2008 01:41
In a game I am making, it needs vehicles. I know how to get the car to tilt, according to the wheels, but now I have another problem.

I need to figrure out how to get a sphere (Just as a test) To go forward. The sphere has to go on bumpy terrain, and it slowly accelarates. Then it goes off a jump and goes through the air and then hits the ground with a bump.

I am going to do this small scale, because then it will be easy making it large scale.

Does anyone have any idea of how to make the sphere go off the ramp so it flies through the air? The acceleration part I think I can figure it, and the same wiht the bump part, but the flying through the air for a couple of seconds I don't know how to do.

Any ideas would be helpful, I don't need the code, just some possible way of doing it.

Thanks.


www.GlobalWarfare.tk
dbGamerX
16
Years of Service
User Offline
Joined: 23rd Nov 2007
Location:
Posted: 25th Jun 2008 05:11 Edited at: 25th Jun 2008 05:11
OT: Hey that sig is better than mine. Nice. I'm gonna make a better one lol.

programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 25th Jun 2008 14:39
OT: Yeah, the mods deleted the other pic, said it was too big.

OnTopic:

I have thought of a way to get the vehicle to jump up, which is if the angle goes down, jump up, but the car would just go up and down, not going forward and then down.


www.GlobalWarfare.tk
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 25th Jun 2008 23:02
I know some people have made racing games, they have to know this. Do I need to be more clear on what I am asking?



www.GlobalWarfare.tk
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 25th Jun 2008 23:27
I like the blue one better.

If you can do any models for FW, reply to the FleetWars thread.

Click here!
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 25th Jun 2008 23:52
Yeah, me too...



www.GlobalWarfare.tk
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 26th Jun 2008 00:40
Just scatter shooting here. If you know the angle of jump, lets call it theta, and the linear momentum....

When you hit the jump, assuming it has a decent length to it, your velocity changes so that your x and y components change. Call vl your linear velocity and vx and vy your x and y velocities.

vx = cos (theta) * vl;
vy = sin (theta) * vl;

When you leave the end of the ramp I assume you have no means of propulsion, no traction, you lose what ever your driving force is and depend on physics to do the rest. vx should stay fairly constant unless you want to figure some air friction into the equation. vy should immediately start to decrease and eventually go more and more negative due to gravitational forces until it hits solid ground. Then you have your driving force back and be starting with the same vx. We'd have to assume that vy gets absorbed by the suspension springs or else the vehicle craters on the ground causing some friction against vx.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 26th Jun 2008 03:42
Quote: "I like the blue one better."


They look cool together.
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 26th Jun 2008 14:33
Thanks Lilith, you gave me a lot of ideas to work from.

Quote: "If you know the angle of jump, lets call it theta"


I don't know the angle of the jump, because it is just bumpy terrain, but I think I can figure that out of how to figure out the jump angle.

Quote: "When you leave the end of the ramp I assume you have no means of propulsion, no traction, you lose what ever your driving force is and depend on physics to do the rest. vx should stay fairly constant unless you want to figure some air friction into the equation."


What I am going to do is have it so that if you press space bar, your car moves forward and gains speed. It hits a bump, and you go up in the air at that same apeed, and yes, there will be air friction.

Then when yuo hit the ground, there is a bump and you go up a little again.

Thanks.



www.GlobalWarfare.tk

Login to post a reply

Server time is: 2024-09-30 01:38:17
Your offset time is: 2024-09-30 01:38:17