Game Development Community

Is it possible for FlyingVehicle to auto-pitch

by Lateral Punk · in Torque Game Engine · 10/05/2004 (7:57 pm) · 5 replies

I was hoping someone can direct me how to make my flyingvehicle auto-pitch (level-off). I know it has something to do with the function FlyingVehicle::updateForces(). Basically, I looked at how it currently auto-rolls the plane for you, but I still can't figure out how to auto-pitch also. I know it has something to do with the following auto-roll code:
// Correcting Auto Angle
	F32 ar = mDataBlock->autoAngularForce * mDot(xv,Point3F(0,0,1));
	ar -= mDataBlock->rol

But how do I translate this to do auto-pitching? I guess you can wonder -why i would want to do this. so that the plane levels- off when i hit the neutral key. also, i do have it so that steering.y = 0 when i hit the neutral key.

thanks

#1
10/05/2004 (8:27 pm)
To my knowledge, this is already implemented.
#2
10/05/2004 (9:00 pm)
Can you please direct me to where this is implemented. I would be guessing it's somewhere in the FlyingVehicle class, updateForces. but i don't see it. Something more specific would be great.
#3
10/05/2004 (9:05 pm)
F32 gf = mDataBlock->autoAngularForce * autoScale;
      torque -= xv * gf * mDot(yv,Point3F(0,0,1));
#4
10/05/2004 (9:20 pm)
Thanks. but i see that it only occurs if the plane is flying with a lower speed than maxAutoSpeed. I'm acutally looking for it to occur when i press the neutral button in my gui, which in turn sets steering.y to zero. how can i make this work with input rather than the current check that is occuring.
#5
10/05/2004 (10:06 pm)
That shouldn't be too hard to do.. if you don't know how to then you might want someone else to do it for you.