Single Step Animation
by Howard Dortch · in Torque 3D Professional · 11/27/2010 (5:07 pm) · 5 replies
I have a solar array that I want to track the sun. I made the anim of the panels rotating fine but I want to call a function to just step to the next position in the animation. There are 10 frames of animation so I would want to call a step to frame 1,2,3,4 etc...Is there a way to do that?
#2
11/27/2010 (5:39 pm)
Actually, I think that they added tools to allow you to specify additional sequences, so you could take your one sequence animation and break it up into 10 animation threads. Then you could just play the threads one at a time one after another. That could work right? I think you can access that by going to the Shape Editor.
#3
11/27/2010 (5:54 pm)
Actually, after looking at the code it looks like they changed how it works so you can do that:virtual void setActionThread(U32 action,bool forward,bool hold = false,bool wait = false,bool fsp = false, bool forceSet = false);
#4
Where thread is your animation thread,position is the playback position.
If you fave 10 frames,then you have a 0.1f step for each frame,the position of the first frame is 0.0f, the second frame is 0.11f,the third frame is 0.21f and so on ..
Keep in mind that position 1.0 does not exist for a cyclic sequence,use 0.99 instead.
11/27/2010 (6:59 pm)
Just call mShapeInstance->setPos(thread,position);Where thread is your animation thread,position is the playback position.
If you fave 10 frames,then you have a 0.1f step for each frame,the position of the first frame is 0.0f, the second frame is 0.11f,the third frame is 0.21f and so on ..
Keep in mind that position 1.0 does not exist for a cyclic sequence,use 0.99 instead.
#5
11/27/2010 (8:11 pm)
Thanks bunches, I will give that a try....!
Torque Owner JesseL
Pyrotronics-Games