14 #include <glm/gtc/matrix_transform.hpp>
23 for (
unsigned long i = 0; i <
tag.size(); i++)
43 for (
unsigned long i = 0; i <
frame.size(); i++)
64 MatrixStack(glm::mat4 start) : startVal(start) { stack.push_back(startVal); }
69 stack.push_back(stack.at(stack.size() - 1));
81 return stack.at(stack.size() - 1);
86 std::vector<glm::mat4> stack;
93 for (
unsigned long i = 0; i <
animation.size(); i++)
111 glm::mat4 frameTrans = glm::translate(glm::mat4(1.0f), glm::vec3(pos.x, -pos.y, pos.z));
113 MatrixStack stack(MVP * frameTrans);
120 for (
unsigned int a = 0; a < boneframe.
size(); a++) {
123 glm::mat4 translate(1.0f);
144 std::bitset<8> bs(tag.
getFlag());
150 translate = glm::translate(glm::mat4(1.0f), glm::vec3(off.x, -off.y, off.z));
154 glm::mat4 rotY = glm::rotate(glm::mat4(1.0f), rot[1], glm::vec3(0.0f, 1.0f, 0.0f));
155 glm::mat4 rotX = glm::rotate(glm::mat4(1.0f), rot[0], glm::vec3(1.0f, 0.0f, 0.0f));
156 glm::mat4 rotZ = glm::rotate(glm::mat4(1.0f), rot[2], glm::vec3(0.0f, 0.0f, 1.0f));
157 glm::mat4 rotate = rotZ * rotX * rotY;
159 glm::mat4 mod = translate * rotate;
160 tag.
display(stack.get() * mod, shaderTexture);
void display(glm::mat4 MVP, ShaderTexture *shaderTexture=nullptr)
void add(AnimationFrame *f)
void display(glm::mat4 MVP, int aframe, int bframe, ShaderTexture *shaderTexture=nullptr)
static LogLevel & get(int level)
void display(glm::mat4 MVP, ShaderTexture *shaderTexture=nullptr)
BoneTag & get(unsigned long i)
AnimationFrame & get(unsigned long i)
BoneFrame & get(unsigned long i)
std::vector< AnimationFrame * > animation
#define assertLessThan(x, y)
std::vector< BoneFrame * > frame
Mesh & getMesh(unsigned long index)
std::vector< BoneTag * > tag