Irrlicht 3d animation concern

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
danielmccarthy
Posts: 51
Joined: Fri May 30, 2014 12:55 am

Irrlicht 3d animation concern

Post by danielmccarthy »

Hi,
I was wondering if their is a way in Irrlicht to use the same animations on other models without needing to remake them.

I am asking this because lets say I have a zombie in my game and he has an animation where he crawls out of the ground. Then I have my player and their is a quest where he is burried alive and crawls out. These are just examples of course but it seems silly to have to remake the animation twice. It seems to me it should be as simple as making a function and calling it 'setAnimation' then you pass an animation number and it will play that animation no matter the mesh. Obviously some models won't be compatible with certain animations but it makes sense to me to have this sort of setup because in my game their will be a lot of player like characters and similarities.

For example a cat and a dog both have four legs so to me it wouldn't hurt to use the same walking animation.

Thanks,
Dan
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht 3d animation concern

Post by CuteAlien »

You need ISkinnedMesh::useAnimationFrom to use the animation from another skinned mesh.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
danielmccarthy
Posts: 51
Joined: Fri May 30, 2014 12:55 am

Re: Irrlicht 3d animation concern

Post by danielmccarthy »

Thanks mate
danielmccarthy
Posts: 51
Joined: Fri May 30, 2014 12:55 am

Re: Irrlicht 3d animation concern

Post by danielmccarthy »

Any code examples the reference in Irrlicht is returning a bool so I am a bit confused how to use this?
kklouzal
Posts: 343
Joined: Sun Mar 28, 2010 8:14 pm
Location: USA - Arizona

Re: Irrlicht 3d animation concern

Post by kklouzal »

Dream Big Or Go Home.
Help Me Help You.
danielmccarthy
Posts: 51
Joined: Fri May 30, 2014 12:55 am

Re: Irrlicht 3d animation concern

Post by danielmccarthy »

Ok I get a rough idea, How do I get the skeletal mesh of a node and then set it to another node
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht 3d animation concern

Post by CuteAlien »

There are getMesh functions and you can cast to ISkinnedMesh when you know you have one. There could be some threads around the forum when you search for "useAnimationFrom" - maybe one of those helps. Unfortunately we have no official example yet for this use-case.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
danielmccarthy
Posts: 51
Joined: Fri May 30, 2014 12:55 am

Re: Irrlicht 3d animation concern

Post by danielmccarthy »

Ok thanks
Post Reply