2014-10-22 22:51:41 +00:00
|
|
|
#include "entity.hh"
|
|
|
|
|
|
|
|
Entity::Entity(glm::vec3 position, glm::vec3 rotation) {
|
2014-11-14 23:03:52 +00:00
|
|
|
this->position = position;
|
|
|
|
setRotation(rotation);
|
|
|
|
}
|
|
|
|
|
|
|
|
Entity::Entity(glm::vec3 position, glm::mat4 rotation) {
|
2014-10-30 22:30:56 +00:00
|
|
|
this->position = position;
|
|
|
|
this->rotation = rotation;
|
2014-10-22 22:51:41 +00:00
|
|
|
}
|
|
|
|
|
2014-10-24 08:48:45 +00:00
|
|
|
Entity::Entity(){
|
|
|
|
}
|
|
|
|
|
2014-10-22 22:51:41 +00:00
|
|
|
Entity::~Entity(){
|
|
|
|
}
|
2014-10-31 09:36:23 +00:00
|
|
|
|
|
|
|
glm::vec3 Entity::getPosition() {
|
|
|
|
return position;
|
|
|
|
}
|
2014-11-12 23:37:27 +00:00
|
|
|
|
2014-11-14 23:03:52 +00:00
|
|
|
glm::mat4 Entity::getRotation() {
|
2014-11-12 23:37:27 +00:00
|
|
|
return rotation;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Entity::setPosition(glm::vec3 position) {
|
|
|
|
this->position = position;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Entity::setRotation(glm::vec3 rotation) {
|
2014-11-14 23:03:52 +00:00
|
|
|
this->rotation = glm::rotate(rotation.x, glm::vec3(1.0f, 0.0f, 0.0f))
|
|
|
|
* glm::rotate(rotation.y, glm::vec3(0.0f, 1.0f, 0.0f))
|
|
|
|
* glm::rotate(rotation.z, glm::vec3(0.0f, 0.0f, 1.0f));
|
|
|
|
}
|
|
|
|
|
|
|
|
void Entity::setRotation(glm::mat4 rotation) {
|
2014-11-12 23:37:27 +00:00
|
|
|
this->rotation = rotation;
|
|
|
|
}
|