Moving objects
by Phil Carlisle · in Torque Game Engine · 04/20/2002 (12:28 pm) · 5 replies
Ok, I'm trying to create scripted moveable objects.
What I'm after is to allow objects to be assigned a path, then told to follow that path, then to move along the given path.
Ive added some functions into shapebase that should allow the object to be assigned a path. But I need to move the object along the path.
I was thinking that munging the processTick's Move structure would do what I want. But its a const pointer to a move structure.
Is modifying the move data the best way of doing this? seems like its the best way to do it to me, but is there any other place where I can override (on a per object instance basis) the movement of that object?
Phil.
What I'm after is to allow objects to be assigned a path, then told to follow that path, then to move along the given path.
Ive added some functions into shapebase that should allow the object to be assigned a path. But I need to move the object along the path.
I was thinking that munging the processTick's Move structure would do what I want. But its a const pointer to a move structure.
Is modifying the move data the best way of doing this? seems like its the best way to do it to me, but is there any other place where I can override (on a per object instance basis) the movement of that object?
Phil.
About the author
Recent Threads
#2
i was considering making the move structure non const (dont particularly see why it needs to be const).
But this has given me another approach.
I'll have a play with it, see if I like this better :))
Cheers.
Phil.
04/20/2002 (1:54 pm)
Thanks Tim,i was considering making the move structure non const (dont particularly see why it needs to be const).
But this has given me another approach.
I'll have a play with it, see if I like this better :))
Cheers.
Phil.
#3
04/24/2002 (10:05 am)
The advantage of changing gameProcess with the new virtual is you could make derived AI classes from the existing Player and Vehicles without changing them. Though you'd probably eventually want to change them :)
#4
Is there a specific place that generates a move for a shapebase? it seems to me like gameconnection generates a move list, which is then passed on to each object?
I stuck in an override in gameprocess and nothing happened (but then I havent spent enough time digging into how it works).
I should dig into the code a bit more (before the weekend) I'm sure just tracing it through a few times will make it clear :))
Thanks for the help anyway Tim.
Phil.
04/24/2002 (10:42 am)
Thanks for the suggestions tim. I make the virtual function but I cant track down the best place in gameprocess to override the move creation. Is there a specific place that generates a move for a shapebase? it seems to me like gameconnection generates a move list, which is then passed on to each object?
I stuck in an override in gameprocess and nothing happened (but then I havent spent enough time digging into how it works).
I should dig into the code a bit more (before the weekend) I'm sure just tracing it through a few times will make it clear :))
Thanks for the help anyway Tim.
Phil.
#5
void TSShapeInstance::advanceTime(F32 delta, TSThread * thread)
which I think is used to advance animation sequences to keyframes and/or move objects like the wheels in the racing demo.
... although I could be wrong... or way off base...
Robert
08/25/2002 (1:00 pm)
Is the thing you want to move a TSShapeInstance? The reason I am asking is that there is this function ->void TSShapeInstance::advanceTime(F32 delta, TSThread * thread)
which I think is used to advance animation sequences to keyframes and/or move objects like the wheels in the racing demo.
... although I could be wrong... or way off base...
Robert
Torque Owner Tim Gift