Working 'noshadow' animation
This commit is contained in:
@@ -378,7 +378,6 @@ SGAnimation::SGAnimation(const SGPropertyNode* configNode,
|
|||||||
{
|
{
|
||||||
_name = configNode->getStringValue("name", "");
|
_name = configNode->getStringValue("name", "");
|
||||||
_enableHOT = configNode->getBoolValue("enable-hot", true);
|
_enableHOT = configNode->getBoolValue("enable-hot", true);
|
||||||
_disableShadow = configNode->getBoolValue("disable-shadow", false);
|
|
||||||
std::vector<SGPropertyNode_ptr> objectNames =
|
std::vector<SGPropertyNode_ptr> objectNames =
|
||||||
configNode->getChildren("object-name");
|
configNode->getChildren("object-name");
|
||||||
for (unsigned i = 0; i < objectNames.size(); ++i)
|
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());
|
node.setNodeMask( SG_NODEMASK_TERRAIN_BIT | node.getNodeMask());
|
||||||
else
|
else
|
||||||
node.setNodeMask(~SG_NODEMASK_TERRAIN_BIT & node.getNodeMask());
|
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*
|
osg::Group*
|
||||||
@@ -1825,12 +1820,13 @@ osg::Group*
|
|||||||
SGShadowAnimation::createAnimationGroup(osg::Group& parent)
|
SGShadowAnimation::createAnimationGroup(osg::Group& parent)
|
||||||
{
|
{
|
||||||
SGSharedPtr<SGCondition const> condition = getCondition();
|
SGSharedPtr<SGCondition const> condition = getCondition();
|
||||||
if (!condition)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
osg::Group* group = new osg::Group;
|
osg::Group* group = new osg::Group;
|
||||||
group->setName("shadow animation");
|
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);
|
parent.addChild(group);
|
||||||
return group;
|
return group;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ private:
|
|||||||
std::list<std::string> _objectNames;
|
std::list<std::string> _objectNames;
|
||||||
std::list<osg::ref_ptr<osg::Node> > _installedAnimations;
|
std::list<osg::ref_ptr<osg::Node> > _installedAnimations;
|
||||||
bool _enableHOT;
|
bool _enableHOT;
|
||||||
bool _disableShadow;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user