3076e6740c5ddd65fbb376eb77f0ab4cd1d496c7
[laserbrain_demo] / src / objmesh.cc
1 #include "opengl.h"
2 #include "objmesh.h"
3 #include "snode.h"
4
5 ObjMesh::ObjMesh()
6 {
7         mesh = 0;
8 }
9
10 ObjType ObjMesh::get_type() const
11 {
12         return OBJ_MESH;
13 }
14
15 void ObjMesh::draw() const
16 {
17         if(!mesh) return;
18
19         mtl.setup();
20
21         if(node) {
22                 glMatrixMode(GL_MODELVIEW);
23                 glPushMatrix();
24                 glMultMatrixf(node->get_matrix()[0]);
25         }
26
27         mesh->draw();
28
29         if(node) {
30                 glMatrixMode(GL_MODELVIEW);
31                 glPopMatrix();
32         }
33 }