Changed the osg::LightSource so its Light attribute is now generalised to
be a StateAttribute. This allows alternative implementations of Lights other than the standard osg::Light.
This commit is contained in:
@@ -18,7 +18,7 @@ LightSource::~LightSource()
|
||||
}
|
||||
|
||||
|
||||
void LightSource::setLight(Light* light)
|
||||
void LightSource::setLight(StateAttribute* light)
|
||||
{
|
||||
_light = light;
|
||||
setLocalStateSetModes(_value);
|
||||
|
||||
@@ -27,9 +27,7 @@ bool LightSource_readLocalData(Object& obj, Input& fr)
|
||||
|
||||
LightSource& lightsource = static_cast<LightSource&>(obj);
|
||||
|
||||
static ref_ptr<Light> s_light = osgNew osg::Light;
|
||||
|
||||
Light* light = static_cast<Light*>(fr.readObjectOfType(*s_light));
|
||||
StateAttribute* light=fr.readStateAttribute();
|
||||
if (light)
|
||||
{
|
||||
lightsource.setLight(light);
|
||||
|
||||
@@ -383,7 +383,7 @@ void CullVisitor::apply(LightSource& node)
|
||||
if (node_state) pushStateSet(node_state);
|
||||
|
||||
Matrix& matrix = getModelViewMatrix();
|
||||
Light* light = node.getLight();
|
||||
StateAttribute* light = node.getLight();
|
||||
if (light)
|
||||
{
|
||||
addPositionedAttribute(&matrix,light);
|
||||
|
||||
Reference in New Issue
Block a user