animation = new NullAnimation();
} else if (!strcmp("range", type)) {
animation = new RangeAnimation();
+ } else if (!strcmp("billboard", type)) {
+ animation = new BillboardAnimation();
} else if (!strcmp("select", type)) {
animation = new SelectAnimation();
} else if (!strcmp("spin", type)) {
}
+\f
+////////////////////////////////////////////////////////////////////////
+// Implementation of FG3DModel::BillboardAnimation
+////////////////////////////////////////////////////////////////////////
+
+FG3DModel::BillboardAnimation::BillboardAnimation ()
+ : _branch(0)
+{
+ // Note: we cannot allocate the branch until we know whether
+ // it can rotate around the x axis as well as the z axis.
+}
+
+FG3DModel::BillboardAnimation::~BillboardAnimation ()
+{
+ _branch = 0;
+}
+
+void
+FG3DModel::BillboardAnimation::init (ssgEntity * object,
+ SGPropertyNode * props)
+{
+ _branch = new ssgCutout(props->getBoolValue("spherical", true));
+ splice_branch(_branch, object);
+ _branch->setName(props->getStringValue("name", 0));
+}
+
+void
+FG3DModel::BillboardAnimation::update (int dt)
+{
+}
+
+
\f
////////////////////////////////////////////////////////////////////////
// Implementation of FG3DModel::SelectAnimation
// Don't pull in the headers, since we don't need them here.
class ssgBranch;
+class ssgCutout;
class ssgEntity;
class ssgRangeSelector;
class ssgSelector;
};
+ /**
+ * Animation to turn and face the screen.
+ */
+ class BillboardAnimation : public Animation
+ {
+ public:
+ BillboardAnimation ();
+ virtual ~BillboardAnimation ();
+ virtual void init (ssgEntity * object, SGPropertyNode * props);
+ virtual void update (int dt);
+ private:
+ ssgCutout * _branch;
+ };
+
+
/**
* Animation to select alternative versions of the same object.
*/
ssgTransform * _transform;
};
+
};
#endif // __MODEL_HXX