-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathTexCoord.d.ts
53 lines (53 loc) · 1.81 KB
/
TexCoord.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { mat3, vec2 } from "gl-matrix";
import Chunk from "./Chunk";
import ChunksSlots from "./ChunksSlots";
declare type TRSOpts = {
translation?: [number, number];
rotation?: number;
scale?: number;
};
declare class TexCoordTransform {
readonly buffer: Float32Array;
readonly translation: vec2;
readonly scale: vec2;
readonly rotation: Float32Array;
decomposeMatrix(m: mat3): void;
composeMat2(): Float32Array;
getTransformHash(): number;
}
declare abstract class TexCoord extends Chunk {
static create(attrib?: string): StaticTexCoord;
static createTransformed(attrib?: string, matrix?: mat3): StaticTexCoord;
static createFromTRS(attrib?: string, trsOpt?: TRSOpts): StaticTexCoord;
static createTransformedDynamic(attrib?: string): DynamicTexCoord;
readonly _transform: TexCoordTransform;
readonly attrib: string;
protected _uid: string;
constructor(attrib: string | undefined, hasSetup: boolean);
abstract varying(): string;
abstract getTransformCode(): string;
_genCode(slots: ChunksSlots): void;
}
export declare class DynamicTexCoord extends TexCoord {
private readonly _translateInput;
private readonly _rotateScalesInput;
private readonly _translateUniform;
private readonly _rotationScaleUniform;
private static _UID;
constructor(attrib?: string);
varying(): string;
getTransformCode(): string;
translate(x: number, y: number): this;
rotate(rad: number): this;
scale(x: number, y?: number): this;
setMatrix(m: mat3): void;
updateTransform(): void;
}
export declare class StaticTexCoord extends TexCoord {
private _translateConst?;
private _rotateScalesConst?;
constructor(attrib: string | undefined, matrix: mat3);
varying(): string;
getTransformCode(): string;
}
export default TexCoord;