DAE ground animation - not working? - LOGGED
by Manoel Neto · in Torque 3D Professional · 03/14/2010 (11:14 am) · 2 replies
I've been trying to use ground animation with DAE, but it doesn't seems to work at all. The bounds node was properly identified as bounds, but it doesn't cancels out the character's displacement as in DSQ sequences.
Looking at the collada loading source the functionality seems outright incomplete: there is an attempt at reading the ground transform from the bounds animation, but it never has animations because it doesn't go through the keyframe loading process all other nodes go through. There's also zero code for making the transforms of the root node(s) relative to the bounds.
Looking at the collada loading source the functionality seems outright incomplete: there is an attempt at reading the ground transform from the bounds animation, but it never has animations because it doesn't go through the keyframe loading process all other nodes go through. There's also zero code for making the transforms of the root node(s) relative to the bounds.
About the author
Associate Manoel Neto
Default Studio Name
Replace this line:
if (!boundsNode || !boundsNode->animatesTransform(appSeq)) {By this:if (!boundsNode) {AnimatesTransform() is hardcoded to *always* return false, so the code after the if block never executed. After removing it the code goes through the animation, but always get the same values for every frame. To fix this, move this line from after the first if block to the very end of the function:Now the ground transform information will be read and can be used to scale the animations. However, the characters still displace when walking, even if the grounds is properly following them. There's no code whatsoever to make the animations relative to the bounds, so we need to add it.
Go to TSShapeLoader::getLocalNodeMatrix(), and after this block:
...Add this:
if (boundsNode && node != boundsNode && node->mParentIndex == -1) { MatrixF mb = boundsNode->getNodeTransform(t); zapScale(mb); m1 = mb.inverse() * m1; }This will make every root node transform relative to the bounds node at every frame.