nuclear@1: #include "object.h" nuclear@1: #include "opengl.h" nuclear@1: nuclear@1: Object::Object() nuclear@1: { nuclear@1: mesh = 0; nuclear@1: } nuclear@1: nuclear@1: Object::~Object() nuclear@1: { nuclear@1: delete mesh; nuclear@1: } nuclear@1: nuclear@1: Matrix4x4 &Object::xform() nuclear@1: { nuclear@1: return matrix; nuclear@1: } nuclear@1: nuclear@1: const Matrix4x4 &Object::xform() const nuclear@1: { nuclear@1: return matrix; nuclear@1: } nuclear@1: nuclear@1: void Object::set_mesh(Mesh *m) nuclear@1: { nuclear@1: this->mesh = m; nuclear@1: } nuclear@1: nuclear@1: Mesh *Object::get_mesh() const nuclear@1: { nuclear@1: return mesh; nuclear@1: } nuclear@1: nuclear@1: void Object::draw() const nuclear@1: { nuclear@1: if(!mesh) return; nuclear@1: nuclear@1: glMatrixMode(GL_MODELVIEW); nuclear@1: glPushMatrix(); nuclear@2: glMultTransposeMatrixf(matrix[0]); nuclear@1: nuclear@1: mesh->draw(); nuclear@1: nuclear@1: glPopMatrix(); nuclear@1: } nuclear@3: nuclear@3: bool Object::intersect(const Ray &ray, HitPoint *hit) const nuclear@3: { nuclear@3: return false; // TODO nuclear@3: }