59 lines
1.6 KiB
TypeScript
59 lines
1.6 KiB
TypeScript
import * as THREE from "three";
|
|
export declare class ThreeBSP {
|
|
tree: Node;
|
|
matrix: THREE.Matrix4;
|
|
Node: typeof Node;
|
|
Vertex: typeof Vertex;
|
|
Polygon: typeof Polygon;
|
|
constructor(geometry: any);
|
|
subtract(other_tree: any): ThreeBSP;
|
|
union(other_tree: any): ThreeBSP;
|
|
intersect(other_tree: any): ThreeBSP;
|
|
toGeometry(): THREE.Geometry;
|
|
toMesh(material: any): THREE.Mesh;
|
|
}
|
|
export declare class Polygon {
|
|
w: any;
|
|
normal: any;
|
|
vertices: any;
|
|
constructor(vertices?: any, normal?: any, w?: any);
|
|
calculateProperties(): this;
|
|
clone(): Polygon;
|
|
flip(): this;
|
|
classifyVertex(vertex: any): 1 | 2 | 0;
|
|
classifySide(polygon: any): 1 | 3 | 2 | 0;
|
|
splitPolygon(polygon: any, coplanar_front: any, coplanar_back: any, front: any, back: any): void;
|
|
}
|
|
export declare class Vertex {
|
|
uv: any;
|
|
normal: any;
|
|
z: any;
|
|
y: any;
|
|
x: any;
|
|
constructor(x: number, y: number, z: number, normal: THREE.Vector3, uv: THREE.Vector2);
|
|
clone(): Vertex;
|
|
add(vertex: any): this;
|
|
subtract(vertex: any): this;
|
|
multiplyScalar(scalar: any): this;
|
|
cross(vertex: any): this;
|
|
normalize(): this;
|
|
dot(vertex: any): number;
|
|
lerp(a: any, t: any): this;
|
|
interpolate(other: any, t: any): Vertex;
|
|
applyMatrix4(m: any): this;
|
|
}
|
|
export declare class Node {
|
|
divider: any;
|
|
back: any;
|
|
front: any;
|
|
polygons: any[];
|
|
constructor(polygons?: any);
|
|
isConvex(polygons: any): boolean;
|
|
build(polygons: any): void;
|
|
allPolygons(): any[];
|
|
clone(): Node;
|
|
invert(): this;
|
|
clipPolygons(polygons: any): any;
|
|
clipTo(node: any): void;
|
|
}
|