UNPKG

1.87 kBTypeScriptView Raw
1/// <reference types="gl-matrix" />
2/// <reference types="gl-matrix" />
3import { Vector3, Vector, Options3D, Transformation3D } from './type';
4export declare class Coordinate3D {
5 private output;
6 private input;
7 private options;
8 private transformers;
9 /**
10 * Create a new Coordinate Object.
11 * @param options Custom options
12 */
13 constructor(options?: Partial<Options3D>);
14 /**
15 * Update options and inner state.
16 * @param options Options to be updated
17 */
18 update(options: Partial<Options3D>): void;
19 /**
20 * Returns a new Coordinate with same options.
21 * @returns Coordinate
22 */
23 clone(): Coordinate3D;
24 /**
25 * Returns current options.
26 * @returns options
27 */
28 getOptions(): Options3D;
29 /**
30 * Clear transformations and update.
31 */
32 clear(): void;
33 /**
34 * Returns the size of the bounding box of the coordinate.
35 * @returns [width, height, depth]
36 */
37 getSize(): [number, number, number];
38 /**
39 * Returns the center of the bounding box of the coordinate.
40 * @returns [centerX, centerY, centerZ]
41 */
42 getCenter(): [number, number, number];
43 /**
44 * Add selected transformation.
45 * @param args transform type and params
46 * @returns Coordinate
47 */
48 transform(...args: Transformation3D): this;
49 /**
50 * Apples transformations for the current vector.
51 * @param vector original vector3
52 * @returns transformed vector3
53 */
54 map(vector: Vector3 | Vector): import("gl-matrix").vec3 | Vector;
55 /**
56 * Apples invert transformations for the current vector.
57 * @param vector transformed vector3
58 * @param vector original vector3
59 */
60 invert(vector: Vector3 | Vector): import("gl-matrix").vec3 | Vector;
61 private recoordinate;
62 private compose;
63 private createMatrixTransform;
64}