Fixed lighting
This commit is contained in:
@@ -337,7 +337,7 @@ func (s *System) IsPointInShadow(x, y float64, w *world.World) bool {
|
||||
if ix, iy, ok := intersection(rayToPoint, wall); ok {
|
||||
distanceToIntersection := math.Sqrt((ix-light.X)*(ix-light.X) + (iy-light.Y)*(iy-light.Y))
|
||||
|
||||
if distanceToIntersection < distanceToPoint-5.0 {
|
||||
if distanceToIntersection < distanceToPoint-10.0 {
|
||||
blocked = true
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user