eqemu

annotate src/object.cc @ 4:3d3656360a82

rendering properly, added picking, almost done...
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 17 Jul 2014 08:51:17 +0300
parents f9274bebe55e
children 2656099aff12
rev   line source
nuclear@3 1 #include "object.h"
nuclear@3 2
nuclear@3 3 Object::Object()
nuclear@3 4 {
nuclear@3 5 mesh = 0;
nuclear@3 6 }
nuclear@3 7
nuclear@4 8 void Object::set_name(const char *name)
nuclear@4 9 {
nuclear@4 10 this->name = std::string(name);
nuclear@4 11 }
nuclear@4 12
nuclear@4 13 const char *Object::get_name() const
nuclear@4 14 {
nuclear@4 15 return name.c_str();
nuclear@4 16 }
nuclear@4 17
nuclear@3 18 void Object::set_mesh(Mesh *mesh)
nuclear@3 19 {
nuclear@3 20 this->mesh = mesh;
nuclear@3 21 }
nuclear@3 22
nuclear@3 23 Mesh *Object::get_mesh() const
nuclear@3 24 {
nuclear@3 25 return mesh;
nuclear@3 26 }
nuclear@3 27
nuclear@3 28 void Object::render() const
nuclear@3 29 {
nuclear@3 30 if(!mesh) return;
nuclear@3 31
nuclear@3 32 mtl.setup();
nuclear@3 33 mesh->draw();
nuclear@3 34 }