X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fobjectinstance.cpp;h=450c810646f23b5b8439de2e6275730432ea73e4;hp=e3bb8f80b0e60f62c45b3926428d258737e52c20;hb=553f3ec4fbe28a37978ee53b9b6e22fedb691e1d;hpb=f14435e58bfa0fa697a06ba9a454bb30cd37d9d8 diff --git a/source/objectinstance.cpp b/source/objectinstance.cpp index e3bb8f80..450c8106 100644 --- a/source/objectinstance.cpp +++ b/source/objectinstance.cpp @@ -1,6 +1,6 @@ -#include "object.h" #include "objectinstance.h" #include "renderer.h" +#include "transform.h" using namespace std; @@ -22,5 +22,24 @@ void ObjectInstance::render(Renderer &renderer, const Tag &tag) const object.render(renderer, *this, tag); } +void ObjectInstance::setup_render(Renderer &renderer, const Tag &) const +{ + renderer.transform(matrix); +} + + +ObjectInstance::Loader::Loader(ObjectInstance &o): + DataFile::ObjectLoader(o) +{ + add("transform", &Loader::transform); +} + +void ObjectInstance::Loader::transform() +{ + Transform trn; + load_sub(trn); + obj.matrix = trn.to_matrix(); +} + } // namespace GL } // namespaec Msp