OpenRaider  0.1.4-dev
Open Source Tomb Raider Game Engine implementation
SkeletalModel.h
Go to the documentation of this file.
1 
9 #ifndef _SKELETALMODEL_H_
10 #define _SKELETALMODEL_H_
11 
12 #include <vector>
13 
14 #include "system/Shader.h"
15 
16 class BoneTag {
17  public:
18  BoneTag(int m, glm::vec3 o, glm::vec3 r, char f) : mesh(m), off(o), rot(r), flag(f) { }
19  void display(glm::mat4 MVP, ShaderTexture* shaderTexture = nullptr);
20 
21  glm::vec3 getOffset() { return off; }
22  glm::vec3 getRotation() { return rot; }
23  char getFlag() { return flag; }
24 
25  private:
26  int mesh;
27  glm::vec3 off, rot;
28  char flag;
29 };
30 
31 class BoneFrame {
32  public:
33  BoneFrame(glm::vec3 p) : pos(p) { }
34  ~BoneFrame();
35 
36  glm::vec3 getPosition() { return pos; }
37 
38  unsigned long size();
39  BoneTag& get(unsigned long i);
40  void add(BoneTag* t);
41 
42  private:
43  glm::vec3 pos;
44  std::vector<BoneTag*> tag;
45 };
46 
48  public:
49  AnimationFrame(char r) : rate(r) { }
51 
52  unsigned long size();
53  BoneFrame& get(unsigned long i);
54  void add(BoneFrame* f);
55 
56  private:
57  char rate;
58  std::vector<BoneFrame*> frame;
59 };
60 
62  public:
63  SkeletalModel(int i) : id(i) { }
65  void display(glm::mat4 MVP, int aframe, int bframe, ShaderTexture* shaderTexture = nullptr);
66 
67  int getID() { return id; }
68 
69  unsigned long size();
70  AnimationFrame& get(unsigned long i);
71  void add(AnimationFrame* f);
72 
73  private:
74  int id;
75  std::vector<AnimationFrame*> animation;
76 };
77 
78 #endif
void display(glm::mat4 MVP, ShaderTexture *shaderTexture=nullptr)
char getFlag()
Definition: SkeletalModel.h:23
OpenGL Shader Implementation.
unsigned long size()
void add(BoneTag *t)
void add(AnimationFrame *f)
void display(glm::mat4 MVP, int aframe, int bframe, ShaderTexture *shaderTexture=nullptr)
SkeletalModel(int i)
Definition: SkeletalModel.h:63
AnimationFrame(char r)
Definition: SkeletalModel.h:49
unsigned long size()
BoneTag(int m, glm::vec3 o, glm::vec3 r, char f)
Definition: SkeletalModel.h:18
glm::vec3 getOffset()
Definition: SkeletalModel.h:21
glm::vec3 getRotation()
Definition: SkeletalModel.h:22
std::vector< AnimationFrame * > animation
Definition: SkeletalModel.h:75
void add(BoneFrame *f)
glm::vec3 getPosition()
Definition: SkeletalModel.h:36
std::vector< BoneFrame * > frame
Definition: SkeletalModel.h:58
unsigned long size()
BoneFrame(glm::vec3 p)
Definition: SkeletalModel.h:33
glm::vec3 rot
Definition: SkeletalModel.h:27
glm::vec3 pos
Definition: SkeletalModel.h:43
glm::vec3 off
Definition: SkeletalModel.h:27
std::vector< BoneTag * > tag
Definition: SkeletalModel.h:44
char flag
Definition: SkeletalModel.h:28