1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 03:12:36 +01:00
openrw/rwengine/src/render/Model.cpp

36 lines
600 B
C++
Raw Normal View History

#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
}