]> git.mxchange.org Git - flightgear.git/blobdiff - src/Model/model.cxx
Mac OS X fixes and MSVC warning fixes from Jonathan Polley.
[flightgear.git] / src / Model / model.cxx
index 01f0c2e8c826773fd861b6e0345f8ba70965a8f3..08738012846d94de4bfb247159129b1f5b25373e 100644 (file)
@@ -270,7 +270,7 @@ FG3DModel::update (int dt)
 bool
 FG3DModel::getVisible () const
 {
-  return _selector->getSelect();
+  return (_selector->getSelect() != 0);
 }
 
 void
@@ -342,6 +342,8 @@ FG3DModel::make_animation (const char * object_name,
     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)) {
@@ -448,6 +450,38 @@ FG3DModel::RangeAnimation::update (int dt)
 }
 
 
+\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