@expofp/renderer 1.4.1 → 1.5.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/index.d.ts CHANGED
@@ -2,6 +2,9 @@ import { default as default_2 } from 'stats-gl';
2
2
  import { Vector2 } from 'three';
3
3
  import { Vector2Like } from 'three';
4
4
  import { Vector2Tuple } from 'three';
5
+ import { Vector3 } from 'three';
6
+ import { Vector3Like } from 'three';
7
+ import { Vector3Tuple } from 'three';
5
8
  import { WebGLRenderer } from 'three';
6
9
 
7
10
  /** Camera state returned by {@link ControlsAPI.getCameraState}. */
@@ -136,6 +139,13 @@ export declare interface ControlsAPI {
136
139
  */
137
140
  export declare function createVector2(vector2: IVector2): Vector2;
138
141
 
142
+ /**
143
+ * Converts multiple vector3 representations to a {@link Vector3} instance.
144
+ * @param vector3 Vector3 representation as a tuple/POJO
145
+ * @returns Vector3 instance
146
+ */
147
+ export declare function createVector3(vector3: IVector3 | IVector2): Vector3;
148
+
139
149
  /**
140
150
  * Mapping of engine-wide events to their payloads
141
151
  */
@@ -252,6 +262,8 @@ export declare function isTextLayer(layer: LayerDef): layer is TypedLayerDef<Tex
252
262
 
253
263
  export declare type IVector2 = Vector2 | Vector2Like | Vector2Tuple;
254
264
 
265
+ export declare type IVector3 = Vector3 | Vector3Like | Vector3Tuple;
266
+
255
267
  /** Layer definition */
256
268
  export declare interface LayerDef extends SharedDef {
257
269
  /** Layer's name */
@@ -260,6 +272,8 @@ export declare interface LayerDef extends SharedDef {
260
272
  interactive?: boolean;
261
273
  /** Collection of layer's children. Mixing different types of children is not supported. */
262
274
  children: RenderableDefCollection;
275
+ /** Layer's rendering mode, 2d or 3d. Optional, 2d by default. */
276
+ mode?: "2d" | "3d";
263
277
  }
264
278
 
265
279
  /** Line definition */
@@ -303,14 +317,14 @@ export declare interface PitchHandlerOptions {
303
317
  /** Polygon shape instance. */
304
318
  export declare class Polygon {
305
319
  /** Array of polygon vertices. */
306
- readonly vertices: Vector2[];
320
+ readonly vertices: Vector3[];
307
321
  /** Array of polygon indices. Each index is a triplet of vertex indices forming a triangle. */
308
322
  readonly indices: Index[];
309
323
  /**
310
324
  * @param vertices Array of polygon vertices.
311
325
  * @param indices Array of polygon indices. Each index is a triplet of vertex indices forming a triangle.
312
326
  */
313
- constructor(vertices: IVector2[], indices: Index[]);
327
+ constructor(vertices: (IVector3 | IVector2)[], indices: Index[]);
314
328
  /**
315
329
  * Converts a {@link Rect} to a {@link Polygon}.
316
330
  * @param rect {@link Rect} instance
@@ -449,6 +463,14 @@ export declare class Renderer {
449
463
  * Main rendering loop
450
464
  */
451
465
  render(): void;
466
+ /**
467
+ * Stop the rendering loop
468
+ */
469
+ stop(): void;
470
+ /**
471
+ * Dispose all WebGL resources
472
+ */
473
+ dispose(): void;
452
474
  private resizeCanvasToDisplaySize;
453
475
  private updateMemoryInfo;
454
476
  private onContextLost;