SO3Engine
ALSkeleton.h
Go to the documentation of this file.
1#ifndef ALSKELETONANIM_H
2#define ALSKELETONANIM_H
3
4#include "ALScene.h"
6
7#include <OgreHardwareBuffer.h>
8#include <OgreMesh.h>
9#include <OgreSubMesh.h>
10
11#include <map>
12
13namespace SO3
14{
15 class ALBone
16 {
17 public:
18 ALBone(aiNode* node, aiBone* bone)
19 {
20 mNode = node;
21 mBone = bone;
22 }
23
25
26 aiMatrix4x4 mBindMatrix;
27 aiNode* mNode;
28 aiBone* mBone;
29 };
30
32 {
33 public:
34 ALSkeleton();
35 ALSkeleton(ALScene* alscene, Ogre::SkeletonPtr skeleton, aiNode* attach);
37
38 aiNode* findMeshNode(aiNode* node, const aiMesh* mesh);
39 aiMatrix4x4 getLocalUniformMatrix(int bid);
40 aiMatrix4x4 getNodeLocalTransformWithBindPose(aiNode* node);
41 void addBone(aiNode* node, aiBone* bone, Ogre::SubMesh* submesh);
42
43 aiNode* getRootNode();
44 aiBone* getBoneFromNode(aiNode* node);
45 ALBone getBoneNodeByName(const std::string name);
46 int getBoneIndexByName(const std::string name);
47 std::vector<aiAnimation*> findConcernedAnimation();
48 void generateAnimation(aiAnimation* anim);
49 void makeHierarchy(aiMatrix4x4 meshInverseTrans);
50
51 void processAnimation();
52
53 private:
54 ALScene* mScene;
55 std::vector<Ogre::Animation*> mAnims;
56 std::vector<ALBone> mBones;
57 Ogre::SkeletonPtr mSkeleton;
58 aiNode* mNode;
59
60 template<typename T> T getBiggerValue(T* data, unsigned int size);
61 };
62};
63
64#endif
librairies include
aiNode * mNode
Definition ALSkeleton.h:27
aiMatrix4x4 mBindMatrix
Definition ALSkeleton.h:26
ALBone(aiNode *node, aiBone *bone)
Definition ALSkeleton.h:18
aiBone * mBone
Definition ALSkeleton.h:28
void addBone(aiNode *node, aiBone *bone, Ogre::SubMesh *submesh)
void makeHierarchy(aiMatrix4x4 meshInverseTrans)
aiNode * findMeshNode(aiNode *node, const aiMesh *mesh)
Definition ALSkeleton.cpp:9
int getBoneIndexByName(const std::string name)
aiNode * getRootNode()
void processAnimation()
aiMatrix4x4 getNodeLocalTransformWithBindPose(aiNode *node)
ALBone getBoneNodeByName(const std::string name)
void generateAnimation(aiAnimation *anim)
aiBone * getBoneFromNode(aiNode *node)
aiMatrix4x4 getLocalUniformMatrix(int bid)
std::vector< aiAnimation * > findConcernedAnimation()