vrheights

diff 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
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/object.cc	Fri Oct 03 04:16:16 2014 +0300
     1.3 @@ -0,0 +1,26 @@
     1.4 +#include "object.h"
     1.5 +#include "opengl.h"
     1.6 +
     1.7 +Object::Object()
     1.8 +{
     1.9 +	mesh = 0;
    1.10 +}
    1.11 +
    1.12 +void Object::set_mesh(Mesh *m)
    1.13 +{
    1.14 +	mesh = m;
    1.15 +}
    1.16 +
    1.17 +void Object::draw() const
    1.18 +{
    1.19 +	if(!mesh) return;
    1.20 +
    1.21 +	glMatrixMode(GL_MODELVIEW);
    1.22 +	glPushMatrix();
    1.23 +	glMultTransposeMatrixf(xform[0]);
    1.24 +
    1.25 +	mtl.setup();
    1.26 +	mesh->draw();
    1.27 +
    1.28 +	glPopMatrix();
    1.29 +}