OcclusionRaster

io.github.srs.model.illumination.raster.OcclusionRaster

Provide occlusion rasterization for Entity shapes.

Turns circles / rectangles into a discrete grid used for light blocking. Cells contain 0.0 (Cleared) or 1.0 (Occluded).

  • Sampling at the center of each cell: (x + 0.5, y + 0.5).
  • Coordinate scaling: world units * ScaleFactor => grid-space (pixels/cells).
  • All min/max index ranges are inclusive and clamped to grid bounds.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def combine(base: Grid[Double], overlay: Grid[Double]): Grid[Double]

Combine two occlusion grids (overlaying), keeping the maximum opacity per cell (union of blockers).

Combine two occlusion grids (overlaying), keeping the maximum opacity per cell (union of blockers).

Value parameters

base

The base occlusion grid

overlay

The overlay occlusion grid to combine

Attributes

Returns

A new grid with combined occlusion values

def rasterizeDynamics(env: Environment, dims: GridDims)(using ScaleFactor): Grid[Double]

Rasterize all dynamic entities.

Rasterize all dynamic entities.

Value parameters

dims

The dimensions of the target grid

env

The Environment containing all entities

Attributes

Returns

A grid where each cell contains the occlusion value for dynamic entities

def rasterizeStatics(env: Environment, dims: GridDims)(using ScaleFactor): Grid[Double]

Rasterize static occludes obstacles to an occlusion grid.

Rasterize static occludes obstacles to an occlusion grid.

Value parameters

dims

The dimensions of the target grid

env

The Environment containing all entities

Attributes

Returns

A grid where each cell contains the occlusion value (0.0 to 1.0)