]> git.mxchange.org Git - simgear.git/commitdiff
Working 'noshadow' animation
authorFrederic Bouvier <fredfgfs01@free.fr>
Sat, 30 Jun 2012 14:25:21 +0000 (16:25 +0200)
committerFrederic Bouvier <fredfgfs01@free.fr>
Sat, 30 Jun 2012 14:25:21 +0000 (16:25 +0200)
simgear/scene/model/animation.cxx
simgear/scene/model/animation.hxx

index 7e29d5fdd933bd8de626070b9fdd12ee5d8ec9f0..f8bfbcbdf1cf77807ccabb2c57cc40458b9ec68b 100644 (file)
@@ -378,7 +378,6 @@ SGAnimation::SGAnimation(const SGPropertyNode* configNode,
 {
   _name = configNode->getStringValue("name", "");
   _enableHOT = configNode->getBoolValue("enable-hot", true);
-  _disableShadow = configNode->getBoolValue("disable-shadow", false);
   std::vector<SGPropertyNode_ptr> objectNames =
     configNode->getChildren("object-name");
   for (unsigned i = 0; i < objectNames.size(); ++i)
@@ -501,10 +500,6 @@ SGAnimation::install(osg::Node& node)
     node.setNodeMask( SG_NODEMASK_TERRAIN_BIT | node.getNodeMask());
   else
     node.setNodeMask(~SG_NODEMASK_TERRAIN_BIT & node.getNodeMask());
-  if (!_disableShadow)
-    node.setNodeMask( SG_NODEMASK_CASTSHADOW_BIT | node.getNodeMask());
-  else
-    node.setNodeMask(~SG_NODEMASK_CASTSHADOW_BIT & node.getNodeMask());
 }
 
 osg::Group*
@@ -1825,12 +1820,13 @@ osg::Group*
 SGShadowAnimation::createAnimationGroup(osg::Group& parent)
 {
   SGSharedPtr<SGCondition const> condition = getCondition();
-  if (!condition)
-    return 0;
 
   osg::Group* group = new osg::Group;
   group->setName("shadow animation");
-  group->setUpdateCallback(new UpdateCallback(condition));
+  if (condition)
+    group->setUpdateCallback(new UpdateCallback(condition));
+  else
+    group->setNodeMask(~SG_NODEMASK_CASTSHADOW_BIT & group->getNodeMask());
   parent.addChild(group);
   return group;
 }
index 57641d308c1d7dea814c9fa4bb095fd91a510fb8..fade108c1e5be14f259c4b0e0976be679a0b2275 100644 (file)
@@ -94,7 +94,6 @@ private:
   std::list<std::string> _objectNames;
   std::list<osg::ref_ptr<osg::Node> > _installedAnimations;
   bool _enableHOT;
-  bool _disableShadow;
 };
 
 \f