3D City v-1.0
Computer Graphics Project
node.h
Go to the documentation of this file.
1#pragma once
2#include "core.h"
3#include <unordered_map>
4#include <vector>
5
6template <class T>
7class drawable;
8
9class engine;
10
14struct node {
15 std::unordered_map<std::string, node *> children;
16 std::vector<drawable<Vertex> *> meshes;
18
19 void delpos(const vec3 &delta);
20
21 void setpos(const vec3 &position);
22
23 void setScale(const vec3 &scale);
24
25 void setRotation(float angle, const vec3 &axis);
26
27 const mat4f &refreshModel();
28
29 void draw(engine &graphicsEngine, mat4f matModel_in = mat4f());
30
31 private:
35};
engine * graphicsEngine
Definition: application.cpp:41
mat< float, 4, 4 > mat4f
Definition: maths.h:750
this class represents all drawable entities that has a material and vertices
Definition: drawable.h:12
backend for all rendering purposes
Definition: engine.h:94
anything that can be transformed( has modelmatrix )
Definition: node.h:14
void draw(engine &graphicsEngine, mat4f matModel_in=mat4f())
Definition: node.cpp:39
const mat4f & refreshModel()
Definition: node.cpp:26
void setpos(const vec3 &position)
Definition: node.cpp:11
std::vector< drawable< Vertex > * > meshes
Definition: node.h:16
mat4f translation
Definition: node.h:33
mat4f matModel
Definition: node.h:17
mat4f rotation
Definition: node.h:34
mat4f scaling
Definition: node.h:32
void delpos(const vec3 &delta)
Definition: node.cpp:6
void setScale(const vec3 &scale)
Definition: node.cpp:16
std::unordered_map< std::string, node * > children
Definition: node.h:15
void setRotation(float angle, const vec3 &axis)
Definition: node.cpp:21