Game Development Community

How is data read into TSMesh/Is animation done in TSSkinMesh

by Joshua "The Power Nap" Taylor · in Torque Game Engine · 08/23/2003 (3:40 pm) · 0 replies

I've been working on adding shaders to the TSmesh class, and I had a question on how data is read into a mesh.

I need to calculate the binormal and tangent to compliment the normal of each vertex. From what I've read so far, I can see that the actuall mesh is created in TSmesh::assemble. I just don't know where. I could safely put my code at the very end, but I'd like to understand the function a little better. Mainly for future refrence.

Now, is the actual animation done in TSSkinMesh? I.E. the verticies are transformed either via bones or morphs. From what I can see, it stores the original mesh in initialVerts and performs the bone/morph animations to the datamembers inherited from TSMesh. I ask this because I want my binormal and tangent computations done once and only once per shape. If they have to be transformed along with the shape, so be it. But I'd like to store a copy with the original verts to draw from.