Game Development Community

Flying at a pacific altitude

by Todd · in Torque Game Engine · 03/03/2008 (6:56 am) · 4 replies

I am hoping someone knows this off the top of their head, I have the Warsparrow pack it's working great. But I am looking for a way to keep the airplane flying at the same altitude no matter how much the plane is turned or banked. I am wanting to limit the controls to turning left and right and speed with no mouse control. Is this possible within the script or will I need to make source changes.

Thanks Todd

#1
03/04/2008 (12:37 am)
I'm a little out of my depth, here, but then again I've played with the FlyingVehicle class quite a bit.

I'm pretty sure you'll need some source changes, because you're changing the physics of the plane.

It depends on exactly precisely what you want to do. For example, in my game I've set gravity to zero for my flying vehicles, basically because I don't want to deal with takeoff/landing. But this doesn't limit them to a single altitude.

You could disable the pitch axis when flying. But again, other things could come into play, forcing the plane out of altitude.

There is a way to set a level it will drift to when left alone.
#2
03/04/2008 (6:00 am)
Thanks for the help Lee, ya I've been playing with the settings some. But will look in to the drift level to see if I can mod it in some way. I think that you are right about having to do source changes to get what I want. I will post back what I find out.

Todd
#3
03/13/2008 (4:58 am)
You'll have to make source changes... I've done this for my previous game. The starting point would be to just change the following in void FlyingVehicle::updateMove(const Move* move) :

mRigid.linPosition.z = 80;

You're going to run in other problems though... Like when you collide your plane will go into an un-controllable roll.

I cant exactly remember what they were... But there were a few others, specifically with Physics that I wasn't able to sort out.
#4
03/13/2008 (2:07 pm)
Of course, one solution would be to not collide with anything.

One's game may allow such a thing to work!