Game Development Community

Flying Vehicle Movement update

by University of Gotland (#0025) · in Torque Game Engine Advanced · 04/16/2007 (4:24 am) · 1 replies

Hello. Im working on a space shooter project.
What I have is this:
A pathshape object following a path. And a camera following the pathshape. I have a flying vehicle witch is the controlable object. so far so good.

what I want now:
I want to be able to update the vehicles position in the y axel of the world according to the pathshape y coord. so the vehicle would be moving forward by it self. I am thinking I would set vehicle coords as an offset from the pathshape coords. Then I would add or decrease the offset values with key input to make the steering work.
I have modified the flying vehicle and vehicle class so they obtain the pathshape object from script through a console method. So I have a member pointer in vehicle that points to the pathshape object. This is so that the vehicle can easily get the pathshape coords. Ive been playing around with the processTick and updateMove method in these classes but the position update process is confusing to me.

If you think this is idea of how to do it is way off, then please tell me. Other sugestions are welcome.


If your first response is, why is this a 3d project?
because alot of other features demands it. For now I just need this working so we can make a test demo and do some early development leveldesign.

thanks for help. Magnus

#1
04/18/2007 (6:39 am)
Now I have a more specific problem. I can get the coordinates from my pathShape. but only for a while.

suddenly the getColumn below causes a crash in the MatrixF class. It seems the mObjToWorld is no longer set.

Point3F SceneObject::getPosition() const
{
Point3F pos;
mObjToWorld.getColumn(3, &pos);
return pos;
}

Since I have my pathShape pointer working before it crashes and can get the coordinates calling this method I wonder how it is suddenly set to nothing.