Saxum/game/entity.cc

40 lines
833 B
C++
Raw Normal View History

#include "entity.hh"
Entity::Entity(glm::vec3 position, glm::vec3 rotation) {
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;
}
Entity::Entity(){
}
Entity::~Entity(){
}
2014-10-31 09:36:23 +00:00
glm::vec3 Entity::getPosition() {
return position;
}
2014-11-12 23:37:27 +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) {
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;
}