-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModelA.hpp
71 lines (58 loc) · 1.68 KB
/
ModelA.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//
// ModelA.hpp
// SkinningRecorder
//
// Created by IDE KENTARO on 2019/04/08.
// Copyright © 2019 IdeKentaro. All rights reserved.
//
#ifndef ModelA_hpp
#define ModelA_hpp
#include <vector>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
class Skin;
class ModelA
{
private:
GLFWwindow *window;
Skin *skin;
GLuint modelVAO;
GLuint modelProgramID;
GLuint modelMatrixID;
GLuint ViewMatrixID;
GLuint ModelMatrixID;
glm::mat4 boneMatrix[12];
GLuint boneMatrixID;
GLuint Texture;
GLuint TextureID;
glm::mat4 modelMVP;
GLuint modelVBO[4];
GLuint weightVBO[12];
GLuint modelCBO;
GLuint LightID;
std::vector<glm::vec3> vertices;
std::vector<glm::vec2> uvs;
std::vector<glm::vec3> normals;
std::vector<unsigned short> indices;
std::vector<glm::vec3> indexed_vertices;
std::vector<glm::vec2> indexed_uvs;
std::vector<glm::vec3> indexed_normals;
std::vector<std::vector<float>> indexed_weights;
public:
void initOBJ(GLFWwindow* window, const char* obj, const char* wgt, const char* kfm, const char* vert, const char* frag);
void playOBJ(const glm::mat4 &M, const glm::mat4 &BoneM);
void getBoneMatrix(const int &bone, glm::mat4 &boneMatrix);
void playstop();
void stop();
void changefps(int &fps);
void changeframe(int &frame);
void selectBone(int &sbone);
void updateRotate(int &axis, float &rot, const int &rotate_mm);
int getfps();
int getframe();
glm::vec3 copy();
void paste(glm::vec3 &rot);
void recorde(std::string &name);
};
#endif /* ModelA_hpp */