]> git.tdb.fi Git - libs/gl.git/blobdiff - source/lightunit.cpp
Better state tracking for bound objects
[libs/gl.git] / source / lightunit.cpp
index 58d42e6d730f893d3370532e2b84e993dc89221e..d33c9b25a12ef5cc50e8c53b0e2875981d3568ff 100644 (file)
@@ -44,5 +44,13 @@ LightUnit &LightUnit::get_unit(unsigned n)
        return units[n];
 }
 
+LightUnit *LightUnit::find_unit(const Light *l)
+{
+       for(vector<LightUnit>::iterator i=units.begin(); i!=units.end(); ++i)
+               if(i->light==l)
+                       return &*i;
+       return 0;
+}
+
 } // namespace GL
 } // namespace Msp