How to turn/move parts of a dts shape
by Martin Schultz · in Torque Game Engine · 03/18/2004 (3:59 am) · 8 replies
Hi there,
I am into creating kind of stationary rocket defense turret which automatically attacks any player in the game when he's in range.
I created therefore one dts shape which includes the base for the turret and the turret itself. Where I'm stuck at the moment is how can I turn the turret part in the dts shape individually from the base so that I can control from script the rotation/yaw of the rocket turret? (to aim the space ships when they entered the trigger zone).
Any suggestions how to solve this?
Thanks in advance! :-)
Martin
I am into creating kind of stationary rocket defense turret which automatically attacks any player in the game when he's in range.
I created therefore one dts shape which includes the base for the turret and the turret itself. Where I'm stuck at the moment is how can I turn the turret part in the dts shape individually from the base so that I can control from script the rotation/yaw of the rocket turret? (to aim the space ships when they entered the trigger zone).
Any suggestions how to solve this?
Thanks in advance! :-)
Martin
#2
Is there any script call avaiable to rotate the parts?
Best,
Martin
03/18/2004 (4:27 am)
Quote:
You can access the rotation of a node in a dts skeleton with:
mShapeInstance->getShape()->nodeRotations
Is there any script call avaiable to rotate the parts?
Best,
Martin
#3
Ian
Mode 7 Games
03/18/2004 (4:42 am)
Not that I know of. If you want go the script route then you could try creating two dts shapes, one for the base and one for the turret. The turret could then be rotated easily through script using setTransform();Ian
Mode 7 Games
#4
shape = "~/data/shapes/base.dts";
shapeWhatever = "~/data/shapes/turret.dts";
shapeTheThirdOne = "~/data/shapes/Minigun.dts";
Or how do you mean to add a second shape file?
Best,
Martin
Edit = Double post... :-)
03/18/2004 (4:47 am)
Is it possible to add two or more shapes to an object? Like:shape = "~/data/shapes/base.dts";
shapeWhatever = "~/data/shapes/turret.dts";
shapeTheThirdOne = "~/data/shapes/Minigun.dts";
Or how do you mean to add a second shape file?
Best,
Martin
Edit = Double post... :-)
#5
03/18/2004 (4:57 am)
They would be two discrete shapes, but you would just position them so they LOOK like one shape. Then you would just turn the turret shape using setTransform();
#6
It's actually (currently) at the top of the Code Snipits section over on the right sidebar.
03/18/2004 (12:43 pm)
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5345It's actually (currently) at the top of the Code Snipits section over on the right sidebar.
#7
Best,
Martin
03/18/2004 (11:30 pm)
Ups, how could I oversee the resource Brad mentioned? Argh... that is exactly what I looked for. Thanks guys! :-)Best,
Martin
#8
That is how I understood it anyway,
Frank
03/26/2004 (8:07 pm)
I thought this kind of thing would be done by creating an animation for every part that covers the range of motion for that part. Hence an animation for pitch, yaw or roll or even movement as well. Then you use a script to determine which frame from 0 to something to determine the position. That way you can control how far the rotation is allowed to go independent of code. This could allow you to make multiple turret types with the exact same control code.That is how I understood it anyway,
Frank
Associate Ian Omroth Hardingham
Mode 7 Games
mShapeInstance->getShape()->nodeRotations
You may need some knowledge of quarternians to do it properly though.
Ian
Mode 7 Games