PathCamera controls
by David Sill · in Torque Game Engine · 12/03/2004 (7:22 am) · 6 replies
I have a pathCamera running in a mission that I need to be able to pause and resume, and vary the flythrough speed.
I have searched the forums and haven't found anything that looks relevant. Does anybody have a way to do this in script?
FWIW, this is not really a game, rather a virtual reality environment. I need to put up pretty art and 'drive' past it, having the capability to stop and continue.
Some way of having a speedometer would be a big win as well. Can the velocity be sampled from a pathCamera?
I have searched the forums and haven't found anything that looks relevant. Does anybody have a way to do this in script?
FWIW, this is not really a game, rather a virtual reality environment. I need to put up pretty art and 'drive' past it, having the capability to stop and continue.
Some way of having a speedometer would be a big win as well. Can the velocity be sampled from a pathCamera?
#2
03/09/2005 (3:08 am)
@David: Have you find any way to do it?
#3
I'm needing similar functionality, but it's for debugging and i'm searching for a time based solution... slow down or speed up time that is.
03/09/2005 (8:02 am)
To vary the speed you'll have to make changes to the PathCamera C++ code as currently it just interpolates the 'speed' property from the PathMarkers. You'll need to add some sort of speed scale to the PathCamera and process moves to control it.I'm needing similar functionality, but it's for debugging and i'm searching for a time based solution... slow down or speed up time that is.
#4
This can be done in script, I have done it.
More Info On David's Quest
Not needed.
03/09/2005 (8:25 pm)
Quote:To vary the speed you'll have to make changes to the PathCamera C++ code as currently it just interpolates the 'speed' property from the PathMarkers.
This can be done in script, I have done it.
More Info On David's Quest
Quote:You'll need to add some sort of speed scale to the PathCamera and process moves to control it.
Not needed.
#5
Now maybe read back the current position of the Camera, change the appropriate path marker speeds, call followPath() a second time, and then setPosition() on the camera. Note that it would cause the path data (at the size of 36 bytes per path marker with a max of 720 bytes) to be resent to all clients in scope. You would also need to keep track of the original speeds of the path markers if you wanted to restore them later.
I don't see this as a recommended solution... but it would be a good hack.
UPDATE: To correct myself a bit... you could just change the speed member of the path and not on individual nodes (still calling followPath() after). This is of course if you're trying to reach an absolute speed across the entire path and not a percentage of individual node speeds.
03/12/2005 (8:52 pm)
Quote:This can be done in script, I have done it.In an elegant way? I don't see where in the post you linked it describes how to change the speed via script. The 'speed' parameter in the path markers is only read when you call followPath() and is stored within the PathCamera C++ code. Changing it after you call followPath() does nothing to change the speed of the camera.
Now maybe read back the current position of the Camera, change the appropriate path marker speeds, call followPath() a second time, and then setPosition() on the camera. Note that it would cause the path data (at the size of 36 bytes per path marker with a max of 720 bytes) to be resent to all clients in scope. You would also need to keep track of the original speeds of the path markers if you wanted to restore them later.
I don't see this as a recommended solution... but it would be a good hack.
UPDATE: To correct myself a bit... you could just change the speed member of the path and not on individual nodes (still calling followPath() after). This is of course if you're trying to reach an absolute speed across the entire path and not a percentage of individual node speeds.
#6
Did anyone else look at the source? It's kinda a no-brainer. :/
03/12/2005 (9:35 pm)
You can stop/start/reverse path cameras with %camera.setState("forward/backward/stop");Did anyone else look at the source? It's kinda a no-brainer. :/
Torque Owner Sam3d
Pause and resume... didn't even try.
Not much help, eh?
I'd suggest you try trackingCamera, a resource I think.
And I think you could move an invisible shape and track it.
Are you doing some kind of art gallery ?
I've also been fiddling with some VR environs.
And it's always good to hear of TGE being used for other things.