ISkinnedMesh joint control

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

ISkinnedMesh joint control

Post by 3DModelerMan »

I'm trying to program a character scene node for my game. I'm not going to use the Irrlicht animation system though because it doesn't have animation blending. I'm using Havok Animation. So I only need to be able to set the positions to match the Havok joints. What I was going to do, was basically copy the CAnimatedMeshSceneNode over to my character. This didn't work because all I really need is to be able to set the joint positions. So if I get the positions from my mesh with ISkinnedMesh::getAllJoints() and then change the joint's Animatedposition, Animatedrotation, and Animatedscale members, before calling ISkinnedMesh::skinMesh(), will the mesh be animated to that position when I render it?
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
eye776
Posts: 94
Joined: Sun Dec 28, 2008 11:07 pm

Post by eye776 »

Well since you're basically treating the node like a ragdoll, you call setRenderFromIdentity(true) for the scene node.
You'll also need to call setJointMode(EJUOR_CONTROL)

(Also see: http://www.irrlicht3d.org/wiki/index.php?n=Main.HowToUseTheNewAnimationSystem)

This should cut down on the fat (and in your case useless) calculations and you will get the result you wanted.

However I'm not sure if this is THE best way.
Nor do I currently know how to enable hardware skinning.
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

I'm programming a custom scene node, I just need to be able to pose the mesh in my node before I render it.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
eye776
Posts: 94
Joined: Sun Dec 28, 2008 11:07 pm

Post by eye776 »

setJointMode(EJUOR_CONTROL)

and use the bones as you would use any scenenode with
setAbsolutePosition(), setPosition and setRotation().
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

Yeah, I know how to control the IAnimatedMeshSceneNode, I have just an ISkinnedMesh that I'm rendering with my OWN scene node.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
eye776
Posts: 94
Joined: Sun Dec 28, 2008 11:07 pm

Post by eye776 »

IIRC In this case, ISkinnedMesh joints will have to have their matrices updated by hand. Then you can call skinMesh().

You can look at CAnimatedMeshSceneNode.cpp from the irrlicht sources on how to do this.

EDIT: Maybe I'm wron though, so keep waiting a little more for a proper answer form a dev or someone more knowledgeable.
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

The matrices should be easy to update, I'll keep waiting I still have to make a character to test anyways.
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Post Reply