PathCameras
by Zod · in Torque Game Engine · 04/01/2007 (3:16 pm) · 3 replies
I've never messed with these and they seem to be just what I'm looking for to perform a certain task.
I want to have a rendered dts shape that will follow a path in the air. It will get a path assigned to it which would only contain 2 markers, one at the current position of the shape and one at the destination. I need not worry about obstructions because this will take place a few hundred meters above the terrain.
Now I added the needed functions to the mission editor so I could create this PathCamera. The datablock of which has a shapeFile parameter which points to a dts. Now the current problem I have is that when added to the mission, the shape is not rendered.
I checked out the TGEA demo and noticed they are using PathCameras for the scenes with shapes that are being rendered. Perhaps TGEA has this ability and TGE does not? I am using TGE btw.
Does the PathCamera require a pre created path? Because I will be generating paths on the fly.
I want to have a rendered dts shape that will follow a path in the air. It will get a path assigned to it which would only contain 2 markers, one at the current position of the shape and one at the destination. I need not worry about obstructions because this will take place a few hundred meters above the terrain.
Now I added the needed functions to the mission editor so I could create this PathCamera. The datablock of which has a shapeFile parameter which points to a dts. Now the current problem I have is that when added to the mission, the shape is not rendered.
I checked out the TGEA demo and noticed they are using PathCameras for the scenes with shapes that are being rendered. Perhaps TGEA has this ability and TGE does not? I am using TGE btw.
Does the PathCamera require a pre created path? Because I will be generating paths on the fly.
About the author
#2
04/01/2007 (4:12 pm)
AiPlayers require contact with the terrain to work. I don't have that option. aiFlyingVehicle would work but there isn't one. PathCamera seems to be the only "stock" solution.
#3
Other ShapeBase objects (like Items) don't require contact with the terrain, so perhaps it would make sense to look at the movement code for AIPlayers and see if it can be applied to other objects. But that would require delving into the engine code.
04/01/2007 (4:39 pm)
Ah, good point, I missed that. Although I don't know for sure, my guess is that the PathCamera does not include code for rendering (since cameras are generally not rendered).Other ShapeBase objects (like Items) don't require contact with the terrain, so perhaps it would make sense to look at the movement code for AIPlayers and see if it can be applied to other objects. But that would require delving into the engine code.
Torque 3D Owner Rubes
To do this, you don't necessarily need a predefined path, as far as I can tell. A predefined path helps because the AIPlayer code just reads in the transform of the next node on the AIPlayer's current path, and tells the AIPlayer to move to that point. If you're generating nodes on the fly, you just need to pass it the transform.
Note that this code just moves the AIPlayer from one node (XYZ point) to another; it doesn't incorporate the nice smoothed curves that you can get with predefined paths and PathCameras. At least that's my superficial knowledge of the topic.