🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Flight physic system

Started by
10 comments, last by NinjaCross 24 years ago
Hey guys !! Please, I have to make a physic system for the space ships of the game that i''m developping. Somebody can tell me where can i find some information about flight physic systems and/or vector composition ?? Thanks so much for your help ! //------------- Making Funny Fake Codes //-------------
//-------------A straight line may be the shortest distance between two points, but it is by no means the most interesting.http://members.xoom.it/NinjaCross
Advertisement
I''d like some info on this too, I just added collision detection into my engine and want to get the physics working right.

Morgan
Yeah Morgan, i hope somebody will reply to us :-) !

//-------------
Making Funny Fake Codes
//-------------
//-------------A straight line may be the shortest distance between two points, but it is by no means the most interesting.http://members.xoom.it/NinjaCross
Hey guys,

I dont want to flame you but, USE your head !!

To implent physic system in a game, you must use Vector Math.

Each mesh (3d object) mush have a struct for physic properties,
like (weight, deform(witch make a object bounce high or low when it's collide with something, like a superball), (you can put anything you find interresting for your game, nothing is predefined, its belong to each game designer to include what he/she tought is interresting for them in their game).

After you must have a VectorMomentum (force accumulated by an object), VectorForce (this is a vector that pointing where the force received from an object is).

Like if you got a plane sim, your plane is affected by gravity (this is a vector pointing straight down to the ground), you got the power of the engine that push the plane where is nose is), you got the drag force (this is cause be the air friction on a plane; more something is aerodynamic, the less is affected by drag. And finally you got the Vertical Ascension (this is calcule by the Speed * The Plane Portance). So if you add all those Force Vector, this will give you ONE vector that tell you where the plane is going.

Lets say you have a JetFighter, it's speed is extremely fast, so is portance too, but engineer have work very hard to reduce drag, so it will accelerate very fast (and can go faster then a normal plane), for the Gravity, this is a constant vector always pointing straight down, so even if your plane is rolling, it's always be pulled down by gravity.

Add them togother, Using Momentum, VectorForce & time, you will got a good physic engine.

I give you a clue here, i think is Einstein that've say that:
"Action = ReAction" !!

That's why the thrust of the engine witch is pushing back, make the plane go straight-foward.

Check in "www.gamasutra.com", that have a plentty of good Tuts, on physic engine. But the basis, remain the basis.

Happy Coding,

LowRad

Edited by - LowRad on June 8, 2000 10:36:47 AM
Hey, How do I consider a Vector in C++ ? I mean If I create a

struct VECTOR
{
double source[3]; // x y z
double target[3]; // x y z
}

how Do I add two vectors ?

Is this correct (considering the source is the same for all the vectors :

VECTOR vec1;
VECTOR vec2;
VECTOR result;
... all vector creating...

result.target[0]=vec1.target[0]+(((vec1.target[0]-vec2.target[0]))/2);
result.target[1]=vec1.target[1]+(((vec1.target[1]-vec2.target[1]))/2);
result.target[2]=vec1.target[2]+(((vec1.target[2]-vec2.target[2]))/2);

(you can find me on IRC : #opengl on undernet)
You have to break the vectors down into their individual componets first before you can add them.
You need to come up with a standard coordinate system then see how much force in the x direction, then in the y direction, then in the z direction. To keep my example short i will use only x and y.

vector_force = 1;vector_angle = .785;  // about 45 degreesx_force = cos(vector_angle)*vector_force;y_force = sin(vector_angle)*vector_force; 




"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
Go to www.mathengine.com and see if that might help you. Anyone have a nice implentation of vectors with all the useful functions(normalize, cross, dot, etc.) in a c++ CLASS? I have made my own class, but I want to cross check against something that works to see if I''m doing the math and how to do the dot/cross products

||--------------------------||Black Hole Productionshttp://bhp.nydus.netResident expert on stuffmax621@barrysworld.com||--------------------------||
I''d kind of like a link to a good site which explains the math, very simply, for the physics. I know how physics work (I fallen over enough times to figure that one out), I just want a tutorial of some type for physics (I haven''t takes physics in a while and I didn''t take very good notes the first time around).

Morgan
Thankyou very much, guys, for your helps ;-) .... but what I need is not a basic-level lesson on vectors....
I knows all the rules about vector-composition, but I should know that there are some very hard compositions to implement in a prog.
I.E.: You should consider that the air-plane has got a barycentre, and all the vectors MUST refers to IT.
When I make the plane steering to a UP direction, it start to rotate around its barycentre, and it''s not easy to consider all the sub-vectors that in this case, the mains vector are going to generate...
So now my question is:
How can I SIMPLIFY the vector system to the MAX ??

Thankyou again, you were very nice :-)

//-------------
Making Funny Fake Codes
//-------------
//-------------A straight line may be the shortest distance between two points, but it is by no means the most interesting.http://members.xoom.it/NinjaCross
The simplier system is
One vector for Engines, one for gravity and one for the plane portance
Maybe one for the wind ...
(you can find me on IRC : #opengl on undernet)

This topic is closed to new replies.

Advertisement