vrheights

annotate src/object.cc @ 8:3f221bdc9bab

mesh loading walk polys
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 03 Oct 2014 04:16:16 +0300
parents
children
rev   line source
nuclear@8 1 #include "object.h"
nuclear@8 2 #include "opengl.h"
nuclear@8 3
nuclear@8 4 Object::Object()
nuclear@8 5 {
nuclear@8 6 mesh = 0;
nuclear@8 7 }
nuclear@8 8
nuclear@8 9 void Object::set_mesh(Mesh *m)
nuclear@8 10 {
nuclear@8 11 mesh = m;
nuclear@8 12 }
nuclear@8 13
nuclear@8 14 void Object::draw() const
nuclear@8 15 {
nuclear@8 16 if(!mesh) return;
nuclear@8 17
nuclear@8 18 glMatrixMode(GL_MODELVIEW);
nuclear@8 19 glPushMatrix();
nuclear@8 20 glMultTransposeMatrixf(xform[0]);
nuclear@8 21
nuclear@8 22 mtl.setup();
nuclear@8 23 mesh->draw();
nuclear@8 24
nuclear@8 25 glPopMatrix();
nuclear@8 26 }