@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
32 lines (31 loc) • 1.49 kB
TypeScript
import { TileConfig } from './WFCTileConfig';
import { QuadPrimitivePointPositions } from '../geometry/modules/quad/utils/QuadUtils';
export interface TileCorners extends QuadPrimitivePointPositions {
height: number;
}
export type WFCAllHorizontalSides = 'snwe';
export declare const WFC_ALL_HORIZONTAL_SIDES: WFCAllHorizontalSides;
export declare const ALL_HORIZONTAL_SIDES: WFCAllHorizontalSides;
export type WFCTileSide = 's' | 'n' | 'w' | 'e' | 'b' | 't' | WFCAllHorizontalSides;
export declare const ALL_SIDES: WFCTileSide[];
export interface WFCRule {
readonly id0: string;
readonly id1: string;
readonly side0: WFCTileSide;
readonly side1: WFCTileSide;
}
export declare const CLOCK_WISE_TILE_SIDES: WFCTileSide[];
export declare function rotatedSide(side: WFCTileSide, rotation: number): WFCTileSide;
export interface TileConfigStats {
solid: number;
empty: number;
}
export declare function configTilesStats(tileConfigs: TileConfig[], target: TileConfigStats): void;
export declare function solidTilesStats(tileConfigs: TileConfig[]): TileConfig[];
export interface SortedTileIds {
first: string;
second: string;
}
export declare function sortTileIds(id0: string, id1: string, target: SortedTileIds, invert?: boolean): void;
export declare function tileSideUnrotated(xOffset: number, yOffset: number, zOffset: number): WFCTileSide;
export declare function neighbourTileSideUnrotated(xOffset: number, yOffset: number, zOffset: number): WFCTileSide;