Game Development Community

Current Animation Frame for DTS new Morphs

by David Mathews · in Torque Game Engine · 08/03/2005 (2:31 pm) · 2 replies

I've added Morphs (predefined, controlled by a single float per frame, not vertex frame animation)
I have them added into the DTSSDK and the engine, so I have created a version 25 that contains morphs. I'm currently exporting them and reading them into the engine and testing them with the show mod (ShowToolPro can't read them, of course). The engine still reads the old formats.
I have them animating correctly with nodes and I'm trying to add the additional morph animation in the engine now. (Now that I can correctly create and read them.)

My question is - how do I determine the current frame in the shape animation?

(There are multiple sequences, but the morph data is stored as a long list of all control values, a set for each frame, the same way node rotations are stored).
I have to index into this list by which frame of the entire set I'm on to pull the right control values.

How is this determined? Active sequence and active frame in sequence? But I would assume that this is already done for the other animation code, I just haven't been able to find it. (Just learning the torque code.)

Is the current frame (or prev and next and percent between) available in the tsShapeInstance?

#1
08/03/2005 (5:10 pm)
The current frame (specifically, prev/next/percent between) is stored in each thread, since there can be multiple active threads on the shape.
#2
08/03/2005 (9:05 pm)
I'm now getting the right morph, morph setting and list of offsets (ignoring the setting for the moment)
I'm trying to just add the morph offset to the vert list. I'm doing it ahead of animateNode

mShape->meshes[ss]->verts[mShape->meshes[ss]->mvindex[i]] +=
mShape->meshes[ss]->mverts[i];
mShape->meshes[ss]->mvindex[i] is pt index for this morph offset
mShape->meshes[ss]->mverts[i] is the Point offset

I'm trying to show the morph at full value, but it has no effect.
Is the vert list getting copied somewhere earlier?

Where is the active vert list I should be altering?


Using the threads, I'm now getting the keyframe, starting with 0.
How do I get the start frame of the sequence? I have two sequences in the test DTS, when I'm using the second, how can I get the start frame of the set of frames in the Shape that is for this sequence. I can't find a start index for a sequence.

The keyframes I'm given are just the 0 to end frame of the sequence currently running.

2 issues -
1) how to find where in my list of contol values a seq starts (how do I know seq 2 starts on frame 11 of my list?)
2) how to alter the vertex positions prior to any other deformations (mainly node)

I put the animateMorph ahead of animateNode in animate() but the only deform I see is the node.

Getting there! I have all my morph data in hand in the engine now.