AtomicGameEngine / AtomicExamples

Examples for the Atomic Game Engine
https://www.AtomicGameEngine.com
95 stars 58 forks source link

Character animation examples request #46

Open Type1J opened 8 years ago

Type1J commented 8 years ago

The CharacterAnimation2D and CharacterAnimation3D would be far more helpful if they demonstrated not just how to play animations, but how to tween into them (maybe only if a checkbox is checked).

In other words, the character in a game is never going to just go from idle to walk. Instead, the character will interpolate between the idle and the walk animation over some duration. The examples should show that sort of usage, since it's more likely that that's what is desired.

JoshEngebretson commented 8 years ago

This is a good idea and when there is a more complicated rig, it would be good to also show blending multiple animations, etc.

It is easy to interpolate animations by providing a fade time, this is the 4th parameter to playExclusive, which is set to 0 in these examples by default:

https://github.com/AtomicGameEngine/AtomicGameEngine/blob/master/Source/Atomic/Atomic3D/AnimationController.h#L104

However, in Roboman3D he does interpolate between over a 1/10th of a second:

https://github.com/AtomicGameEngine/AtomicExamples/blob/master/RoboMan3D/Resources/Components/RoboMan.js#L42

I have to look into the CharacterAnimation2D, though updating the CharacterAnimation3D to at least have the interpolation should be done, as it is trivial and will improve the example.