Node animations
by Kynan Eng · in Torque Game Engine · 08/31/2005 (12:37 am) · 4 replies
We have a hand shape, which we want to animate the nodes of. I want to do this by rotating the knuckle nodes of this shape. To be able to animate it, we set the MaskNodeHandsOff for the knuckle nodes. And then I set the smNodeCurrentRotations for those nodes to the wantedd values, however, the shape starts looking weird, where the rest of the nodes under these knuckles (the fungers) move to strange places with strange rotations.
To be able to apply a nice rotation to a single node like a knuckle in this example, what exactly do we need to set(smCurrentRotations, ...), and which functions (animateSubtrees?) do we need to call?
To be able to apply a nice rotation to a single node like a knuckle in this example, what exactly do we need to set(smCurrentRotations, ...), and which functions (animateSubtrees?) do we need to call?
About the author
#2
MatrixF * mat = &mShapeInstance->mNodeTransforms[node];
Point3F defaultPos = getDataBlock()->shapeResource->defaultTranslations[node];
mat->set(EulerF(0,0,mRot.z));
mat->setColumn(3,defaultPos);
by altering mNodeTransorms' rotation, and keeping the translation to the shape's defaultTranslation seems to do the trick. of course, there is
mShapeInstance->setDirty(TSShapeInstance::TransformDirty);
mShapeInstance->animate();
at the end. But then, what is the mShapeInstance's smNodeCurrentRotations, ... for? which is the transformation actually used to render the object ?
it would be nice if somebody could give some info about this?
08/31/2005 (2:21 am)
Paul Dana's turrets code seems to work:MatrixF * mat = &mShapeInstance->mNodeTransforms[node];
Point3F defaultPos = getDataBlock()->shapeResource->defaultTranslations[node];
mat->set(EulerF(0,0,mRot.z));
mat->setColumn(3,defaultPos);
by altering mNodeTransorms' rotation, and keeping the translation to the shape's defaultTranslation seems to do the trick. of course, there is
mShapeInstance->setDirty(TSShapeInstance::TransformDirty);
mShapeInstance->animate();
at the end. But then, what is the mShapeInstance's smNodeCurrentRotations, ... for? which is the transformation actually used to render the object ?
it would be nice if somebody could give some info about this?
#3
Looks like you found a working solution, then?
08/31/2005 (2:35 am)
The current rotations and such are used for blending operations, dealing with layered animations, etc. Utimately, it's the static globals, but the information goes through a fair chain of processing before it gets there.Looks like you found a working solution, then?
#4
but it'll be good to learn the animation chain, if you can point ot the resource or can write a summary?: when the shape is used, when the shapeinstance is used, which members have the final values to be rendered to the screen..
08/31/2005 (6:55 am)
This seems to be working.. at least the rotations i set are applied:)but it'll be good to learn the animation chain, if you can point ot the resource or can write a summary?: when the shape is used, when the shapeinstance is used, which members have the final values to be rendered to the screen..
Associate Kyle Carter