I think it's probably too complex to be exposed in the public API, newbie-unfriendly enough due to the generics etc, but I see no reason why something like this (without the exceptions) couldn't be used behind the scenes to do all sorts of interpolation.
I guess we'd need quite a few changes to ISkinnedMesh to accommodate it, but I don't see that being too much of a problem.
Here's what I've decided on for the IAnimatedMesh changes:
http://pastebin.com/fmgqZLwT
I can't see any obvious incompatibilities there, and I think my idea still seems reasonably sensible even if we did use generic animators. Please feel free to suggest changes before I take the plunge and start editing all the implementations though!
IAnimatedMesh named animations
Agreed, there's still much work to be done before determining if something like this would be right for Irrlicht.bitplane wrote: I guess we'd need quite a few changes to ISkinnedMesh to accommodate it, but I don't see that being too much of a problem.
+1 from me.bitplane wrote:Here's what I've decided on for the IAnimatedMesh changes
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Yeah, +1 from me too. It looks awesome so far. I set mine up with chaining by the way. When the animation finishes, it automatically plays the next animation if it exists. That might be something nice to add.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
I figured that we'd need a float in case someone ran an animation very slowly, they'd get jerky playback with unsigned ints. Also, they may want to reverse the animation by messing with the clock.
However, coming to implement this in SAnimatedMesh I realise that you're completely right. It adds far too much complexity for the benefit of a couple of corner cases, I'll change it to u32.
However, coming to implement this in SAnimatedMesh I realise that you're completely right. It adds far too much complexity for the benefit of a couple of corner cases, I'll change it to u32.
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Something that would be really nice is root bone motion. If the root bone is moved in the animation, then the scene node's position would be updated also. And if we had that it would also be nice to have callback that gets the position that the scene node was going to be moved to; so that the positioning could be overriden if we needed to also reposition physics objects, or cameras.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
many models have more than one animated root when imported into irrlicht's as a skinnedmesh, I spotted this issue with a couple of characters I bought online.
Irrlicht's skinning system allows for multiple roots although practically speaking, setting a single root is a trivial reorganization process during loading and there is no need for more than one root
morph target animations should be separate and parallel to skinning animation, so both can be controlled and applied depending on the project requirements;
ie, for MD2 skinned-animation isn't needed and for B3D morph-animations aren't, yet both animation methods should be available simultaneously instead of having two distinct node types
Though i'm happy with my custom animated model setup, I will keep a close eye on this topic anyways![Wink :wink:](./images/smilies/icon_wink.gif)
Irrlicht's skinning system allows for multiple roots although practically speaking, setting a single root is a trivial reorganization process during loading and there is no need for more than one root
morph target animations should be separate and parallel to skinning animation, so both can be controlled and applied depending on the project requirements;
ie, for MD2 skinned-animation isn't needed and for B3D morph-animations aren't, yet both animation methods should be available simultaneously instead of having two distinct node types
Though i'm happy with my custom animated model setup, I will keep a close eye on this topic anyways
![Wink :wink:](./images/smilies/icon_wink.gif)
Has any coding been done for this? If not, I have a patch that implements the interface bitplane described here:
http://pastebin.com/fmgqZLwT
Using the existing IAnimatedMeshSceneNode interface, running a named animation would look something like this:
Given that, I'm thinking an IAnimatedMeshSceneNode update would make using named animations a bit easier:
Thoughts?
http://pastebin.com/fmgqZLwT
Using the existing IAnimatedMeshSceneNode interface, running a named animation would look something like this:
Code: Select all
scene::IAnimatedMeshSceneNode* animatedNode;
scene::IAnimatedMesh* animatedMesh;
io::IAttributes* animationData;
s32 index;
animatedMesh = animatedNode->getMesh();
if((index = animatedMesh->getAnimationIndex("walk")) >= 0)
{
animatedMesh->getAnimation(index, animationData);
s32 start = animationData->getAttributeAsInt("startFrame");
s32 end = animationData->getAttributeAsInt("endFrame");
animatedNode->setFrameLoop(start, end);
}
Code: Select all
bool IAnimatedMeshSceneNode::setAnimation(const c8* name);
bool IAnimatedMeshSceneNode::setAnimation(const io::IAttributes* data);
bool IAnimatedMeshSceneNode::getAnimation(const c8* name, io::IAttributes* data);