import { Light, DebugDrawPolygon } from "./Light"; import type { RayHandler } from "../RayHandler"; import { RGBA } from "../utils"; import { XY, Vector2 } from "../math"; /** * Abstract base class for all positional lights * *
Extends {@link Light} * * @author kalle_h */ export declare abstract class PositionalLight extends Light { protected readonly tmpEnd: Vector2; protected readonly start: Vector2; protected body: any; protected bodyOffsetX: number; protected bodyOffsetY: number; protected bodyAngleOffset: number; protected sin: number[]; protected cos: number[]; protected endX: number[]; protected endY: number[]; /** * Creates new positional light and automatically adds it to the specified * {@link RayHandler} instance. * * @param rayHandler * not 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 * light color * @param distance * light distance (if applicable) * @param x * horizontal position in world coordinates * @param y * vertical position in world coordinates * @param directionDegree * direction in degrees (if applicable) */ constructor(rayHandler: RayHandler, rays: number, color: RGBA, distance: number, x: number, y: number, directionDegree: number); getSoftShadowVertexCount(): 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 offset and direction * * @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 offsetX * horizontal relative offset in world coordinates * @param offsetY * vertical relative offset in world coordinates * @param degrees * directional relative offset in degrees */ attachToBody(body: any, offsetX?: number, offsetY?: number, degrees?: number): void; getPosition(): Vector2; getBody(): any; /** * @returns Horizontal starting position of light in world coordinates */ getX(): number; /** * @returns Vertical starting position of light in world coordinates */ getY(): number; setPosition(x: number, y: number): void; setPositionV(position: XY): void; contains(x: number, y: number): boolean; protected setRayNum(rays: number, updateMesh?: boolean): void; protected cull(): boolean; protected updateBody(): void; protected updateMesh(): void; protected setMesh(): void; getBodyOffsetX(): number; getBodyOffsetY(): number; getBodyAngleOffset(): number; setBodyOffsetX(bodyOffsetX: number): void; setBodyOffsetY(bodyOffsetY: number): void; setBodyAngleOffset(bodyAngleOffset: number): void; } //# sourceMappingURL=PositionalLight.d.ts.map