Add skinning
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "boundingbox.h"
|
||||
#include "render_shared.h"
|
||||
#include "animation.h"
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/type_ptr.hpp>
|
||||
@@ -31,18 +32,46 @@ public:
|
||||
Model();
|
||||
~Model();
|
||||
|
||||
void LoadIqm(const char* filename);
|
||||
void LoadObj(const char* filename);
|
||||
void LoadMtl(const char* filename);
|
||||
|
||||
void Draw(const glm::mat4& model, bool isTransparent = false);
|
||||
void Draw(const glm::mat4& model, SkeletonInstance* instance = nullptr);
|
||||
|
||||
const BoundingBox& GetBoundingBox() { return m_boundingBox; }
|
||||
|
||||
// Animation
|
||||
AnimationId_t FindAnimation(const char* name);
|
||||
uint32_t GetNumAnimations();
|
||||
|
||||
const Animation* GetAnimation(AnimationId_t index);
|
||||
|
||||
int GetNumPoses();
|
||||
|
||||
SkeletonInstance* CreateSkeletonInstance();
|
||||
void UpdateSkeletonInstance(SkeletonInstance* instance, float dt);
|
||||
|
||||
// void PlayAnimation(AnimationId_t id, bool looped);
|
||||
// void StopAnimation();
|
||||
|
||||
private:
|
||||
std::vector<Joint> m_joints;
|
||||
std::vector<Joint> m_basePose;
|
||||
std::vector<glm::mat4> m_inverseBasePose;
|
||||
std::vector<glm::mat4> m_jointMatrices;
|
||||
std::vector<glm::mat4> m_finalMatrices;
|
||||
|
||||
std::vector<Animation> m_animations;
|
||||
|
||||
std::vector<StaticMeshVertex> m_Vertices;
|
||||
ModelData_t m_data;
|
||||
|
||||
|
||||
std::vector<ModelData_t> m_meshes;
|
||||
|
||||
BoundingBox m_boundingBox;
|
||||
Texture2D* m_AlbedoTexture;
|
||||
|
||||
int m_numPoses;
|
||||
};
|
||||
|
||||
#endif // !MODEL_H
|
||||
|
||||
Reference in New Issue
Block a user