UNPKG

@ue-too/board

Version:
72 lines (71 loc) 2.09 kB
import { Point } from "@ue-too/math"; /** * @description The boundaries of a camera. * The x and y are in world space. * * @category Camera */ export type Boundaries = { min?: { x?: number; y?: number; }; max?: { x?: number; y?: number; }; }; /** * @description Checks if a point is within the boundaries. * * @category Camera */ export declare function withinBoundaries(point: Point, boundaries: Boundaries | undefined): boolean; /** * @description Checks if the boundaries are valid. * * @category Camera */ export declare function isValidBoundaries(boundaries: Boundaries | undefined): boolean; /** * @description Checks if the boundaries are fully defined. * * @category Camera */ export declare function boundariesFullyDefined(boundaries: Boundaries | undefined): boolean; /** * @description Clamps a point to the boundaries. * * @category Camera */ export declare function clampPoint(point: Point, boundaries: Boundaries | undefined): Point; /** * @description Gets the translation width of the boundaries. * * @category Camera */ export declare function translationWidthOf(boundaries: Boundaries | undefined): number | undefined; /** * @description Gets the half translation width of the boundaries. * * @category Camera */ export declare function halfTranslationWidthOf(boundaries: Boundaries): number | undefined; /** * @description Gets the translation height of the boundaries. * * @category Camera */ export declare function translationHeightOf(boundaries: Boundaries | undefined): number | undefined; /** * @description Gets the half translation height of the boundaries. * * @category Camera */ export declare function halfTranslationHeightOf(boundaries: Boundaries): number | undefined; /** * @description Clamps the entire viewport within the boundaries * * @category Camera */ export declare function clampPointEntireViewPort(point: Point, viewPortWidth: number, viewPortHeight: number, boundaries: Boundaries | undefined, cameraZoomLevel: number, cameraRotation: number): Point;