rendered = true;
Vector4 lpos = light.get_position();
+
if(lpos.w)
{
/* XXX Not really proper way to support positional lights, but good
lpos.x -= target.x;
lpos.y -= target.y;
lpos.z -= target.z;
- float d = sqrt(lpos.x*lpos.x+lpos.y*lpos.y+lpos.z*lpos.z);
- lpos.x /= d;
- lpos.y /= d;
- lpos.z /= d;
}
+ float l = sqrt(lpos.x*lpos.x+lpos.y*lpos.y+lpos.z*lpos.z);
+ lpos.x /= l;
+ lpos.y /= l;
+ lpos.z /= l;
+
float matrix[16];
if(abs(lpos.z)>=abs(lpos.x) && abs(lpos.z)>=abs(lpos.y))
{