import { Light, DebugDrawPolygon } from "./Light"; import type { RayHandler } from "../RayHandler"; import { Rectangle, Matrix3, Vector2, XY } from "../math"; import { RGBA } from "../utils"; /** * A light whose ray starting points are evenly distributed along a chain of * vertices * *

Extends {@link Light} * * @author spruce */ export declare class ChainLight extends Light { static defaultRayStartOffset: number; rayStartOffset: number; readonly chain: number[]; protected rayDirection: number; protected bodyAngle: number; protected bodyAngleOffset: number; protected body: any; protected readonly segmentAngles: number[]; protected readonly segmentLengths: number[]; protected readonly startX: number[]; protected readonly startY: number[]; protected readonly endX: number[]; protected readonly endY: number[]; protected readonly bodyPosition: Vector2; protected readonly tmpEnd: Vector2; protected readonly tmpStart: Vector2; protected readonly tmpPerp: Vector2; protected readonly tmpVec: Vector2; protected readonly zeroPosition: Matrix3; protected readonly rotateAroundZero: Matrix3; protected readonly restorePosition: Matrix3; protected readonly chainLightBounds: Rectangle; protected readonly rayHandlerBounds: Rectangle; /** * Creates chain light from specified vertices * * @param rayHandler * not {@code null} instance of RayHandler * @param rays * number of rays - more rays make light to look more realistic * but will decrease performance, can't be less than MIN_RAYS * @param color * color, set to {@code null} to use the default color * @param distance * distance of light * @param rayDirection * direction of rays *

* @param chain * array: number of (x, y) vertices from which rays will be * evenly distributed */ constructor(rayHandler: RayHandler, rays: number, color: RGBA, distance: number, rayDirection: number, chain?: number[]); update(): void; render(): void; /** * Draws a polygon, using ray start and end points as vertices */ debugRender(drawPolygon: DebugDrawPolygon): void; /** * Attaches light to specified body with relative direction offset * * @param body * that will be automatically followed, note that the body * rotation angle is taken into account for the light offset * and direction calculations * @param degrees * directional relative offset in degrees */ attachToBody(body: any, degrees?: number): void; getBody(): any; getX(): number; getY(): number; setPosition(x: number, y: number): void; setPositionV(position: XY): void; contains(x: number, y: number): boolean; /** * Sets light distance * *

MIN value capped to 0.1 meter *

Actual recalculations will be done only on {@link #update()} call */ setDistance(dist: number): void; /** Not applicable for this light type */ setDirection(_directionDegree: number): void; /** * Calculates ray positions and angles along chain. This should be called * any time the number or values of elements changes in {@link #chain}. */ updateChain(): void; /** * Applies attached body initial transform to all lights rays */ applyAttachment(): void; protected cull(): boolean; updateBody(): void; protected updateMesh(): void; protected setMesh(): void; /** Internal method for bounding rectangle recalculation */ protected updateBoundingRects(): void; } //# sourceMappingURL=ChainLight.d.ts.map