Added support for ReferenceFrame into osg::LightSource, modified the .osg

plugin and cull visitor to account for this change.
This commit is contained in:
Robert Osfield
2003-01-16 16:37:24 +00:00
parent a0e5b9b007
commit 4dd273de70
7 changed files with 118 additions and 31 deletions

View File

@@ -347,11 +347,19 @@ void CullVisitor::apply(LightSource& node)
StateSet* node_state = node.getStateSet();
if (node_state) pushStateSet(node_state);
RefMatrix& matrix = getModelViewMatrix();
StateAttribute* light = node.getLight();
if (light)
{
addPositionedAttribute(&matrix,light);
if (node.getReferenceFrame()==osg::LightSource::RELATIVE_TO_PARENTS)
{
RefMatrix& matrix = getModelViewMatrix();
addPositionedAttribute(&matrix,light);
}
else
{
// relative to absolute.
addPositionedAttribute(0,light);
}
}
handle_cull_callbacks_and_traverse(node);