X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fobject.cpp;h=1852f91b50222ead401dfa177605c31d9d1ee21b;hp=a27553a6236e029c27cfe547304b00e84371f5e5;hb=71240e5c5ef7165313664ee9fe81df95c0eff10b;hpb=7da609f539040d11cccc61b838f4b74e06135552 diff --git a/source/object.cpp b/source/object.cpp index a27553a6..1852f91b 100644 --- a/source/object.cpp +++ b/source/object.cpp @@ -17,6 +17,8 @@ using namespace std; namespace Msp { namespace GL { +Matrix Object::identity_matrix; + Object::Object(): lods(1), lod0_watched(false) @@ -30,6 +32,8 @@ Object::Object(const Mesh *m, const Technique *t): set_technique(t); } +// TODO should have copy-c'tor to set watch on lod0 mesh if necessary + Object::~Object() { if(lods[0].mesh && lod0_watched) @@ -130,21 +134,6 @@ const Technique *Object::get_technique(unsigned i) const return lods[i].technique.get(); } -void Object::render(const Tag &tag) const -{ - const RenderPass *pass = get_pass(tag, 0); - if(!pass) - return; - - Bind bind_shader(pass->get_shader_program()); - if(pass->get_shader_data()) - pass->get_shader_data()->apply(); - Bind bind_material(pass->get_material()); - Bind bind_texturing(pass->get_texturing()); - - lods.front().mesh->draw(); -} - void Object::render(Renderer &renderer, const Tag &tag) const { const RenderPass *pass = get_pass(tag, 0);