-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObject.cpp
More file actions
42 lines (33 loc) · 715 Bytes
/
Copy pathObject.cpp
File metadata and controls
42 lines (33 loc) · 715 Bytes
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
#include "Object.h"
using namespace _Object;
Object::Object(std::string obj, std::string texture, vec3 position):Entity(position) {
mesh = new Mesh();
this->obj = obj;
this->texture = texture;
// this->position = position;
}
void Object::loadMesh(std::string obj) {
this->obj = obj;
mesh->LoadModel(obj);
}
const char* Object::get_texture() {
return texture.c_str();
}
void Object::draw() {
if (!meshLoaded) {
mesh->LoadModel(obj);
meshLoaded = true;
}
mesh->Draw();
}
void Object::processInput(std::string key) {
if (key == "e") {
position.y += sin(interval*10) / 10;
}
}
void Object::processMouseInput(int button) {
// Blank
}
void Object::processMouse(float x, float y) {
// Blank
}