2013-12-20 15:03:32 +01:00
|
|
|
#include "render/Model.hpp"
|
2013-09-25 10:05:18 +02:00
|
|
|
#include <GL/glew.h>
|
2014-02-09 04:14:43 +01:00
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
#include <glm/gtc/matrix_transform.hpp>
|
|
|
|
|
2013-09-25 10:05:18 +02:00
|
|
|
|
|
|
|
Model::Geometry::Geometry()
|
2014-02-10 09:55:01 +01:00
|
|
|
: flags(0)
|
2013-09-25 10:05:18 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Model::Geometry::~Geometry()
|
|
|
|
{
|
|
|
|
}
|
2014-02-09 04:14:43 +01:00
|
|
|
|
|
|
|
ModelFrame::ModelFrame(ModelFrame* parent, glm::mat3 dR, glm::vec3 dT)
|
|
|
|
: defaultRotation(dR), defaultTranslation(dT), parentFrame(parent)
|
|
|
|
{
|
|
|
|
if(parent != nullptr) {
|
|
|
|
parent->childs.push_back(this);
|
|
|
|
}
|
|
|
|
reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ModelFrame::reset()
|
|
|
|
{
|
|
|
|
matrix = glm::translate(glm::mat4(), defaultTranslation) * glm::mat4(defaultRotation);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ModelFrame::addGeometry(size_t idx)
|
|
|
|
{
|
|
|
|
geometries.push_back(idx);
|
2014-06-08 23:40:46 +02:00
|
|
|
}
|