How do I move an object on its own X axis?
by Nicolai Dutka · in Torque Game Engine Advanced · 07/24/2008 (8:22 am) · 2 replies
I can get the object's transform and rip it apart into the 7 words that make up said xform, but those are world coordinates. I cannot simply add 5 to the X value, that will add 5 to its X position in the world.
What I want is to slide an object along its OWN x axis. How would I do that?
What I want is to slide an object along its OWN x axis. How would I do that?
#2
07/03/2009 (6:06 pm)
Ahh, that is one I can do!%t = %obj.getTransform(); // This makes the rest faster //This breaks up the 7 parts of the transform. a,b,c,d are the rotations %x = getWord(%t,0); %y = getWord(%t,1); %z = getWord(%t,2); %a = getWord(%t,3); %b = getWord(%t,4); %c = getWord(%t,5); %d = getWord(%t,6); //This will assemble it to a valid 7 point vector %t = %x SPC %y SPC %z SPC %a SPC %b SPC %c SPC %d;
Torque Owner Anthony P
Any help would be awesome!
Thanks
P