// SSCVisionMap implements symmetric shadow casting algorithm based on
// algorithm described there:
//
// 	https://www.albertford.com/shadowcasting/
//
// It returns a cached slice of visible points. Visibility of positions can
// also be checked with the Visible method.  Contrary to VisionMap and
// LightMap, this algorithm can have some discontinuous rays.
SSCVisionMap implements symmetric shadow casting algorithm based on
algorithm described there.



It returns a cached slice of visible points. Visibility of positions can
also be checked with the Visible method.  Contrary to VisionMap and
LightMap, this algorithm can have some discontinuous rays.
// SSCVisionMap implements symmetric shadow casting algorithm based on // algorithm described there : // // https : // www . albertford . com / shadowcasting / // // It returns a cached slice of visible points . Visibility of positions can // also be checked with the Visible method . Contrary to VisionMap and // LightMap this algorithm can have some discontinuous rays .
func (fov *FOV) SSCVisionMap(src gruid.Point, maxDepth int, passable func(p gruid.Point) bool, diags bool) []gruid.Point {
	if !src.In(fov.Rg) {
		return nil
	}
	if fov.ShadowCasting == nil {
		fov.ShadowCasting = make([]bool, fov.Capacity)
	}
	for i := range fov.ShadowCasting {
		fov.ShadowCasting[i] = false
	}
	fov.passable = passable
	fov.Visibles = fov.Visibles[:0]
	fov.sscVisionMap(src, maxDepth, diags)
	return fov.Visibles
}
func ( fov * FOV ) SSCVisionMap ( src gruid . Point , maxDepth int , passable func ( p gruid . Point ) bool , diags bool ) [ ] gruid . Point { if ! src . In ( fov . Rg ) { return nil } if fov . ShadowCasting == nil { fov . ShadowCasting = make ( [ ] bool , fov . Capacity ) } for i := range fov . ShadowCasting { fov . ShadowCasting [ i ] = false } fov . passable = passable fov . Visibles = fov . Visibles [ : 0 ] fov . sscVisionMap ( src , maxDepth , diags ) return fov . Visibles }
SSCVisionMap implements symmetric shadow casting algorithm based on
algorithm described there.
SSCVisionMap implements symmetric shadow casting algorithm based on algorithm described there .