]> git.tdb.fi Git - libs/gl.git/blobdiff - source/object.cpp
Store a Transform in keyframes instead of a Matrix
[libs/gl.git] / source / object.cpp
index a27553a6236e029c27cfe547304b00e84371f5e5..1852f91b50222ead401dfa177605c31d9d1ee21b 100644 (file)
@@ -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);