Possible to mix animations?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Saumane
Posts: 27
Joined: Wed Jul 09, 2008 6:14 pm
Location: Finland

Possible to mix animations?

Post by Saumane »

I tried to search the forums on this but couldn't really find anything useful. I'm wondering if it's somehow possible with irrlicht, to mix several animations on a scene node? I have a model that has a run animation, and an attack animation, and i'd like to mix the animations so that when player is running, only the arm bones change the animation if the player attacks, so that the rest of the body is still using the running animation.
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

as for me, i have the mesh with full bones, doing some animations.
and i have an other mesh what not contains meshes, only the lower part joints (what you want to mix)

and in every frame, change the original mesh's bones.

Code: Select all

for (u32 n = 0; n < lowerAnimNode->getJointCount(); n++)
{
	IBoneSceneNode* toChange = lowerAnimNode->getJointNode(n);
	IBoneSceneNode* changeNode = body->getJointNode(toChange->getName());
	if (changeNode)
	{
		changeNode->setRotation(toChange->getRotation());
		changeNode->setPosition(toChange->getPosition());
	}
}
dunno if its the fastest way, but it works.
ohh and, the jointmode have to be EJUOR_CONTROL.. maybe xD
Image
Image
Post Reply