API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

I

interfaceOccluderSink

@codexo/exojs-lighting / lighting / stable

Where an OccluderSource writes what blocks light. The main channel is line segments in world space: an occluder has no thickness, no interior and no material, and what a shadow needs to know about a wall is where its edges are. A source whose silhouette is really a picture may offer the drawable itself instead - see addDrawable.

0
props
3
methods
0
events
Import
import { OccluderSink } from '@codexo/exojs-lighting'

Where an OccluderSource writes what blocks light.

The main channel is line segments in world space: an occluder has no thickness, no interior and no material, and what a shadow needs to know about a wall is where its edges are. A source whose silhouette is really a picture may offer the drawable itself instead - see addDrawable.

Methods3
Offer a drawable whose silhouette is its own alpha, and report whether the field took it. false means this field turns occluders into geometry and the source must describe the same shape as segments instead - which is the answer wherever shadows are built on the CPU, so a source that can only do one of the two still works everywhere. Where it is taken, the drawable is rasterised at its own place in the world each frame. That is what makes an animation, a video or a render target cast a correct shadow without a trace, a cache or a warning, and it is why the offer comes first and the geometry second.
addPolyline(points: ArrayLike<number>, closed: boolean): void
Append a polyline given as [x0, y0, x1, y1, ...] in world space. With closed, the last point is joined back to the first, which is how a polygon outline is written. Fewer than two points contribute nothing.
addSegment(x1: number, y1: number, x2: number, y2: number): void
Append one segment from (x1, y1) to (x2, y2), in world space.
Source