Game Development Community

TGEA 1.7.0 - animateSubtree will not animate all subtrees

by David Montgomery-Blake · in Torque Game Engine Advanced · 05/22/2008 (6:21 am) · 0 replies

From Stenv's blog which I have removed and am reposting here to be in the right area. I'm also notifying him via e-mail as to where this is located now.

1.
// animateSubtrees: will not animate all subtree
// file:tsAnimate.cpp line:847

void TSShapeInstance::animateSubtrees(bool forceFull) 
{
   //...
}


// change to:

void TSShapeInstance::animateSubtrees(bool forceFull) 
{
   // animate all the subtrees

   if (forceFull)
     // force full animate
     setDirty(AllDirtyMask);

    U32 ssSize = mShape->subShapeFirstNode.size();
    bool *doneAni = new bool[ssSize];
    dMemset(doneAni, 0, sizeof(bool) * ssSize);

    for (S32 i=0; i<mShape->details.size(); i++)
    {
         S32 ss = mShape->details[i].subShapeNum;
         if (ss < 0 || ss >= ssSize)
                continue;
         if (!doneAni[ss])
         {
            doneAni[ss] = true;
            if (mDirtyFlags[ss] & TransformDirty)
            {
                 animate(i);
                 mDirtyFlags[ss] = 0;
            }
         }
    }
    delete[] doneAni;
}


2.First,When can we get the newest dts exporter for tgea1.7 code? Some ts class modified, should we fix it by self or get a latest source?

Second,from tgea1.0.3 the class member TSShape::Node will not take more then one TSShape::Object? Only one object or none.
See code:

void ShapeMimic::addNode(NodeMimic * mimicParent,
                         INode * maxChild,
                         Vector<S32> & validDetails,
                         bool recurseChildren)
{
    // ......
    // always one object
    if (hasMesh(mimicChild->maxNode) && !SceneEnumProc::isDummy(mimicChild->maxNode))
    {
        printDump(PDPass2,"Attaching object to node.\r\n");
        mimicChild->objects.push_back(addObject(mimicChild->maxNode,&validDetails));
    }
}

void ShapeMimic::addSkin(INode * pNode, S32 multiResSize, F32 multiResPercent)
{
    // ......
         for (j=0; j<skinMimic->bones.size(); j++)
         {
            // no bone will be the same, only one object
            if (skinMimic->bones[j] == mimicNode->maxNode)
            {
               ObjectMimic * obj = addBoneObject(skinMimic->bones[j],i);
               if (!obj)
                  return;
               for (k=0;k<mimicNode->objects.size();k++)
                  if (mimicNode->objects[k]==obj)
                     break;
               if (k==mimicNode->objects.size())
                  mimicNode->objects.push_back(obj);
            }
         }
}



Please someone tell me more.

3. more fix will come soon, clean up...

About the author

Community management and development, Educational computing systems and lab management, Flex, ActionScript, JavaScript, PHP, C++, C#, Perl, Python, Ruby, LUA, etc.