Game Development Community

Explanation of Flying Vehicle Propulsion

by Jeff Trudeau · in Torque Game Engine · 12/06/2003 (9:58 pm) · 3 replies

There must be major differences between the way normal players (and even wheeled vehicles) and flying vehicles move. I was able to substitute my own model into the racing demo and enable it as a flying vehicle, but I have no control whatsoever over the model or the camera. I have already been able to correct some of the problems that other people have had, such as spinning models, etc., but the fact that I have no control scares me.

2 other things; calling echoInputState(); from the console while the game is running returns DirectInput is not enabled.

second, for the three seconds before the racing game commences, it seems I do have control over the camera and can rotate it about the model. However, once the game begins, I have no control whatsoever.

I think that the propulsion for flying vehicles works using the nodes and emitters outlined in flyingVehicle.cc, but I am not certain. Can someone give me a basic outline of how to setup a moving flying vehicle? Thanks.

#1
12/07/2003 (10:29 am)
I really don't mean to insult your intelligence or anything, but in the GameConnection::createPlayer function for the racing demo, did you change the class of object created from WheeledVehicle to FlyingVehicle?
#2
12/07/2003 (12:43 pm)
Yes, the game recognizes the object as a flying vehicle. I actually got this running last night. Problem I was having, is the that the player start point was on the ground. Seems the model was actually inside part of the terrain, although I couldn't tell. I was having a little difficulty with the collision mesh earlier, and I suspect I should look towards making that more accurate now.
#3
12/07/2003 (2:05 pm)
In that case there are 2 fields in the datablock that you should play around with...

hoverHeight = x.x;
createHoverHeight = x.x;

It is not uncommon for flying vehicles to get stuck in the terrain upon creation, hence the parameters.
As for collision meshes, I always try to make mine fit inside the visible mesh, and it really is better to have as few polys in it as possible.

Also, if you are not using a "mass" node, then the pivot point of the Bounds box will be used for the center of mass for the vehicle. It is always a good idea to make sure the pivot points on all of the mesh objects are where you think they are.