Rotating Player/Vehicle [Help
by Jorge Luis Gandulfo · in Torque Game Engine · 06/24/2008 (11:58 am) · 5 replies
I need to make the player to behave like this:
A static object that spawns on the spawn sphere and only rotates over its center (or a node), also it have to be able to rotate to any direction, preferentially it should snap to the desired rotation axis so it can face specific directions.
Then i will place a turret (or cannon) on a mount point and it will rotate from the direction the player is facing, of course the view will follow the player position and not the turret.
Any ideas on how should i start coding this? maybe a Flying Vehicle? or should i write my own class from scratch?

A static object that spawns on the spawn sphere and only rotates over its center (or a node), also it have to be able to rotate to any direction, preferentially it should snap to the desired rotation axis so it can face specific directions.
Then i will place a turret (or cannon) on a mount point and it will rotate from the direction the player is facing, of course the view will follow the player position and not the turret.
Any ideas on how should i start coding this? maybe a Flying Vehicle? or should i write my own class from scratch?

#2
Imagine a spaceship that is stucked on a place and cant move forward, but can rotate, thats what i need.
06/24/2008 (12:27 pm)
Not really, a turret probably rotates over one axis, the player i need shouldn't be attached to a specific axis, it should be able to rotate in any direction, then its cannon will rotate from the base its attached, so that might be a turret.Imagine a spaceship that is stucked on a place and cant move forward, but can rotate, thats what i need.
#3
The turret resource, if I remember correctly, allows for rotation along all axes for something like say a ball turret. You just restrict how much movement is allowed on each axis. I think this is the resource I used when I implemented turrets on my vehicles. I'm not positive though, as I've lost that bookmark.
The turret gets mounted to an object in the world, like a vehicle, or a tower, etc. So you could probably just have a small invisible object to mount it to. There may be a better way though, that's just the first solution that comes to mind.
06/24/2008 (1:36 pm)
Ok, so, if I'm understanding you right, you want an object that stays in a fixed 3D spot, can't move at all with the exception of rotating along all axes.The turret resource, if I remember correctly, allows for rotation along all axes for something like say a ball turret. You just restrict how much movement is allowed on each axis. I think this is the resource I used when I implemented turrets on my vehicles. I'm not positive though, as I've lost that bookmark.
The turret gets mounted to an object in the world, like a vehicle, or a tower, etc. So you could probably just have a small invisible object to mount it to. There may be a better way though, that's just the first solution that comes to mind.
#4
06/24/2008 (2:11 pm)
Thans a lot Scott, i will try this right now, i'm sure its better to start with than going trough the FlyingVHC path.
#5
Thanks a lot
06/24/2008 (4:09 pm)
Another question, is it possible to use the Turret as a player object? couse i couldn't do it, in the case the answer is no, what should i use as turret base?Thanks a lot
Associate Scott Burns
GG Alumni