#include "programdata.h"
#include "renderer.h"
#include "technique.h"
-#include "transform.h"
using namespace std;
AnimatedObject::Loader::Loader(AnimatedObject &o):
- DataFile::ObjectLoader<AnimatedObject>(o)
+ DataFile::DerivedObjectLoader<AnimatedObject, ObjectInstance::Loader>(o)
{
- add("transform", &Loader::transform);
-
- // Deprecated; Use the transform statement instead
+ // Deprecated; Use the transform statement defined in ObjectInstance instead
add("position", &Loader::position);
add("rotation", &Loader::rotation);
add("scale", &Loader::scale);
obj.matrix.scale(s);
}
-void AnimatedObject::Loader::transform()
-{
- Transform trn;
- load_sub(trn);
- obj.matrix = trn.to_matrix();
-}
-
} // namespace GL
} // namespace Msp
class AnimatedObject: public ObjectInstance
{
public:
- class Loader: public DataFile::ObjectLoader<AnimatedObject>
+ class Loader: public DataFile::DerivedObjectLoader<AnimatedObject, ObjectInstance::Loader>
{
public:
Loader(AnimatedObject &);
void rotation(float, float, float, float);
void scale(float, float, float);
void scale_uniform(float);
- void transform();
};
private:
#include "objectinstance.h"
#include "renderer.h"
+#include "transform.h"
using namespace std;
renderer.transform(matrix);
}
+
+ObjectInstance::Loader::Loader(ObjectInstance &o):
+ DataFile::ObjectLoader<ObjectInstance>(o)
+{
+ add("transform", &Loader::transform);
+}
+
+void ObjectInstance::Loader::transform()
+{
+ Transform trn;
+ load_sub(trn);
+ obj.matrix = trn.to_matrix();
+}
+
} // namespace GL
} // namespaec Msp
*/
class ObjectInstance: public PlacedRenderable
{
+public:
+ class Loader: public DataFile::ObjectLoader<ObjectInstance>
+ {
+ public:
+ Loader(ObjectInstance &);
+
+ private:
+ void transform();
+ };
+
protected:
const Object &object;