forked from afavaro/SPACEBATS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModel.h
More file actions
62 lines (41 loc) · 1.11 KB
/
Model.h
File metadata and controls
62 lines (41 loc) · 1.11 KB
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
#ifndef MODEL_H
#define MODEL_H
#include "Framework.h"
#include "Shader.h"
#include "Framebuffer.h"
#include "btBulletDynamicsCommon.h"
enum RenderPass {
NORMALS_PASS,
FINAL_PASS,
};
class Model {
public:
Model();
~Model();
void loadFromFile(const std::string &dir, const std::string &filename, Assimp::Importer &importer);
void useShader(Shader *shader);
void setTransformation(btTransform &t);
void render(RenderPass pass);
void setScaleFactor(float f);
btCollisionShape *getCollisionShape();
static sf::Image white;
static Shader *normalShader, *toonShader;
static void loadShaders();
static Framebuffer *normalsBuffer;
static void setNormalsBuffer(Framebuffer *fb);
void setDiffuseImage(sf::Image* img);
sf::Image* getDiffuseImage();
btTransform transformation;
const aiScene *scene;
float scaleFactor;
private:
// btTransform transformation;
//
// const aiScene *scene;
// float scaleFactor;
sf::Image *diffuse, *specular;
unsigned *indexBuffer;
btCollisionShape *collisionShape;
void setMeshData(aiMesh *mesh, Shader *shader, RenderPass pass);
};
#endif