-
Notifications
You must be signed in to change notification settings - Fork 7
Animation
The animation is somewhat complex in some areas, even if the principle of skinning is not too hard. See http://ephenationopengl.blogspot.se/2012/06/doing-animations-in-opengl.html for more information. It is complex because there are many data structures, that has to be setup and transferred in a appropriate way to the shader.
One area that need to be looked into is the use of more than one animation. Currently, only a running animation is used for all models. Some assumptions (TBC):
- Assimp probably supports more than one animation (if not, we would have to use one model file for each animation).
- Identify what mechanism Assimp uses to address animation variants. I would guess they are identified by a string (a name).
- Extend the data structures in Ephenation to support more than one animation (during initialization, data is copied from the Assimp structures into Ephenation structures).
- For monsters, identify what state the monster is in (running, fighting, resting are the easiest ones). Based on monster state, select the appropriate animation.
The models are stored in the folder "models/*.dae". The parsing of the models and drawing of animations is done in BlenderModel.cpp. The name of the file would indicate that it is targeted for Blender, but that is not really the case. It should work with any Assimp model.
The idea with a "resting" animation is something to use when a player or monster is not moving. As it currently is, some monsters will simply halt in mid-step, with one foot in the air. There is a simple logic that will add a time offset into the animation sequence, to select a frame from the running animation that is best suited for a "resting pose". It is a simple work-around that doesn't look really good.