orbix-engine 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/orbix.d.ts +1460 -0
- package/dist/orbix.esm.js +283 -0
- package/dist/orbix.js +61783 -0
- package/dist/orbix.min.js +3 -0
- package/package.json +43 -0
package/dist/orbix.d.ts
ADDED
|
@@ -0,0 +1,1460 @@
|
|
|
1
|
+
// Orbix Engine — TypeScript Definitions
|
|
2
|
+
// Built on Active Theory Hydra Framework
|
|
3
|
+
|
|
4
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
// Shared utility types
|
|
6
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
7
|
+
|
|
8
|
+
type RenderCallback = (time: number, dt: number) => void;
|
|
9
|
+
type EaseName = string; // e.g. 'easeOutCubic', 'linear', 'easeInOutQuad'
|
|
10
|
+
|
|
11
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
12
|
+
// Top-level Orbix namespace
|
|
13
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
14
|
+
|
|
15
|
+
declare namespace Orbix {
|
|
16
|
+
|
|
17
|
+
// ── VERSION ──────────────────────────────────────────────────────────────
|
|
18
|
+
const VERSION: string;
|
|
19
|
+
const ORIGINAL: string;
|
|
20
|
+
|
|
21
|
+
// ── BOOT HELPERS ─────────────────────────────────────────────────────────
|
|
22
|
+
function ready(): Promise<typeof Orbix>;
|
|
23
|
+
function check(): { supported: boolean; webgl: boolean; mobile: boolean; gpu: string; tier: string; reason?: string };
|
|
24
|
+
const supported: boolean;
|
|
25
|
+
|
|
26
|
+
// ── SCENE HELPERS ─────────────────────────────────────────────────────────
|
|
27
|
+
function createScene(options?: Record<string, any>): { scene: Scene; camera: PerspectiveCamera; nuke: Nuke; renderer: Renderer; element: HTMLCanvasElement };
|
|
28
|
+
function createShader(vertexName: string, fragmentName?: string, uniforms?: Record<string, any>): Shader;
|
|
29
|
+
function createPhysicalShader(uniforms?: Record<string, any>): Shader;
|
|
30
|
+
function loadGeometry(path: string): Promise<Geometry>;
|
|
31
|
+
function getTexture(path: string): Texture;
|
|
32
|
+
function getRepeatTexture(path: string): Texture;
|
|
33
|
+
function createFluid(options?: { simSize?: number; dyeSize?: number; rect?: any }): Fluid;
|
|
34
|
+
function createMouseFluid(): MouseFluid;
|
|
35
|
+
function createAntimatter(options?: Record<string, any>): Antimatter;
|
|
36
|
+
function createMeshBatch(): MeshBatch;
|
|
37
|
+
function createNukePass(shaderName: string, uniforms?: Record<string, any>): NukePass;
|
|
38
|
+
|
|
39
|
+
// ── RENDER HELPERS ────────────────────────────────────────────────────────
|
|
40
|
+
function onRender(callback: RenderCallback): { stop(): void };
|
|
41
|
+
|
|
42
|
+
// ── CLASS SYSTEM HELPERS ──────────────────────────────────────────────────
|
|
43
|
+
function define(name: string, constructor: Function): any;
|
|
44
|
+
function tween(obj: any, props: Record<string, any>, duration: number, ease?: EaseName, delay?: number): any;
|
|
45
|
+
|
|
46
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
47
|
+
// CORE FRAMEWORK
|
|
48
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
49
|
+
|
|
50
|
+
function Class(constructor: Function): void;
|
|
51
|
+
function Inherit(target: any, ...mixins: any[]): void;
|
|
52
|
+
|
|
53
|
+
class Component {
|
|
54
|
+
flag(name: string, value?: boolean): boolean;
|
|
55
|
+
on(event: string, callback: Function): this;
|
|
56
|
+
off(event: string, callback: Function): this;
|
|
57
|
+
dispatch(event: string, ...args: any[]): void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
class Element extends Component {
|
|
61
|
+
div: HTMLElement;
|
|
62
|
+
create(tag?: string, className?: string): void;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
class Model extends Component {
|
|
66
|
+
get(key: string): any;
|
|
67
|
+
set(key: string, value: any): void;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const Events: {
|
|
71
|
+
on(event: string, callback: Function, scope?: any): void;
|
|
72
|
+
off(event: string, callback: Function, scope?: any): void;
|
|
73
|
+
dispatch(event: string, ...args: any[]): void;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const Timer: {
|
|
77
|
+
create(callback: Function, time: number, ...args: any[]): number;
|
|
78
|
+
destroy(id: number): void;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const Hydra: {
|
|
82
|
+
LOCAL: boolean;
|
|
83
|
+
VERSION: string;
|
|
84
|
+
init(params: Record<string, any>): void;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const Global: { [key: string]: any };
|
|
88
|
+
const Utils: { [key: string]: any };
|
|
89
|
+
|
|
90
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
91
|
+
// STATE MANAGEMENT
|
|
92
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
93
|
+
|
|
94
|
+
const AppState: {
|
|
95
|
+
get(key: string): any;
|
|
96
|
+
set(key: string, value: any, scope?: any): void;
|
|
97
|
+
on(key: string, callback: Function, scope?: any): void;
|
|
98
|
+
createLocal(obj: object, nonReactive?: boolean): object;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
class DerivedState { constructor(state: any, deriveFunc: Function); }
|
|
102
|
+
class StateArray { constructor(initial?: any[]); push(item: any): void; remove(item: any): void; }
|
|
103
|
+
class StateComponent extends Component {}
|
|
104
|
+
class StateInitializer { constructor(config: object); }
|
|
105
|
+
class ViewState extends Component { constructor(config?: object); }
|
|
106
|
+
const Storage: { get(key: string): any; set(key: string, value: any): void; remove(key: string): void; };
|
|
107
|
+
const Data: { [key: string]: any };
|
|
108
|
+
|
|
109
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
110
|
+
// DATA STRUCTURES
|
|
111
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
112
|
+
|
|
113
|
+
class Gate { constructor(count: number, callback: Function); tick(): void; }
|
|
114
|
+
class LinkedList { add(item: any): void; remove(item: any): void; forEach(cb: Function): void; }
|
|
115
|
+
class ObjectPool { constructor(factory: Function, initialSize?: number); get(): any; release(item: any): void; }
|
|
116
|
+
class XComponent extends Component {}
|
|
117
|
+
|
|
118
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
119
|
+
// MATH
|
|
120
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
121
|
+
|
|
122
|
+
class Vector2 {
|
|
123
|
+
constructor(x?: number, y?: number);
|
|
124
|
+
x: number; y: number;
|
|
125
|
+
set(x: number, y: number): this;
|
|
126
|
+
copy(v: Vector2): this;
|
|
127
|
+
add(v: Vector2): this;
|
|
128
|
+
sub(v: Vector2): this;
|
|
129
|
+
multiply(v: Vector2): this;
|
|
130
|
+
multiplyScalar(s: number): this;
|
|
131
|
+
divideScalar(s: number): this;
|
|
132
|
+
length(): number;
|
|
133
|
+
lengthSq(): number;
|
|
134
|
+
normalize(): this;
|
|
135
|
+
lerp(v: Vector2, t: number): this;
|
|
136
|
+
dot(v: Vector2): number;
|
|
137
|
+
clone(): Vector2;
|
|
138
|
+
toArray(): [number, number];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
class Vector3 {
|
|
142
|
+
constructor(x?: number, y?: number, z?: number);
|
|
143
|
+
x: number; y: number; z: number;
|
|
144
|
+
set(x: number, y: number, z: number): this;
|
|
145
|
+
setScalar(s: number): this;
|
|
146
|
+
copy(v: Vector3): this;
|
|
147
|
+
add(v: Vector3): this;
|
|
148
|
+
addScaledVector(v: Vector3, s: number): this;
|
|
149
|
+
sub(v: Vector3): this;
|
|
150
|
+
multiply(v: Vector3): this;
|
|
151
|
+
multiplyScalar(s: number): this;
|
|
152
|
+
divideScalar(s: number): this;
|
|
153
|
+
cross(v: Vector3): this;
|
|
154
|
+
crossVectors(a: Vector3, b: Vector3): this;
|
|
155
|
+
dot(v: Vector3): number;
|
|
156
|
+
length(): number;
|
|
157
|
+
lengthSq(): number;
|
|
158
|
+
normalize(): this;
|
|
159
|
+
lerp(v: Vector3, t: number): this;
|
|
160
|
+
negate(): this;
|
|
161
|
+
applyMatrix4(m: Matrix4): this;
|
|
162
|
+
applyQuaternion(q: Quaternion): this;
|
|
163
|
+
distanceTo(v: Vector3): number;
|
|
164
|
+
clone(): Vector3;
|
|
165
|
+
toArray(): [number, number, number];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
class Vector4 {
|
|
169
|
+
constructor(x?: number, y?: number, z?: number, w?: number);
|
|
170
|
+
x: number; y: number; z: number; w: number;
|
|
171
|
+
set(x: number, y: number, z: number, w: number): this;
|
|
172
|
+
copy(v: Vector4): this;
|
|
173
|
+
clone(): Vector4;
|
|
174
|
+
toArray(): [number, number, number, number];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
class Matrix3 {
|
|
178
|
+
elements: Float32Array;
|
|
179
|
+
identity(): this;
|
|
180
|
+
copy(m: Matrix3): this;
|
|
181
|
+
multiply(m: Matrix3): this;
|
|
182
|
+
transpose(): this;
|
|
183
|
+
invert(): this;
|
|
184
|
+
clone(): Matrix3;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
class Matrix4 {
|
|
188
|
+
elements: Float32Array;
|
|
189
|
+
identity(): this;
|
|
190
|
+
copy(m: Matrix4): this;
|
|
191
|
+
multiply(m: Matrix4): this;
|
|
192
|
+
premultiply(m: Matrix4): this;
|
|
193
|
+
setPosition(v: Vector3): this;
|
|
194
|
+
makeTranslation(x: number, y: number, z: number): this;
|
|
195
|
+
makeRotationFromEuler(e: Euler): this;
|
|
196
|
+
makeRotationFromQuaternion(q: Quaternion): this;
|
|
197
|
+
makeScale(x: number, y: number, z: number): this;
|
|
198
|
+
compose(position: Vector3, quaternion: Quaternion, scale: Vector3): this;
|
|
199
|
+
decompose(position: Vector3, quaternion: Quaternion, scale: Vector3): this;
|
|
200
|
+
invert(): this;
|
|
201
|
+
transpose(): this;
|
|
202
|
+
lookAt(eye: Vector3, target: Vector3, up: Vector3): this;
|
|
203
|
+
clone(): Matrix4;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
class Quaternion {
|
|
207
|
+
constructor(x?: number, y?: number, z?: number, w?: number);
|
|
208
|
+
x: number; y: number; z: number; w: number;
|
|
209
|
+
set(x: number, y: number, z: number, w: number): this;
|
|
210
|
+
copy(q: Quaternion): this;
|
|
211
|
+
setFromEuler(e: Euler): this;
|
|
212
|
+
setFromAxisAngle(axis: Vector3, angle: number): this;
|
|
213
|
+
multiply(q: Quaternion): this;
|
|
214
|
+
slerp(q: Quaternion, t: number): this;
|
|
215
|
+
normalize(): this;
|
|
216
|
+
length(): number;
|
|
217
|
+
clone(): Quaternion;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
class Euler {
|
|
221
|
+
constructor(x?: number, y?: number, z?: number, order?: string);
|
|
222
|
+
x: number; y: number; z: number; order: string;
|
|
223
|
+
set(x: number, y: number, z: number, order?: string): this;
|
|
224
|
+
copy(e: Euler): this;
|
|
225
|
+
setFromQuaternion(q: Quaternion): this;
|
|
226
|
+
clone(): Euler;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
class Color {
|
|
230
|
+
constructor(r?: number, g?: number, b?: number);
|
|
231
|
+
r: number; g: number; b: number;
|
|
232
|
+
set(r: number, g: number, b: number): this;
|
|
233
|
+
setHex(hex: number): this;
|
|
234
|
+
setHSL(h: number, s: number, l: number): this;
|
|
235
|
+
lerp(c: Color, t: number): this;
|
|
236
|
+
clone(): Color;
|
|
237
|
+
toArray(): [number, number, number];
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
class Box3 {
|
|
241
|
+
min: Vector3; max: Vector3;
|
|
242
|
+
constructor(min?: Vector3, max?: Vector3);
|
|
243
|
+
set(min: Vector3, max: Vector3): this;
|
|
244
|
+
setFromObject(obj: Object3D): this;
|
|
245
|
+
getCenter(target: Vector3): Vector3;
|
|
246
|
+
getSize(target: Vector3): Vector3;
|
|
247
|
+
intersectsBox(b: Box3): boolean;
|
|
248
|
+
containsPoint(p: Vector3): boolean;
|
|
249
|
+
expandByPoint(p: Vector3): this;
|
|
250
|
+
clone(): Box3;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
class Sphere {
|
|
254
|
+
center: Vector3; radius: number;
|
|
255
|
+
constructor(center?: Vector3, radius?: number);
|
|
256
|
+
intersectsSphere(s: Sphere): boolean;
|
|
257
|
+
containsPoint(p: Vector3): boolean;
|
|
258
|
+
clone(): Sphere;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
class Plane {
|
|
262
|
+
normal: Vector3; constant: number;
|
|
263
|
+
constructor(normal?: Vector3, constant?: number);
|
|
264
|
+
distanceToPoint(p: Vector3): number;
|
|
265
|
+
clone(): Plane;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
class Ray {
|
|
269
|
+
origin: Vector3; direction: Vector3;
|
|
270
|
+
constructor(origin?: Vector3, direction?: Vector3);
|
|
271
|
+
intersectBox(box: Box3, target: Vector3): Vector3 | null;
|
|
272
|
+
intersectPlane(plane: Plane, target: Vector3): Vector3 | null;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
class Frustum {
|
|
276
|
+
planes: Plane[];
|
|
277
|
+
setFromProjectionMatrix(m: Matrix4): this;
|
|
278
|
+
containsPoint(p: Vector3): boolean;
|
|
279
|
+
intersectsObject(obj: Object3D): boolean;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
class MathTween { constructor(from: number, to: number, duration: number, ease?: EaseName, callback?: Function); }
|
|
283
|
+
class MatrixWasm { static multiply(a: Matrix4, b: Matrix4): Matrix4; }
|
|
284
|
+
|
|
285
|
+
const MathUtils: {
|
|
286
|
+
radians(degrees: number): number;
|
|
287
|
+
degrees(radians: number): number;
|
|
288
|
+
lerp(a: number, b: number, t: number): number;
|
|
289
|
+
clamp(val: number, min: number, max: number): number;
|
|
290
|
+
range(val: number, inMin: number, inMax: number, outMin: number, outMax: number): number;
|
|
291
|
+
smoothStep(min: number, max: number, val: number): number;
|
|
292
|
+
randFloat(low: number, high: number): number;
|
|
293
|
+
randInt(low: number, high: number): number;
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
297
|
+
// 3D OBJECTS
|
|
298
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
299
|
+
|
|
300
|
+
class Object3D {
|
|
301
|
+
position: Vector3;
|
|
302
|
+
rotation: Euler;
|
|
303
|
+
quaternion: Quaternion;
|
|
304
|
+
scale: Vector3;
|
|
305
|
+
matrix: Matrix4;
|
|
306
|
+
matrixWorld: Matrix4;
|
|
307
|
+
visible: boolean;
|
|
308
|
+
castShadow: boolean;
|
|
309
|
+
receiveShadow: boolean;
|
|
310
|
+
frustumCulled: boolean;
|
|
311
|
+
renderOrder: number;
|
|
312
|
+
name: string;
|
|
313
|
+
parent: Object3D | null;
|
|
314
|
+
children: Object3D[];
|
|
315
|
+
userData: Record<string, any>;
|
|
316
|
+
add(...children: Object3D[]): this;
|
|
317
|
+
remove(...children: Object3D[]): this;
|
|
318
|
+
traverse(callback: (obj: Object3D) => void): void;
|
|
319
|
+
updateMatrix(): void;
|
|
320
|
+
updateMatrixWorld(force?: boolean): void;
|
|
321
|
+
lookAt(v: Vector3): void;
|
|
322
|
+
clone(recursive?: boolean): this;
|
|
323
|
+
dispose(): void;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
class Base3D extends Object3D {}
|
|
327
|
+
class Group extends Object3D {}
|
|
328
|
+
class Scene extends Object3D {
|
|
329
|
+
background: Color | Texture | null;
|
|
330
|
+
fog: any;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
class Mesh extends Object3D {
|
|
334
|
+
constructor(geometry: Geometry, shader: Shader | any);
|
|
335
|
+
geometry: Geometry;
|
|
336
|
+
shader: Shader;
|
|
337
|
+
drawMode: number;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
class Points extends Object3D {
|
|
341
|
+
constructor(geometry: Geometry, shader: Shader | any);
|
|
342
|
+
geometry: Geometry;
|
|
343
|
+
shader: Shader;
|
|
344
|
+
pointSize: number;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
class Line3D extends Object3D {
|
|
348
|
+
constructor(geometry: Geometry, shader: Shader | any);
|
|
349
|
+
geometry: Geometry;
|
|
350
|
+
shader: Shader;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
354
|
+
// GEOMETRY
|
|
355
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
356
|
+
|
|
357
|
+
class GeometryAttribute {
|
|
358
|
+
constructor(data: Float32Array | number[], itemSize: number);
|
|
359
|
+
array: Float32Array;
|
|
360
|
+
itemSize: number;
|
|
361
|
+
count: number;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
class Geometry {
|
|
365
|
+
attributes: Record<string, GeometryAttribute>;
|
|
366
|
+
index: GeometryAttribute | null;
|
|
367
|
+
addAttribute(name: string, attribute: GeometryAttribute): void;
|
|
368
|
+
setIndex(data: number[] | Uint16Array): void;
|
|
369
|
+
computeVertexNormals(): void;
|
|
370
|
+
computeBoundingBox(): void;
|
|
371
|
+
computeBoundingSphere(): void;
|
|
372
|
+
boundingBox: Box3;
|
|
373
|
+
boundingSphere: Sphere;
|
|
374
|
+
dispose(): void;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
class PlaneGeometry extends Geometry {
|
|
378
|
+
constructor(width?: number, height?: number, widthSegs?: number, heightSegs?: number);
|
|
379
|
+
}
|
|
380
|
+
class BoxGeometry extends Geometry {
|
|
381
|
+
constructor(width?: number, height?: number, depth?: number, wSegs?: number, hSegs?: number, dSegs?: number);
|
|
382
|
+
}
|
|
383
|
+
class SphereGeometry extends Geometry {
|
|
384
|
+
constructor(radius?: number, widthSegs?: number, heightSegs?: number, phiStart?: number, phiLength?: number, thetaStart?: number, thetaLength?: number);
|
|
385
|
+
}
|
|
386
|
+
class CylinderGeometry extends Geometry {
|
|
387
|
+
constructor(radiusTop?: number, radiusBottom?: number, height?: number, radialSegs?: number, heightSegs?: number, openEnded?: boolean);
|
|
388
|
+
}
|
|
389
|
+
class IcosahedronGeometry extends Geometry {
|
|
390
|
+
constructor(radius?: number, detail?: number);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
const GeomThread: {
|
|
394
|
+
loadGeometry(path: string): Promise<Geometry>;
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
const DracoThread: {
|
|
398
|
+
decode(buffer: ArrayBuffer): Promise<Geometry>;
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
class GLTFLoader {
|
|
402
|
+
constructor();
|
|
403
|
+
load(path: string, onLoad: (gltf: any) => void, onProgress?: Function, onError?: Function): void;
|
|
404
|
+
parse(data: ArrayBuffer, path: string, onLoad: Function, onError?: Function): void;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
class SplineGen {
|
|
408
|
+
constructor(points: Vector3[], closed?: boolean);
|
|
409
|
+
getPoint(t: number): Vector3;
|
|
410
|
+
getPoints(divisions: number): Vector3[];
|
|
411
|
+
getTangent(t: number): Vector3;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
class SplineLoader {
|
|
415
|
+
static load(path: string): Promise<SplineGen>;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
419
|
+
// SHADERS & MATERIALS
|
|
420
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
421
|
+
|
|
422
|
+
class Shader {
|
|
423
|
+
constructor(name: string, options?: Record<string, any>);
|
|
424
|
+
uniforms: Record<string, { value: any }>;
|
|
425
|
+
name: string;
|
|
426
|
+
clone(): Shader;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
const Shaders: {
|
|
430
|
+
[name: string]: string;
|
|
431
|
+
ready(): Promise<void>;
|
|
432
|
+
parse(code: string, file: string): void;
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
const ShaderChunk: { [name: string]: string };
|
|
436
|
+
|
|
437
|
+
class ShaderVariants {
|
|
438
|
+
constructor(shaderName: string, variants: Record<string, any>);
|
|
439
|
+
use(variantKey: string): Shader;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
class PBRShader extends Shader {
|
|
443
|
+
constructor(options?: Record<string, any>);
|
|
444
|
+
roughness: number;
|
|
445
|
+
metalness: number;
|
|
446
|
+
envMapIntensity: number;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
class LitMaterial extends Shader {
|
|
450
|
+
constructor(options?: Record<string, any>);
|
|
451
|
+
color: Color;
|
|
452
|
+
roughness: number;
|
|
453
|
+
metalness: number;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
457
|
+
// TEXTURES & RENDER TARGETS
|
|
458
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
459
|
+
|
|
460
|
+
class Texture {
|
|
461
|
+
constructor(gl?: WebGLRenderingContext);
|
|
462
|
+
image: HTMLImageElement | HTMLVideoElement | HTMLCanvasElement | null;
|
|
463
|
+
width: number;
|
|
464
|
+
height: number;
|
|
465
|
+
wrapS: number;
|
|
466
|
+
wrapT: number;
|
|
467
|
+
minFilter: number;
|
|
468
|
+
magFilter: number;
|
|
469
|
+
needsUpdate: boolean;
|
|
470
|
+
dispose(): void;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
class RenderTarget {
|
|
474
|
+
constructor(width: number, height: number, options?: {
|
|
475
|
+
type?: string; format?: string; filter?: string;
|
|
476
|
+
depthBuffer?: boolean; stencilBuffer?: boolean; samples?: number;
|
|
477
|
+
});
|
|
478
|
+
width: number; height: number;
|
|
479
|
+
texture: Texture;
|
|
480
|
+
depthTexture: Texture | null;
|
|
481
|
+
resize(width: number, height: number): void;
|
|
482
|
+
dispose(): void;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
class MultiRenderTarget {
|
|
486
|
+
constructor(width: number, height: number, count: number, options?: Record<string, any>);
|
|
487
|
+
textures: Texture[];
|
|
488
|
+
resize(width: number, height: number): void;
|
|
489
|
+
dispose(): void;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
const Utils3D: {
|
|
493
|
+
getTexture(path: string): Texture;
|
|
494
|
+
getRepeatTexture(path: string): Texture;
|
|
495
|
+
loadCubemap(paths: string[]): Texture;
|
|
496
|
+
createDataTexture(data: Float32Array, width: number, height: number): Texture;
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
const RTPool: {
|
|
500
|
+
get(width: number, height: number, options?: Record<string, any>): RenderTarget;
|
|
501
|
+
release(rt: RenderTarget): void;
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
505
|
+
// CAMERAS
|
|
506
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
507
|
+
|
|
508
|
+
class Camera extends Object3D {
|
|
509
|
+
projectionMatrix: Matrix4;
|
|
510
|
+
projectionMatrixInverse: Matrix4;
|
|
511
|
+
matrixWorldInverse: Matrix4;
|
|
512
|
+
updateProjectionMatrix(): void;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
class BaseCamera extends Camera {}
|
|
516
|
+
class CameraBase3D extends Camera {}
|
|
517
|
+
|
|
518
|
+
class PerspectiveCamera extends Camera {
|
|
519
|
+
constructor(fov?: number, aspect?: number, near?: number, far?: number);
|
|
520
|
+
fov: number; aspect: number; near: number; far: number;
|
|
521
|
+
updateProjectionMatrix(): void;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
class OrthographicCamera extends Camera {
|
|
525
|
+
constructor(left?: number, right?: number, top?: number, bottom?: number, near?: number, far?: number);
|
|
526
|
+
left: number; right: number; top: number; bottom: number;
|
|
527
|
+
near: number; far: number;
|
|
528
|
+
updateProjectionMatrix(): void;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
class GazeCamera extends PerspectiveCamera {
|
|
532
|
+
constructor(options?: { fov?: number; near?: number; far?: number });
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
const ScreenProjection: {
|
|
536
|
+
toScreen(pos: Vector3, camera: Camera): Vector2;
|
|
537
|
+
toWorld(screenPos: Vector2, z: number, camera: Camera): Vector3;
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
541
|
+
// WORLD & RENDERING
|
|
542
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
543
|
+
|
|
544
|
+
const World: {
|
|
545
|
+
SCENE: Scene;
|
|
546
|
+
CAMERA: PerspectiveCamera;
|
|
547
|
+
RENDERER: Renderer;
|
|
548
|
+
NUKE: Nuke;
|
|
549
|
+
ELEMENT: HTMLCanvasElement;
|
|
550
|
+
instance(): typeof World;
|
|
551
|
+
init(): void;
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
const Render: {
|
|
555
|
+
start(callback: RenderCallback): void;
|
|
556
|
+
stop(callback: RenderCallback): void;
|
|
557
|
+
fps: number;
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
class Renderer {
|
|
561
|
+
constructor(canvas: HTMLCanvasElement, options?: Record<string, any>);
|
|
562
|
+
gl: WebGL2RenderingContext | WebGLRenderingContext;
|
|
563
|
+
setSize(width: number, height: number): void;
|
|
564
|
+
setPixelRatio(ratio: number): void;
|
|
565
|
+
render(scene: Scene, camera: Camera): void;
|
|
566
|
+
setClearColor(color: Color, alpha?: number): void;
|
|
567
|
+
dispose(): void;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
const RenderManager: {
|
|
571
|
+
add(pass: any): void;
|
|
572
|
+
remove(pass: any): void;
|
|
573
|
+
setSize(w: number, h: number): void;
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
577
|
+
// LIGHTING
|
|
578
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
579
|
+
|
|
580
|
+
class Light extends Object3D {
|
|
581
|
+
constructor(color?: Color, intensity?: number);
|
|
582
|
+
color: Color;
|
|
583
|
+
intensity: number;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
const Lighting: {
|
|
587
|
+
add(light: Light): void;
|
|
588
|
+
remove(light: Light): void;
|
|
589
|
+
setAmbient(color: Color, intensity?: number): void;
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
class ShadowLight extends Light {
|
|
593
|
+
constructor(options?: { color?: Color; intensity?: number; shadow?: Record<string, any> });
|
|
594
|
+
shadow: { mapSize: Vector2; camera: OrthographicCamera; bias: number };
|
|
595
|
+
castShadow: boolean;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
class LightVolume {
|
|
599
|
+
constructor(options?: Record<string, any>);
|
|
600
|
+
position: Vector3;
|
|
601
|
+
color: Color;
|
|
602
|
+
radius: number;
|
|
603
|
+
intensity: number;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
const AreaLightUtil: {
|
|
607
|
+
create(options: Record<string, any>): Light;
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
611
|
+
// POST-PROCESSING (NUKE)
|
|
612
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
613
|
+
|
|
614
|
+
class Nuke {
|
|
615
|
+
constructor(renderer: Renderer, options?: Record<string, any>);
|
|
616
|
+
add(pass: NukePass): this;
|
|
617
|
+
remove(pass: NukePass): this;
|
|
618
|
+
setSize(width: number, height: number): void;
|
|
619
|
+
render(): void;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
class NukePass {
|
|
623
|
+
constructor(shaderName: string, uniforms?: Record<string, { value: any }>);
|
|
624
|
+
enabled: boolean;
|
|
625
|
+
uniforms: Record<string, { value: any }>;
|
|
626
|
+
renderToScreen: boolean;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
class BlitPass extends NukePass {
|
|
630
|
+
constructor(texture: Texture, uniforms?: Record<string, any>);
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
class FXAA extends NukePass {}
|
|
634
|
+
|
|
635
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
636
|
+
// EFFECTS & FX
|
|
637
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
638
|
+
|
|
639
|
+
const FX: { [name: string]: any };
|
|
640
|
+
class FXScene { constructor(options?: Record<string, any>); }
|
|
641
|
+
class FXLayer extends Object3D { constructor(options?: Record<string, any>); }
|
|
642
|
+
class FXStencil { constructor(options?: Record<string, any>); }
|
|
643
|
+
class FXScroll { constructor(options?: Record<string, any>); speed: number; }
|
|
644
|
+
|
|
645
|
+
class HydraBloom extends NukePass {
|
|
646
|
+
constructor(options?: { strength?: number; radius?: number; threshold?: number });
|
|
647
|
+
strength: number; radius: number; threshold: number;
|
|
648
|
+
}
|
|
649
|
+
class UnrealBloom extends NukePass {
|
|
650
|
+
constructor(options?: { strength?: number; radius?: number; threshold?: number });
|
|
651
|
+
strength: number; radius: number; threshold: number;
|
|
652
|
+
}
|
|
653
|
+
class VolumetricLight extends NukePass {
|
|
654
|
+
constructor(options?: { density?: number; decay?: number; weight?: number; samples?: number });
|
|
655
|
+
}
|
|
656
|
+
class HydraLensStreak extends NukePass {
|
|
657
|
+
constructor(options?: Record<string, any>);
|
|
658
|
+
}
|
|
659
|
+
class Mirror extends Object3D {
|
|
660
|
+
constructor(options?: Record<string, any>);
|
|
661
|
+
reflectionTexture: Texture;
|
|
662
|
+
}
|
|
663
|
+
class SnapshotFrame {
|
|
664
|
+
constructor(width?: number, height?: number);
|
|
665
|
+
capture(): Texture;
|
|
666
|
+
texture: Texture;
|
|
667
|
+
}
|
|
668
|
+
class SnapshotFramePingPong {
|
|
669
|
+
constructor(width?: number, height?: number);
|
|
670
|
+
ping: RenderTarget; pong: RenderTarget;
|
|
671
|
+
swap(): void;
|
|
672
|
+
current: RenderTarget;
|
|
673
|
+
}
|
|
674
|
+
class CubemapToEquirectangular {
|
|
675
|
+
constructor(renderer: Renderer, size?: number);
|
|
676
|
+
update(cubemap: Texture): Texture;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
680
|
+
// FLUID SIMULATION
|
|
681
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
682
|
+
|
|
683
|
+
class Fluid {
|
|
684
|
+
constructor(simSize?: number, dyeSize?: number, rect?: { width: number; height: number });
|
|
685
|
+
splat(x: number, y: number, dx: number, dy: number, color?: Color): void;
|
|
686
|
+
update(dt?: number): void;
|
|
687
|
+
texture: Texture;
|
|
688
|
+
velocity: Texture;
|
|
689
|
+
dye: Texture;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
class FluidFBO {
|
|
693
|
+
constructor(size: number, options?: Record<string, any>);
|
|
694
|
+
texture: Texture;
|
|
695
|
+
read: RenderTarget;
|
|
696
|
+
write: RenderTarget;
|
|
697
|
+
swap(): void;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
class FluidScene {
|
|
701
|
+
constructor(options?: Record<string, any>);
|
|
702
|
+
fluid: Fluid;
|
|
703
|
+
mesh: Mesh;
|
|
704
|
+
update(dt?: number): void;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
class FluidLayer extends Object3D {
|
|
708
|
+
constructor(options?: Record<string, any>);
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
class MouseFluid {
|
|
712
|
+
static instance(): MouseFluid;
|
|
713
|
+
applyTo(mesh: Mesh): void;
|
|
714
|
+
update(): void;
|
|
715
|
+
texture: Texture;
|
|
716
|
+
color: Color;
|
|
717
|
+
radius: number;
|
|
718
|
+
strength: number;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
722
|
+
// PARTICLES — ANTIMATTER / PROTON
|
|
723
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
724
|
+
|
|
725
|
+
class Antimatter {
|
|
726
|
+
constructor(options?: {
|
|
727
|
+
count?: number; spawner?: AntimatterSpawn; attributes?: AntimatterAttribute[];
|
|
728
|
+
behavior?: string; blending?: string; size?: number;
|
|
729
|
+
});
|
|
730
|
+
mesh: Points;
|
|
731
|
+
count: number;
|
|
732
|
+
spawn(position?: Vector3, velocity?: Vector3): void;
|
|
733
|
+
reset(): void;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
class AntimatterAttribute {
|
|
737
|
+
constructor(name: string, size: number, initialValue?: number[]);
|
|
738
|
+
name: string;
|
|
739
|
+
size: number;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
class AntimatterFBO {
|
|
743
|
+
constructor(width: number, height: number, options?: Record<string, any>);
|
|
744
|
+
texture: Texture;
|
|
745
|
+
read: RenderTarget;
|
|
746
|
+
write: RenderTarget;
|
|
747
|
+
swap(): void;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
class AntimatterPass {
|
|
751
|
+
constructor(shader: Shader, inputs: Texture[], output?: RenderTarget);
|
|
752
|
+
render(): void;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
class AntimatterSpawn {
|
|
756
|
+
constructor(options?: { rate?: number; count?: number; burst?: boolean });
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
const AntimatterUtil: { [key: string]: any };
|
|
760
|
+
|
|
761
|
+
class Proton {
|
|
762
|
+
constructor(options?: Record<string, any>);
|
|
763
|
+
addEmitter(emitter: any): void;
|
|
764
|
+
removeEmitter(emitter: any): void;
|
|
765
|
+
update(dt?: number): void;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
const ProtonPresets: { [name: string]: (options?: any) => Proton };
|
|
769
|
+
class ProtonTubes {
|
|
770
|
+
constructor(options?: Record<string, any>);
|
|
771
|
+
mesh: Mesh;
|
|
772
|
+
update(dt?: number): void;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
class SplineParticles {
|
|
776
|
+
constructor(spline: SplineGen, options?: Record<string, any>);
|
|
777
|
+
mesh: Points;
|
|
778
|
+
update(dt?: number): void;
|
|
779
|
+
count: number;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
class SplineParticlesStatic {
|
|
783
|
+
constructor(spline: SplineGen, count: number, options?: Record<string, any>);
|
|
784
|
+
mesh: Points;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
class ParticleDistributor {
|
|
788
|
+
constructor(options?: Record<string, any>);
|
|
789
|
+
distribute(count: number, area: Box3): Vector3[];
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
793
|
+
// INSTANCING & BATCHING
|
|
794
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
795
|
+
|
|
796
|
+
class MeshBatch {
|
|
797
|
+
constructor(geometry?: Geometry, shader?: Shader, maxCount?: number);
|
|
798
|
+
mesh: Mesh;
|
|
799
|
+
count: number;
|
|
800
|
+
add(matrix: Matrix4, color?: Color): number;
|
|
801
|
+
remove(id: number): void;
|
|
802
|
+
setMatrixAt(id: number, matrix: Matrix4): void;
|
|
803
|
+
update(): void;
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
class MeshMerge {
|
|
807
|
+
constructor(meshes: Mesh[], options?: Record<string, any>);
|
|
808
|
+
mesh: Mesh;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
class InstanceMesh {
|
|
812
|
+
constructor(geometry: Geometry, shader: Shader, count: number);
|
|
813
|
+
mesh: Mesh;
|
|
814
|
+
setMatrixAt(index: number, matrix: Matrix4): void;
|
|
815
|
+
setColorAt(index: number, color: Color): void;
|
|
816
|
+
instanceCount: number;
|
|
817
|
+
update(): void;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
821
|
+
// TEXT (WebGL)
|
|
822
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
823
|
+
|
|
824
|
+
class Text3D extends Mesh {
|
|
825
|
+
constructor(text: string, options?: { font?: string; size?: number; color?: Color; align?: string });
|
|
826
|
+
text: string;
|
|
827
|
+
font: string;
|
|
828
|
+
size: number;
|
|
829
|
+
lineHeight: number;
|
|
830
|
+
setText(text: string): void;
|
|
831
|
+
measure(): { width: number; height: number };
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
class GLText extends Object3D {
|
|
835
|
+
constructor(options?: { font?: string; size?: number; align?: string });
|
|
836
|
+
setText(text: string): void;
|
|
837
|
+
width: number;
|
|
838
|
+
height: number;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
class GLTextGeometry extends Geometry {
|
|
842
|
+
constructor(text: string, font: any, options?: Record<string, any>);
|
|
843
|
+
setText(text: string): void;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
const GLScreenProjection: {
|
|
847
|
+
project(pos: Vector3, camera: Camera, size: { width: number; height: number }): Vector2;
|
|
848
|
+
};
|
|
849
|
+
|
|
850
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
851
|
+
// INTERACTION
|
|
852
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
853
|
+
|
|
854
|
+
const Mouse: {
|
|
855
|
+
x: number; y: number;
|
|
856
|
+
nX: number; nY: number;
|
|
857
|
+
vX: number; vY: number;
|
|
858
|
+
down: boolean;
|
|
859
|
+
element: HTMLElement;
|
|
860
|
+
on(event: string, callback: Function, scope?: any): void;
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
const Interaction: {
|
|
864
|
+
on(event: string, callback: Function, scope?: any): void;
|
|
865
|
+
off(event: string, callback: Function, scope?: any): void;
|
|
866
|
+
};
|
|
867
|
+
|
|
868
|
+
class Interaction3D {
|
|
869
|
+
constructor(camera?: Camera, scene?: Scene);
|
|
870
|
+
on(event: 'over' | 'out' | 'click' | 'down' | 'up', callback: (obj: Object3D) => void): void;
|
|
871
|
+
add(obj: Object3D): void;
|
|
872
|
+
remove(obj: Object3D): void;
|
|
873
|
+
update(): void;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
class Raycaster {
|
|
877
|
+
constructor(origin?: Vector3, direction?: Vector3);
|
|
878
|
+
ray: Ray;
|
|
879
|
+
near: number;
|
|
880
|
+
far: number;
|
|
881
|
+
set(origin: Vector3, direction: Vector3): void;
|
|
882
|
+
setFromCamera(coords: Vector2, camera: Camera): void;
|
|
883
|
+
intersectObject(obj: Object3D, recursive?: boolean): Array<{ point: Vector3; distance: number; object: Object3D }>;
|
|
884
|
+
intersectObjects(objs: Object3D[], recursive?: boolean): Array<{ point: Vector3; distance: number; object: Object3D }>;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
const Scroll: {
|
|
888
|
+
y: number; x: number;
|
|
889
|
+
delta: number;
|
|
890
|
+
on(event: string, callback: Function): void;
|
|
891
|
+
};
|
|
892
|
+
|
|
893
|
+
class ScrollController {
|
|
894
|
+
constructor(element: HTMLElement, options?: Record<string, any>);
|
|
895
|
+
scrollTo(y: number, duration?: number): void;
|
|
896
|
+
on(event: string, callback: Function): void;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
const Keyboard: {
|
|
900
|
+
on(event: string, callback: (key: string, code: number) => void): void;
|
|
901
|
+
off(event: string, callback: Function): void;
|
|
902
|
+
isDown(key: string | number): boolean;
|
|
903
|
+
};
|
|
904
|
+
|
|
905
|
+
class VelocityTracker {
|
|
906
|
+
constructor(options?: { decay?: number });
|
|
907
|
+
update(value: number): void;
|
|
908
|
+
velocity: number;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
912
|
+
// ANIMATION & TWEENING
|
|
913
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
914
|
+
|
|
915
|
+
const TweenManager: {
|
|
916
|
+
to(obj: any, props: Record<string, any>, duration: number, ease?: EaseName, delay?: number): any;
|
|
917
|
+
from(obj: any, props: Record<string, any>, duration: number, ease?: EaseName, delay?: number): any;
|
|
918
|
+
kill(obj: any): void;
|
|
919
|
+
killAll(): void;
|
|
920
|
+
};
|
|
921
|
+
|
|
922
|
+
class TweenTimeline {
|
|
923
|
+
constructor(options?: { loop?: boolean; autoStart?: boolean });
|
|
924
|
+
add(tween: any, time: number): this;
|
|
925
|
+
play(): this;
|
|
926
|
+
pause(): this;
|
|
927
|
+
stop(): this;
|
|
928
|
+
seek(time: number): this;
|
|
929
|
+
duration: number;
|
|
930
|
+
time: number;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
class FrameTween {
|
|
934
|
+
constructor(obj: any, props: Record<string, any>, frames: number, ease?: EaseName);
|
|
935
|
+
play(): this;
|
|
936
|
+
stop(): this;
|
|
937
|
+
frame: number;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
class CSSTransition {
|
|
941
|
+
constructor(element: HTMLElement, options?: { duration?: number; ease?: string; delay?: number });
|
|
942
|
+
to(props: Record<string, any>): Promise<void>;
|
|
943
|
+
cancel(): void;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
class HierarchyAnimation {
|
|
947
|
+
constructor(root: Object3D, options?: Record<string, any>);
|
|
948
|
+
play(name: string): this;
|
|
949
|
+
stop(): this;
|
|
950
|
+
mixer: any;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
class LayerAnimation {
|
|
954
|
+
constructor(options?: Record<string, any>);
|
|
955
|
+
addLayer(name: string, tween: any): this;
|
|
956
|
+
play(name: string): this;
|
|
957
|
+
crossFadeTo(name: string, duration?: number): this;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
961
|
+
// AUDIO
|
|
962
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
963
|
+
|
|
964
|
+
class Audio3D {
|
|
965
|
+
constructor(source: string | AudioBuffer, options?: { volume?: number; loop?: boolean; spatial?: boolean });
|
|
966
|
+
play(): void;
|
|
967
|
+
pause(): void;
|
|
968
|
+
stop(): void;
|
|
969
|
+
volume: number;
|
|
970
|
+
loop: boolean;
|
|
971
|
+
position: Vector3;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
class Audio3DLayer {
|
|
975
|
+
constructor(options?: Record<string, any>);
|
|
976
|
+
add(audio: Audio3D): void;
|
|
977
|
+
volume: number;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
class Audio3DResonance {
|
|
981
|
+
constructor(source: string, options?: Record<string, any>);
|
|
982
|
+
play(): void;
|
|
983
|
+
stop(): void;
|
|
984
|
+
position: Vector3;
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
class Audio3DWA {
|
|
988
|
+
constructor(options?: Record<string, any>);
|
|
989
|
+
context: AudioContext;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
class Audio3DWABuffer {
|
|
993
|
+
constructor(context: AudioContext, path: string);
|
|
994
|
+
play(options?: { volume?: number; loop?: boolean }): AudioBufferSourceNode;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
class Audio3DWAStream {
|
|
998
|
+
constructor(context: AudioContext, path: string);
|
|
999
|
+
play(): void;
|
|
1000
|
+
pause(): void;
|
|
1001
|
+
volume: number;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
const GlobalAudio3D: {
|
|
1005
|
+
context: AudioContext;
|
|
1006
|
+
masterVolume: number;
|
|
1007
|
+
setVolume(v: number): void;
|
|
1008
|
+
mute(): void;
|
|
1009
|
+
unmute(): void;
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
class SFXController {
|
|
1013
|
+
constructor(sounds: Record<string, string>, options?: Record<string, any>);
|
|
1014
|
+
play(name: string, options?: { volume?: number; pitch?: number }): void;
|
|
1015
|
+
stop(name: string): void;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
const WebAudio: {
|
|
1019
|
+
context: AudioContext;
|
|
1020
|
+
createGain(): GainNode;
|
|
1021
|
+
createAnalyser(): AnalyserNode;
|
|
1022
|
+
getFrequencyData(analyser: AnalyserNode): Uint8Array;
|
|
1023
|
+
};
|
|
1024
|
+
|
|
1025
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1026
|
+
// VIDEO
|
|
1027
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1028
|
+
|
|
1029
|
+
class Video {
|
|
1030
|
+
constructor(src: string, options?: { autoplay?: boolean; loop?: boolean; muted?: boolean; playsInline?: boolean });
|
|
1031
|
+
element: HTMLVideoElement;
|
|
1032
|
+
play(): Promise<void>;
|
|
1033
|
+
pause(): void;
|
|
1034
|
+
stop(): void;
|
|
1035
|
+
currentTime: number;
|
|
1036
|
+
duration: number;
|
|
1037
|
+
volume: number;
|
|
1038
|
+
loop: boolean;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
class VideoTexture extends Texture {
|
|
1042
|
+
constructor(video: Video | HTMLVideoElement);
|
|
1043
|
+
video: HTMLVideoElement;
|
|
1044
|
+
update(): void;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
class VideoTextureColorParser {
|
|
1048
|
+
constructor(video: VideoTexture, options?: Record<string, any>);
|
|
1049
|
+
dominantColor: Color;
|
|
1050
|
+
update(): void;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
class Webcam {
|
|
1054
|
+
constructor(options?: { facingMode?: string; width?: number; height?: number });
|
|
1055
|
+
element: HTMLVideoElement;
|
|
1056
|
+
texture: VideoTexture;
|
|
1057
|
+
start(): Promise<void>;
|
|
1058
|
+
stop(): void;
|
|
1059
|
+
width: number;
|
|
1060
|
+
height: number;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1064
|
+
// UI — GLUI (WebGL-rendered UI elements)
|
|
1065
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1066
|
+
|
|
1067
|
+
const GLUI: {
|
|
1068
|
+
init(): void;
|
|
1069
|
+
Stage: any; Scene: any;
|
|
1070
|
+
};
|
|
1071
|
+
|
|
1072
|
+
class GLUIElement extends Object3D {
|
|
1073
|
+
constructor(options?: Record<string, any>);
|
|
1074
|
+
width: number; height: number;
|
|
1075
|
+
alpha: number;
|
|
1076
|
+
setSize(w: number, h: number): void;
|
|
1077
|
+
show(): void;
|
|
1078
|
+
hide(): void;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
class GLUIBatch extends Object3D {
|
|
1082
|
+
constructor(options?: Record<string, any>);
|
|
1083
|
+
add(element: GLUIElement): void;
|
|
1084
|
+
remove(element: GLUIElement): void;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
class GLUIBatchText extends GLUIElement {
|
|
1088
|
+
constructor(options?: { text?: string; font?: string; size?: number; color?: Color });
|
|
1089
|
+
setText(text: string): void;
|
|
1090
|
+
text: string;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
class GLUIStage extends Object3D {
|
|
1094
|
+
constructor(options?: Record<string, any>);
|
|
1095
|
+
width: number; height: number;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
class GLUIStage3D extends GLUIStage {
|
|
1099
|
+
constructor(options?: Record<string, any>);
|
|
1100
|
+
camera: PerspectiveCamera;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
class GLUITexture extends GLUIElement {
|
|
1104
|
+
constructor(texture: Texture, options?: Record<string, any>);
|
|
1105
|
+
texture: Texture;
|
|
1106
|
+
setTexture(t: Texture): void;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
class GLUICornerPin extends GLUIElement {
|
|
1110
|
+
constructor(options?: Record<string, any>);
|
|
1111
|
+
setCorners(tl: Vector2, tr: Vector2, br: Vector2, bl: Vector2): void;
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
class GLUIStageInteraction2D {
|
|
1115
|
+
constructor(stage: GLUIStage, options?: Record<string, any>);
|
|
1116
|
+
on(event: string, callback: Function): void;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
class GLUIStageInteraction3D {
|
|
1120
|
+
constructor(stage: GLUIStage3D, options?: Record<string, any>);
|
|
1121
|
+
on(event: string, callback: Function): void;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
class GLA11y {
|
|
1125
|
+
constructor(element: HTMLElement, options?: Record<string, any>);
|
|
1126
|
+
setRole(role: string): void;
|
|
1127
|
+
setLabel(label: string): void;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
class UI3D extends Object3D {
|
|
1131
|
+
constructor(options?: Record<string, any>);
|
|
1132
|
+
show(): void;
|
|
1133
|
+
hide(): void;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
class UI3DLayer extends Object3D {
|
|
1137
|
+
constructor(options?: Record<string, any>);
|
|
1138
|
+
add(element: UI3D): void;
|
|
1139
|
+
remove(element: UI3D): void;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1143
|
+
// DOM
|
|
1144
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1145
|
+
|
|
1146
|
+
const Stage: {
|
|
1147
|
+
width: number; height: number;
|
|
1148
|
+
pixelRatio: number;
|
|
1149
|
+
add(element: HTMLElement): void;
|
|
1150
|
+
remove(element: HTMLElement): void;
|
|
1151
|
+
on(event: string, callback: Function): void;
|
|
1152
|
+
};
|
|
1153
|
+
|
|
1154
|
+
const HydraCSS: {
|
|
1155
|
+
style(element: HTMLElement, styles: Record<string, any>): void;
|
|
1156
|
+
set(element: HTMLElement, styles: Record<string, any>): void;
|
|
1157
|
+
};
|
|
1158
|
+
|
|
1159
|
+
const $: (selector: string, parent?: HTMLElement) => HTMLElement | null;
|
|
1160
|
+
|
|
1161
|
+
class PushState {
|
|
1162
|
+
constructor();
|
|
1163
|
+
static push(path: string, data?: any): void;
|
|
1164
|
+
static replace(path: string, data?: any): void;
|
|
1165
|
+
static on(event: 'change', callback: (path: string, data: any) => void): void;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
class Router {
|
|
1169
|
+
constructor(routes: Record<string, Function>);
|
|
1170
|
+
start(): void;
|
|
1171
|
+
navigate(path: string): void;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
class DOMTemplate {
|
|
1175
|
+
constructor(templateId: string);
|
|
1176
|
+
render(data: Record<string, any>): HTMLElement;
|
|
1177
|
+
clone(): HTMLElement;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1181
|
+
// SCENE LAYOUT / FRAGMENTS
|
|
1182
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1183
|
+
|
|
1184
|
+
const SceneLayout: {
|
|
1185
|
+
add(fragment: Frag3D): void;
|
|
1186
|
+
remove(fragment: Frag3D): void;
|
|
1187
|
+
update(dt?: number): void;
|
|
1188
|
+
};
|
|
1189
|
+
|
|
1190
|
+
class Frag3D extends Object3D {
|
|
1191
|
+
constructor(options?: Record<string, any>);
|
|
1192
|
+
init(): void;
|
|
1193
|
+
resize(width: number, height: number): void;
|
|
1194
|
+
update(dt?: number): void;
|
|
1195
|
+
show(duration?: number): Promise<void>;
|
|
1196
|
+
hide(duration?: number): Promise<void>;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
class FragFXScene extends Frag3D {
|
|
1200
|
+
constructor(options?: Record<string, any>);
|
|
1201
|
+
nuke: Nuke;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
class FXSceneCompositor {
|
|
1205
|
+
constructor(options?: Record<string, any>);
|
|
1206
|
+
add(scene: Frag3D, pass: NukePass): void;
|
|
1207
|
+
render(): void;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
class FragCompositor {
|
|
1211
|
+
constructor(options?: Record<string, any>);
|
|
1212
|
+
compose(fragments: Frag3D[]): void;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
const Initializer3D: {
|
|
1216
|
+
createWorld(options?: Record<string, any>): void;
|
|
1217
|
+
};
|
|
1218
|
+
|
|
1219
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1220
|
+
// LOADING & ASSETS
|
|
1221
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1222
|
+
|
|
1223
|
+
const Assets: {
|
|
1224
|
+
list(): any;
|
|
1225
|
+
getPath(path: string): string;
|
|
1226
|
+
loadImage(path: string): HTMLImageElement;
|
|
1227
|
+
loadJSON(path: string): Promise<any>;
|
|
1228
|
+
loadText(path: string): Promise<string>;
|
|
1229
|
+
loadArrayBuffer(path: string): Promise<ArrayBuffer>;
|
|
1230
|
+
};
|
|
1231
|
+
|
|
1232
|
+
const AssetLoader: {
|
|
1233
|
+
loadAssets(list: any): Promise<void>;
|
|
1234
|
+
on(event: 'progress' | 'complete', callback: Function): void;
|
|
1235
|
+
};
|
|
1236
|
+
|
|
1237
|
+
class ImageDecoder {
|
|
1238
|
+
constructor(options?: Record<string, any>);
|
|
1239
|
+
decode(blob: Blob): Promise<ImageBitmap>;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
class Ktx2Transcoder {
|
|
1243
|
+
constructor();
|
|
1244
|
+
transcode(buffer: ArrayBuffer): Promise<Texture>;
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1248
|
+
// MULTIPLAYER / NETWORKING
|
|
1249
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1250
|
+
|
|
1251
|
+
const Multiplayer: {
|
|
1252
|
+
connect(url: string, options?: Record<string, any>): SocketConnection;
|
|
1253
|
+
on(event: string, callback: Function): void;
|
|
1254
|
+
send(event: string, data?: any): void;
|
|
1255
|
+
};
|
|
1256
|
+
|
|
1257
|
+
const GameCenter: {
|
|
1258
|
+
connect(url: string): void;
|
|
1259
|
+
on(event: string, callback: Function): void;
|
|
1260
|
+
};
|
|
1261
|
+
|
|
1262
|
+
class PlayerModel extends Model {
|
|
1263
|
+
constructor(data?: Record<string, any>);
|
|
1264
|
+
id: string;
|
|
1265
|
+
position: Vector3;
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
class Player extends Object3D {
|
|
1269
|
+
constructor(model: PlayerModel, options?: Record<string, any>);
|
|
1270
|
+
model: PlayerModel;
|
|
1271
|
+
view: PlayerView;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
class PlayerView extends Object3D {
|
|
1275
|
+
constructor(model: PlayerModel, options?: Record<string, any>);
|
|
1276
|
+
model: PlayerModel;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
class PhysicalSync {
|
|
1280
|
+
constructor(object: Object3D, options?: Record<string, any>);
|
|
1281
|
+
update(): void;
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
class PhysicalLink {
|
|
1285
|
+
constructor(a: Object3D, b: Object3D, options?: Record<string, any>);
|
|
1286
|
+
update(): void;
|
|
1287
|
+
length: number;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
class SynchronizedObjects {
|
|
1291
|
+
constructor(options?: Record<string, any>);
|
|
1292
|
+
add(object: Object3D, id: string): void;
|
|
1293
|
+
update(dt?: number): void;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
class SocketConnection {
|
|
1297
|
+
constructor(url: string, options?: { reconnect?: boolean; protocols?: string[] });
|
|
1298
|
+
on(event: string, callback: Function): void;
|
|
1299
|
+
send(event: string, data?: any): void;
|
|
1300
|
+
close(): void;
|
|
1301
|
+
connected: boolean;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
class QRCode {
|
|
1305
|
+
constructor(text: string, options?: { size?: number; errorLevel?: string });
|
|
1306
|
+
render(canvas: HTMLCanvasElement): void;
|
|
1307
|
+
toDataURL(): string;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
class QRGen {
|
|
1311
|
+
constructor(options?: Record<string, any>);
|
|
1312
|
+
generate(text: string): string;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1316
|
+
// VR / AR / XR
|
|
1317
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1318
|
+
|
|
1319
|
+
const XRConfig: {
|
|
1320
|
+
requiredFeatures: string[];
|
|
1321
|
+
optionalFeatures: string[];
|
|
1322
|
+
frameOfReference: string;
|
|
1323
|
+
};
|
|
1324
|
+
|
|
1325
|
+
const XRDeviceManager: {
|
|
1326
|
+
isSupported(mode: 'immersive-vr' | 'immersive-ar' | 'inline'): Promise<boolean>;
|
|
1327
|
+
requestSession(mode: string, options?: any): Promise<XRSession>;
|
|
1328
|
+
on(event: string, callback: Function): void;
|
|
1329
|
+
};
|
|
1330
|
+
|
|
1331
|
+
class VRInput extends Object3D {
|
|
1332
|
+
constructor(session: XRSession, options?: Record<string, any>);
|
|
1333
|
+
left: VRInputController;
|
|
1334
|
+
right: VRInputController;
|
|
1335
|
+
update(frame: XRFrame): void;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
class VRInputController extends Object3D {
|
|
1339
|
+
trigger: boolean;
|
|
1340
|
+
grip: boolean;
|
|
1341
|
+
thumbstick: Vector2;
|
|
1342
|
+
on(event: 'select' | 'selectstart' | 'selectend' | 'squeeze', callback: Function): void;
|
|
1343
|
+
hapticPulse(duration?: number, intensity?: number): void;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
class VRInputHand extends Object3D {
|
|
1347
|
+
constructor(options?: Record<string, any>);
|
|
1348
|
+
joints: Object3D[];
|
|
1349
|
+
update(frame: XRFrame): void;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
class VRCamera extends PerspectiveCamera {
|
|
1353
|
+
constructor(options?: Record<string, any>);
|
|
1354
|
+
setFromXRFrame(frame: XRFrame, refSpace: XRReferenceSpace): void;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
class VRRenderer {
|
|
1358
|
+
constructor(renderer: Renderer, session: XRSession);
|
|
1359
|
+
render(scene: Scene, camera: VRCamera, frame: XRFrame): void;
|
|
1360
|
+
setSession(session: XRSession): void;
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
class ARCamera extends PerspectiveCamera {
|
|
1364
|
+
constructor(options?: Record<string, any>);
|
|
1365
|
+
setFromXRFrame(frame: XRFrame, refSpace: XRReferenceSpace): void;
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
class ARRenderer extends VRRenderer {
|
|
1369
|
+
constructor(renderer: Renderer, session: XRSession);
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
const ARUtils: {
|
|
1373
|
+
isSupported(): Promise<boolean>;
|
|
1374
|
+
createSession(options?: Record<string, any>): Promise<XRSession>;
|
|
1375
|
+
placeAnchor(frame: XRFrame, position: Vector3): XRAnchor | null;
|
|
1376
|
+
};
|
|
1377
|
+
|
|
1378
|
+
class UserInput {
|
|
1379
|
+
constructor(options?: Record<string, any>);
|
|
1380
|
+
on(event: string, callback: Function): void;
|
|
1381
|
+
pointer: Vector2;
|
|
1382
|
+
down: boolean;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
class UserInputMouseTouch extends UserInput {
|
|
1386
|
+
constructor(element?: HTMLElement, options?: Record<string, any>);
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1390
|
+
// AI
|
|
1391
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1392
|
+
|
|
1393
|
+
class InteractAI {
|
|
1394
|
+
constructor(options?: Record<string, any>);
|
|
1395
|
+
send(message: string): Promise<string>;
|
|
1396
|
+
on(event: 'message' | 'error', callback: Function): void;
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1400
|
+
// THREADING
|
|
1401
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1402
|
+
|
|
1403
|
+
const Thread: {
|
|
1404
|
+
create(workerFunction: Function): Worker;
|
|
1405
|
+
post(worker: Worker, message: any, transfer?: Transferable[]): void;
|
|
1406
|
+
terminate(worker: Worker): void;
|
|
1407
|
+
};
|
|
1408
|
+
|
|
1409
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1410
|
+
// GPU / PERFORMANCE
|
|
1411
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1412
|
+
|
|
1413
|
+
const GPU: {
|
|
1414
|
+
vendor: string;
|
|
1415
|
+
renderer: string;
|
|
1416
|
+
tier: number;
|
|
1417
|
+
isMobile: boolean;
|
|
1418
|
+
webgl2: boolean;
|
|
1419
|
+
extensions: string[];
|
|
1420
|
+
};
|
|
1421
|
+
|
|
1422
|
+
const Performance: {
|
|
1423
|
+
fps: number;
|
|
1424
|
+
ms: number;
|
|
1425
|
+
memory: { used: number; total: number } | null;
|
|
1426
|
+
begin(): void;
|
|
1427
|
+
end(): void;
|
|
1428
|
+
on(event: 'low-fps', callback: (fps: number) => void): void;
|
|
1429
|
+
};
|
|
1430
|
+
|
|
1431
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1432
|
+
// DEBUG / DEV
|
|
1433
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1434
|
+
|
|
1435
|
+
const Dev: {
|
|
1436
|
+
enabled: boolean;
|
|
1437
|
+
log(...args: any[]): void;
|
|
1438
|
+
warn(...args: any[]): void;
|
|
1439
|
+
error(...args: any[]): void;
|
|
1440
|
+
grid(scene: Scene, size?: number, divisions?: number): Object3D;
|
|
1441
|
+
axes(size?: number): Object3D;
|
|
1442
|
+
stats(): HTMLElement;
|
|
1443
|
+
};
|
|
1444
|
+
|
|
1445
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1446
|
+
// DEVICE DETECTION
|
|
1447
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
1448
|
+
|
|
1449
|
+
const Device: {
|
|
1450
|
+
mobile: false | { phone: boolean; tablet: boolean; pwa: boolean; native: boolean };
|
|
1451
|
+
system: { os: string; browser: string; browserVersion: number; version: number; webworker: boolean; retina: boolean };
|
|
1452
|
+
graphics: { webgl: any; gpu: string };
|
|
1453
|
+
pixelRatio: number;
|
|
1454
|
+
agent: string;
|
|
1455
|
+
touchCapable: boolean;
|
|
1456
|
+
};
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
export = Orbix;
|
|
1460
|
+
export as namespace Orbix;
|