Modified Files:

simgear/scene/util/SGNodeMasks.hxx
	simgear/scene/model/animation.cxx:
	More finegrained cull masks
This commit is contained in:
frohlich
2007-02-02 07:00:54 +00:00
parent 1445949e31
commit 1bb6c03bd0
2 changed files with 10 additions and 6 deletions
+4 -4
View File
@@ -551,9 +551,9 @@ SGAnimation::install(osg::Node& node)
else else
node.setNodeMask(~SG_NODEMASK_TERRAIN_BIT & node.getNodeMask()); node.setNodeMask(~SG_NODEMASK_TERRAIN_BIT & node.getNodeMask());
if (!_disableShadow) if (!_disableShadow)
node.setNodeMask( SG_NODEMASK_SHADOW_BIT | node.getNodeMask()); node.setNodeMask( SG_NODEMASK_CASTSHADOW_BIT | node.getNodeMask());
else else
node.setNodeMask(~SG_NODEMASK_SHADOW_BIT & node.getNodeMask()); node.setNodeMask(~SG_NODEMASK_CASTSHADOW_BIT & node.getNodeMask());
} }
osg::Group* osg::Group*
@@ -1841,9 +1841,9 @@ public:
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{ {
if (_condition->test()) if (_condition->test())
node->setNodeMask( SG_NODEMASK_SHADOW_BIT | node->getNodeMask()); node->setNodeMask( SG_NODEMASK_CASTSHADOW_BIT | node->getNodeMask());
else else
node->setNodeMask(~SG_NODEMASK_SHADOW_BIT & node->getNodeMask()); node->setNodeMask(~SG_NODEMASK_CASTSHADOW_BIT & node->getNodeMask());
traverse(node, nv); traverse(node, nv);
} }
+6 -2
View File
@@ -24,9 +24,13 @@
/// If set, do terrain elevation computations with that nodes /// If set, do terrain elevation computations with that nodes
#define SG_NODEMASK_TERRAIN_BIT (1<<0) #define SG_NODEMASK_TERRAIN_BIT (1<<0)
/// If set, this is the main model of this simulation
#define SG_NODEMASK_MAINMODEL_BIT (1<<1)
/// If set, cast shadows /// If set, cast shadows
#define SG_NODEMASK_SHADOW_BIT (1<<1) #define SG_NODEMASK_CASTSHADOW_BIT (1<<2)
/// If set, cast recieves shadows
#define SG_NODEMASK_RECIEVESHADOW_BIT (1<<3)
/// If set, the node is pickable /// If set, the node is pickable
#define SG_NODEMASK_PICK_BIT (1<<2) #define SG_NODEMASK_PICK_BIT (1<<4)
#endif #endif