From: Frederic Bouvier Date: Sat, 30 Jun 2012 14:25:21 +0000 (+0200) Subject: Working 'noshadow' animation X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5af8bb7c8e259f5bdda67beb87adcc453e0b32e7;p=simgear.git Working 'noshadow' animation --- diff --git a/simgear/scene/model/animation.cxx b/simgear/scene/model/animation.cxx index 7e29d5fd..f8bfbcbd 100644 --- a/simgear/scene/model/animation.cxx +++ b/simgear/scene/model/animation.cxx @@ -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 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 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; } diff --git a/simgear/scene/model/animation.hxx b/simgear/scene/model/animation.hxx index 57641d30..fade108c 100644 --- a/simgear/scene/model/animation.hxx +++ b/simgear/scene/model/animation.hxx @@ -94,7 +94,6 @@ private: std::list _objectNames; std::list > _installedAnimations; bool _enableHOT; - bool _disableShadow; };