Added empty constructors to be able to define objects without instanciating them.
This commit is contained in:
parent
c747968b91
commit
11229430cb
@ -3,5 +3,8 @@
|
|||||||
Entity::Entity(glm::vec3 position, glm::vec3 rotation) {
|
Entity::Entity(glm::vec3 position, glm::vec3 rotation) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Entity::Entity(){
|
||||||
|
}
|
||||||
|
|
||||||
Entity::~Entity(){
|
Entity::~Entity(){
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
class Entity {
|
class Entity {
|
||||||
public:
|
public:
|
||||||
Entity(glm::vec3 position, glm::vec3 rotation);
|
Entity(glm::vec3 position, glm::vec3 rotation);
|
||||||
|
Entity();
|
||||||
~Entity();
|
~Entity();
|
||||||
void setPosition(glm::vec3 positon);
|
void setPosition(glm::vec3 positon);
|
||||||
void setRotation(glm::vec3 rotation);
|
void setRotation(glm::vec3 rotation);
|
||||||
|
3
model.cc
3
model.cc
@ -5,6 +5,9 @@ Model::Model(std::string filePath) {
|
|||||||
reference->bind();
|
reference->bind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Model::Model(){
|
||||||
|
}
|
||||||
|
|
||||||
Model::~Model() {
|
Model::~Model() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
model.hh
1
model.hh
@ -7,6 +7,7 @@
|
|||||||
class Model {
|
class Model {
|
||||||
public:
|
public:
|
||||||
Model(std::string filePath);
|
Model(std::string filePath);
|
||||||
|
Model();
|
||||||
~Model();
|
~Model();
|
||||||
ACGL::OpenGL::SharedVertexArrayObject getReference();
|
ACGL::OpenGL::SharedVertexArrayObject getReference();
|
||||||
private:
|
private:
|
||||||
|
@ -10,9 +10,13 @@ Object::Object(Model model, Texture texture, glm::vec3 position, glm::vec3 rotat
|
|||||||
this->shader = shader.getReference();
|
this->shader = shader.getReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Object::Object() {
|
||||||
|
}
|
||||||
|
|
||||||
Object::~Object() {
|
Object::~Object() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object::render() {
|
void Object::render() {
|
||||||
shader->setTexture("uTexture", texture, 0);
|
shader->setTexture("uTexture", texture, 0);
|
||||||
|
model->render();
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ class Object : Entity {
|
|||||||
public:
|
public:
|
||||||
Object(Model model, Texture texture, glm::vec3 position, glm::vec3 rotation,
|
Object(Model model, Texture texture, glm::vec3 position, glm::vec3 rotation,
|
||||||
glm::vec3 velocity, glm::vec3 angularVelocity, Shader shader);
|
glm::vec3 velocity, glm::vec3 angularVelocity, Shader shader);
|
||||||
|
Object();
|
||||||
~Object();
|
~Object();
|
||||||
void render();
|
void render();
|
||||||
private:
|
private:
|
||||||
|
@ -6,6 +6,9 @@ Shader::Shader(std::string filePath, Model model) {
|
|||||||
reference->use();
|
reference->use();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Shader::Shader() {
|
||||||
|
}
|
||||||
|
|
||||||
Shader::~Shader() {
|
Shader::~Shader() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
class Shader {
|
class Shader {
|
||||||
public:
|
public:
|
||||||
Shader(std::string filePath, Model model);
|
Shader(std::string filePath, Model model);
|
||||||
|
Shader();
|
||||||
ACGL::OpenGL::SharedShaderProgram getReference();
|
ACGL::OpenGL::SharedShaderProgram getReference();
|
||||||
~Shader();
|
~Shader();
|
||||||
private:
|
private:
|
||||||
|
@ -4,6 +4,9 @@ Texture::Texture(std::string filePath) {
|
|||||||
reference = ACGL::OpenGL::Texture2DFileManager::the()->get(ACGL::OpenGL::Texture2DCreator(filePath));
|
reference = ACGL::OpenGL::Texture2DFileManager::the()->get(ACGL::OpenGL::Texture2DCreator(filePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Texture::Texture() {
|
||||||
|
}
|
||||||
|
|
||||||
Texture::~Texture() {
|
Texture::~Texture() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
class Texture{
|
class Texture{
|
||||||
public:
|
public:
|
||||||
Texture(std::string filePath);
|
Texture(std::string filePath);
|
||||||
|
Texture();
|
||||||
ACGL::OpenGL::SharedTexture2D getReference();
|
ACGL::OpenGL::SharedTexture2D getReference();
|
||||||
~Texture();
|
~Texture();
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user