@xeokit/xeokit-sdk 2.6.72 → 2.6.75
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/xeokit-sdk.cjs.js +985 -400
- package/dist/xeokit-sdk.es.js +980 -401
- package/dist/xeokit-sdk.es5.js +734 -714
- package/dist/xeokit-sdk.min.cjs.js +8 -8
- package/dist/xeokit-sdk.min.es.js +8 -8
- package/dist/xeokit-sdk.min.es5.js +7 -7
- package/package.json +1 -1
- package/src/extras/ContextMenu/ContextMenu.js +25 -16
- package/src/plugins/FastNavPlugin/FastNavPlugin.js +10 -0
- package/src/plugins/SkyboxesPlugin/SkyboxesPlugin.js +24 -49
- package/src/plugins/TreeViewPlugin/RenderService.js +13 -4
- package/src/plugins/TreeViewPlugin/TreeViewPlugin.js +1 -1
- package/src/viewer/Viewer.js +0 -16
- package/src/viewer/scene/CameraControl/lib/controllers/PivotController.js +29 -8
- package/src/viewer/scene/LineSet/LineSet.js +7 -2
- package/src/viewer/scene/skybox/Skybox.js +110 -9
- package/types/plugins/SkyboxesPlugin/SkyboxesPlugin.d.ts +18 -4
- package/types/viewer/scene/CameraControl/CameraControl.d.ts +168 -0
- package/types/viewer/scene/LineSet/LineSet.d.ts +1 -1
- package/types/viewer/scene/camera/CameraPath.d.ts +86 -6
- package/types/viewer/scene/camera/CameraPathAnimation.d.ts +2 -0
- package/types/viewer/scene/geometry/ReadableGeometry.d.ts +14 -0
- package/types/viewer/scene/geometry/VBOGeometry.d.ts +2 -0
- package/types/viewer/scene/geometry/index.d.ts +2 -1
- package/types/viewer/scene/geometry/loaders/index.d.ts +2 -0
- package/types/viewer/scene/geometry/loaders/load3DSGeometry.d.ts +17 -0
- package/types/viewer/scene/geometry/loaders/loadOBJGeometry.d.ts +18 -0
- package/types/viewer/scene/index.d.ts +2 -0
- package/types/viewer/scene/input/input.d.ts +117 -0
- package/types/viewer/scene/lights/AmbientLight.d.ts +41 -0
- package/types/viewer/scene/lights/CubeTexture.d.ts +27 -0
- package/types/viewer/scene/lights/DirLight.d.ts +77 -0
- package/types/viewer/scene/lights/LightMap.d.ts +27 -0
- package/types/viewer/scene/lights/PointLight.d.ts +135 -0
- package/types/viewer/scene/lights/ReflectionMap.d.ts +26 -0
- package/types/viewer/scene/lights/index.d.ts +4 -1
- package/types/viewer/scene/marker/Marker.d.ts +5 -0
- package/types/viewer/scene/materials/EmphasisMaterial.d.ts +5 -0
- package/types/viewer/scene/materials/Fresnel.d.ts +25 -62
- package/types/viewer/scene/materials/LambertMaterial.d.ts +192 -0
- package/types/viewer/scene/materials/MetallicMaterial.d.ts +359 -0
- package/types/viewer/scene/materials/PhongMaterial.d.ts +5 -0
- package/types/viewer/scene/materials/PointsMaterial.d.ts +5 -0
- package/types/viewer/scene/materials/SpecularMaterial.d.ts +342 -0
- package/types/viewer/scene/materials/Texture.d.ts +36 -78
- package/types/viewer/scene/materials/index.d.ts +2 -0
- package/types/viewer/scene/models/SceneModel.d.ts +134 -7
- package/types/viewer/scene/models/SceneModelEntity.d.ts +65 -0
- package/types/viewer/scene/models/SceneModelMesh.d.ts +12 -0
- package/types/viewer/scene/paths/CubicBezierCurve.d.ts +146 -0
- package/types/viewer/scene/paths/Curve.d.ts +75 -0
- package/types/viewer/scene/paths/Path.d.ts +119 -0
- package/types/viewer/scene/paths/QuadraticBezierCurve.d.ts +124 -0
- package/types/viewer/scene/paths/SplineCurve.d.ts +84 -0
- package/types/viewer/scene/paths/index.d.ts +5 -0
- package/types/viewer/scene/scene/Scene.d.ts +102 -0
- package/types/viewer/scene/sectionPlane/SectionPlane.d.ts +41 -0
- package/types/viewer/scene/skybox/Skybox.d.ts +59 -0
- package/types/viewer/scene/skybox/index.d.ts +1 -0
- package/types/viewer/scene/webgl/PickResult.d.ts +19 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component } from "../Component";
|
|
2
2
|
import { Entity } from "../Entity";
|
|
3
|
+
import { Material } from "../materials";
|
|
3
4
|
import { PickResult } from "../webgl/PickResult";
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -24,6 +25,9 @@ export declare class CameraControl extends Component {
|
|
|
24
25
|
AXIS_VIEW_FRONT: number;
|
|
25
26
|
AXIS_VIEW_TOP: number;
|
|
26
27
|
AXIS_VIEW_BOTTOM: number;
|
|
28
|
+
MOUSE_PAN: number;
|
|
29
|
+
MOUSE_ROTATE: number;
|
|
30
|
+
MOUSE_DOLLY: number;
|
|
27
31
|
|
|
28
32
|
/**
|
|
29
33
|
* Fires when the model is loaded
|
|
@@ -240,6 +244,65 @@ export declare class CameraControl extends Component {
|
|
|
240
244
|
*/
|
|
241
245
|
get active(): boolean;
|
|
242
246
|
|
|
247
|
+
/**
|
|
248
|
+
* Sets whether the pointer snap to vertex.
|
|
249
|
+
*
|
|
250
|
+
* @param {boolean} arg
|
|
251
|
+
*/
|
|
252
|
+
set snapToVertex(arg: boolean);
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Gets whether the pointer snap to vertex.
|
|
256
|
+
*
|
|
257
|
+
* @returns {boolean}
|
|
258
|
+
*/
|
|
259
|
+
get snapToVertex(): boolean;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Sets whether the pointer snap to edge.
|
|
263
|
+
*
|
|
264
|
+
* @param {boolean} arg
|
|
265
|
+
*/
|
|
266
|
+
set snapToEdge(arg: boolean);
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Gets whether the pointer snap to edge.
|
|
270
|
+
*
|
|
271
|
+
* @returns {boolean}
|
|
272
|
+
*/
|
|
273
|
+
get snapToEdge(): boolean;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Sets the current snap radius for "hoverSnapOrSurface" events, to specify whether the radius
|
|
277
|
+
* within which the pointer snaps to the nearest vertex or the nearest edge.
|
|
278
|
+
*
|
|
279
|
+
* Default value is 30 pixels.
|
|
280
|
+
*
|
|
281
|
+
* @param {Number} arg The snap radius.
|
|
282
|
+
*/
|
|
283
|
+
set snapRadius(arg: number);
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Gets the current snap radius.
|
|
287
|
+
*
|
|
288
|
+
* @returns {Number} The snap radius.
|
|
289
|
+
*/
|
|
290
|
+
get snapRadius(): number;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* If `true`, the keyboard shortcuts are enabled ONLY if the mouse is over the canvas.
|
|
294
|
+
*
|
|
295
|
+
* @param {boolean} arg
|
|
296
|
+
*/
|
|
297
|
+
set keyboardEnabledOnlyIfMouseover(arg: boolean);
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Gets whether the keyboard shortcuts are enabled ONLY if the mouse is over the canvas or ALWAYS.
|
|
301
|
+
*
|
|
302
|
+
* @returns {boolean}
|
|
303
|
+
*/
|
|
304
|
+
get keyboardEnabledOnlyIfMouseover(): boolean;
|
|
305
|
+
|
|
243
306
|
/**
|
|
244
307
|
* Sets whether the {@link Camera} follows the mouse/touch pointer.
|
|
245
308
|
*
|
|
@@ -502,6 +565,47 @@ export declare class CameraControl extends Component {
|
|
|
502
565
|
*/
|
|
503
566
|
get panInertia(): number;
|
|
504
567
|
|
|
568
|
+
/**
|
|
569
|
+
* Sets the keyboard layout.
|
|
570
|
+
*
|
|
571
|
+
* Supported layouts are:
|
|
572
|
+
*
|
|
573
|
+
* * ````"qwerty"```` (default)
|
|
574
|
+
* * ````"azerty"````
|
|
575
|
+
*
|
|
576
|
+
* @deprecated
|
|
577
|
+
* @param {String} arg Selects the keyboard layout.
|
|
578
|
+
*/
|
|
579
|
+
set keyboardLayout(arg: string);
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Gets the keyboard layout.
|
|
583
|
+
*
|
|
584
|
+
* Supported layouts are:
|
|
585
|
+
*
|
|
586
|
+
* * ````"qwerty"```` (default)
|
|
587
|
+
* * ````"azerty"````
|
|
588
|
+
*
|
|
589
|
+
* @deprecated
|
|
590
|
+
* @returns {String} The current keyboard layout.
|
|
591
|
+
*/
|
|
592
|
+
get keyboardLayout(): string;
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Sets a sphere as the representation of the pivot position.
|
|
596
|
+
*
|
|
597
|
+
* @param {Object} [cfg] Sphere configuration.
|
|
598
|
+
* @param {String} [cfg.size=1] Optional size factor of the sphere. Defaults to 1.
|
|
599
|
+
* @param {String} [cfg.material=PhongMaterial] Optional size factor of the sphere. Defaults to a red opaque material.
|
|
600
|
+
*/
|
|
601
|
+
enablePivotSphere(cfg: {size: number, material: Material}): void;
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Remove the sphere as the representation of the pivot position.
|
|
605
|
+
*
|
|
606
|
+
*/
|
|
607
|
+
disablePivotSphere(): void;
|
|
608
|
+
|
|
505
609
|
/**
|
|
506
610
|
* Sets whether mouse and touch input is enabled.
|
|
507
611
|
*
|
|
@@ -646,6 +750,34 @@ export declare class CameraControl extends Component {
|
|
|
646
750
|
*/
|
|
647
751
|
get panToPointer(): boolean;
|
|
648
752
|
|
|
753
|
+
/**
|
|
754
|
+
* Sets whether this ````CameraControl```` is in plan-view mode.
|
|
755
|
+
*
|
|
756
|
+
* When in plan-view mode, rotation is disabled.
|
|
757
|
+
*
|
|
758
|
+
* Default is ````false````.
|
|
759
|
+
*
|
|
760
|
+
* Deprecated - use {@link CameraControl#navMode} instead.
|
|
761
|
+
*
|
|
762
|
+
* @param {Boolean} arg Set ````true```` to enable plan-view mode.
|
|
763
|
+
* @deprecated
|
|
764
|
+
*/
|
|
765
|
+
set planView(arg: boolean);
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Gets whether this ````CameraControl```` is in plan-view mode.
|
|
769
|
+
*
|
|
770
|
+
* When in plan-view mode, rotation is disabled.
|
|
771
|
+
*
|
|
772
|
+
* Default is ````false````.
|
|
773
|
+
*
|
|
774
|
+
* Deprecated - use {@link CameraControl#navMode} instead.
|
|
775
|
+
*
|
|
776
|
+
* @returns {Boolean} Returns ````true```` if plan-view mode is enabled.
|
|
777
|
+
* @deprecated
|
|
778
|
+
*/
|
|
779
|
+
get planView(): boolean;
|
|
780
|
+
|
|
649
781
|
/**
|
|
650
782
|
* Sets whether this ````CameraControl```` is in first-person mode.
|
|
651
783
|
*
|
|
@@ -701,4 +833,40 @@ export declare class CameraControl extends Component {
|
|
|
701
833
|
* @returns {Boolean} Returns ````true```` when pivoting by default about the selected point on the virtual sphere, or ````false```` when pivoting by default about {@link Camera.look}.
|
|
702
834
|
*/
|
|
703
835
|
get smartPivot(): boolean;
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* Sets the double click time frame length in milliseconds.
|
|
839
|
+
*
|
|
840
|
+
* If two mouse click events occur within this time frame, it is considered a double click.
|
|
841
|
+
*
|
|
842
|
+
* Default is ````250````
|
|
843
|
+
*
|
|
844
|
+
* @param {Number} arg New double click time frame.
|
|
845
|
+
*/
|
|
846
|
+
set doubleClickTimeFrame(arg: number);
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* Gets the double click time frame length in milliseconds.
|
|
850
|
+
*
|
|
851
|
+
* Default is ````250````
|
|
852
|
+
*
|
|
853
|
+
* @returns {Number} Current double click time frame.
|
|
854
|
+
*/
|
|
855
|
+
get doubleClickTimeFrame(): number;
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* Sets whether to zoom the camera on mouse wheel
|
|
859
|
+
*
|
|
860
|
+
* Default is ````true````
|
|
861
|
+
*
|
|
862
|
+
* @param {Boolean} arg
|
|
863
|
+
*/
|
|
864
|
+
set zoomOnMouseWheel(arg: boolean);
|
|
865
|
+
|
|
866
|
+
/**
|
|
867
|
+
* Gets whether to zoom the camera on mouse wheel
|
|
868
|
+
*
|
|
869
|
+
* @returns {Boolean}
|
|
870
|
+
*/
|
|
871
|
+
get zoomOnMouseWheel(): boolean;
|
|
704
872
|
}
|
|
@@ -66,7 +66,7 @@ export declare class LineSet extends Component {
|
|
|
66
66
|
* @param {string} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
|
|
67
67
|
* @param {number[]} cfg.positions World-space 3D vertex positions.
|
|
68
68
|
* @param {number[]} [cfg.indices] Indices to connect ````positions```` into line segments. Note that these are separate line segments, not a polyline.
|
|
69
|
-
* @param {number[]} [cfg.color=[
|
|
69
|
+
* @param {number[]} [cfg.color=[1,1,1]] The color of this ````LineSet````. This is both emissive and diffuse.
|
|
70
70
|
* @param {boolean} [cfg.visible=true] Indicates whether or not this ````LineSet```` is visible.
|
|
71
71
|
* @param {number} [cfg.opacity=1.0] ````LineSet````'s initial opacity factor.
|
|
72
72
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Component } from "../Component";
|
|
2
|
+
import { SplineCurve } from '../paths/SplineCurve';
|
|
2
3
|
|
|
3
4
|
export declare type Frame = {
|
|
4
5
|
t: number;
|
|
@@ -19,10 +20,89 @@ export declare type CameraPathConfiguration = {
|
|
|
19
20
|
*
|
|
20
21
|
*/
|
|
21
22
|
export declare class CameraPath extends Component {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
/**
|
|
24
|
+
* @constructor
|
|
25
|
+
* @param {Component} [owner] Owner component. When destroyed, the owner will destroy this CameraPath as well.
|
|
26
|
+
* @param {CameraPathConfiguration} [cfg] Configuration
|
|
27
|
+
*/
|
|
28
|
+
constructor(owner?: Component, cfg?: CameraPathConfiguration);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Gets the camera frames in this CameraPath.
|
|
32
|
+
*
|
|
33
|
+
* @returns {{t:Number, eye:Object, look:Object, up: Object}[]} The frames on this CameraPath.
|
|
34
|
+
*/
|
|
35
|
+
get frames(): Frame[];
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Gets the {@link SplineCurve} along which {@link Camera#eye} travels.
|
|
39
|
+
* @returns {SplineCurve} The SplineCurve for {@link Camera#eye}.
|
|
40
|
+
*/
|
|
41
|
+
get eyeCurve(): SplineCurve;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Gets the {@link SplineCurve} along which {@link Camera#look} travels.
|
|
45
|
+
* @returns {SplineCurve} The SplineCurve for {@link Camera#look}.
|
|
46
|
+
*/
|
|
47
|
+
get lookCurve(): SplineCurve;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Gets the {@link SplineCurve} along which {@link Camera#up} travels.
|
|
51
|
+
* @returns {SplineCurve} The SplineCurve for {@link Camera#up}.
|
|
52
|
+
*/
|
|
53
|
+
get upCurve(): SplineCurve;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Adds a frame to this CameraPath, given as the current position of the {@link Camera}.
|
|
57
|
+
*
|
|
58
|
+
* @param {Number} t Time instant for the new frame.
|
|
59
|
+
*/
|
|
60
|
+
saveFrame(t: number): void;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Adds a frame to this CameraPath, specified as values for eye, look and up vectors at a given time instant.
|
|
64
|
+
*
|
|
65
|
+
* @param {Number} t Time instant for the new frame.
|
|
66
|
+
* @param {Number[]} eye A three-element vector specifying the eye position for the new frame.
|
|
67
|
+
* @param {Number[]} look A three-element vector specifying the look position for the new frame.
|
|
68
|
+
* @param {Number[]} up A three-element vector specifying the up vector for the new frame.
|
|
69
|
+
*/
|
|
70
|
+
addFrame(t: number, eye: number, look: number[], up: number[]): void;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Adds multiple frames to this CameraPath, each frame specified as a set of values for eye, look and up vectors at a given time instant.
|
|
74
|
+
*
|
|
75
|
+
* @param {{t:Number, eye:Object, look:Object, up: Object}[]} frames Frames to add to this CameraPath.
|
|
76
|
+
*/
|
|
77
|
+
addFrames(frames: Frame[]): void;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Sets the position of the {@link Camera} to a position interpolated within this CameraPath at the given time instant.
|
|
81
|
+
*
|
|
82
|
+
* @param {Number} t Time instant.
|
|
83
|
+
*/
|
|
84
|
+
loadFrame(t: number): void;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Gets eye, look and up vectors on this CameraPath at a given instant.
|
|
88
|
+
*
|
|
89
|
+
* @param {Number} t Time instant.
|
|
90
|
+
* @param {Number[]} eye The eye position to update.
|
|
91
|
+
* @param {Number[]} look The look position to update.
|
|
92
|
+
* @param {Number[]} up The up vector to update.
|
|
93
|
+
*/
|
|
94
|
+
sampleFrame(t: number, eye: number[], look: number[], up: number[]): void;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Given a total duration (in seconds) for this CameraPath, recomputes the time instant at each frame so that,
|
|
98
|
+
* when animated by {@link CameraPathAnimation}, the {@link Camera} will move along the path at a constant rate.
|
|
99
|
+
*
|
|
100
|
+
* @param {Number} duration The total duration for this CameraPath.
|
|
101
|
+
*/
|
|
102
|
+
smoothFrameTimes(duration: number): void;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Removes all frames from this CameraPath.
|
|
106
|
+
*/
|
|
107
|
+
clearFrames(): void;
|
|
28
108
|
}
|
|
@@ -88,8 +88,22 @@ export declare class ReadableGeometry extends Geometry {
|
|
|
88
88
|
*/
|
|
89
89
|
get obb(): number[];
|
|
90
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Returns the surface area of this Mesh.
|
|
93
|
+
* @returns {number}
|
|
94
|
+
*/
|
|
95
|
+
get surfaceArea(): number;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Returns the centroid of this Mesh.
|
|
99
|
+
* @returns {number}
|
|
100
|
+
*/
|
|
101
|
+
get centroid(): number;
|
|
102
|
+
|
|
91
103
|
/**
|
|
92
104
|
* Approximate number of triangles in this ReadableGeometry.
|
|
93
105
|
*/
|
|
94
106
|
get numTriangles(): number;
|
|
107
|
+
|
|
108
|
+
destroy(): void;
|
|
95
109
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {Scene} from '../../scene/Scene';
|
|
2
|
+
|
|
3
|
+
export declare type load3DSGeometryConfiguration = {
|
|
4
|
+
/** Path to 3DS file. */
|
|
5
|
+
src?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export declare type Geometry3DSData = {
|
|
9
|
+
src?: string;
|
|
10
|
+
primitive: string;
|
|
11
|
+
positions: number[];
|
|
12
|
+
normals: number[] | null;
|
|
13
|
+
uv: number[];
|
|
14
|
+
indices: number[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function load3DSGeometry(scene: Scene, cfg?: load3DSGeometryConfiguration) : Promise<Geometry3DSData>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {Scene} from '../../scene/Scene';
|
|
2
|
+
|
|
3
|
+
export declare type LoadObjGeometryConfiguration = {
|
|
4
|
+
/** Path to OBJ file. */
|
|
5
|
+
src?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export declare type ObjGeometryData = {
|
|
9
|
+
src?: string;
|
|
10
|
+
primitive: string;
|
|
11
|
+
positions: number[];
|
|
12
|
+
normals: number[] | null;
|
|
13
|
+
autoNormals: number[] | null;
|
|
14
|
+
uv: number[];
|
|
15
|
+
indices: number[]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function loadOBJGeometry(scene: Scene, cfg?: LoadObjGeometryConfiguration) : Promise<ObjGeometryData>;
|
|
@@ -12,9 +12,11 @@ export * from "./math/math";
|
|
|
12
12
|
export * from "./mementos";
|
|
13
13
|
export * from "./mesh";
|
|
14
14
|
export * from "./nodes";
|
|
15
|
+
export * from './paths';
|
|
15
16
|
export * from "./models";
|
|
16
17
|
export * from "./scene/Scene";
|
|
17
18
|
export * from "./sectionPlane";
|
|
19
|
+
export * from './skybox';
|
|
18
20
|
export * from "./stats";
|
|
19
21
|
export * from "./viewport";
|
|
20
22
|
export * from "./webgl";
|
|
@@ -10,6 +10,123 @@ import { Component } from "../Component";
|
|
|
10
10
|
*/
|
|
11
11
|
export declare class Input extends Component {
|
|
12
12
|
|
|
13
|
+
KEY_BACKSPACE: number;
|
|
14
|
+
KEY_TAB: number;
|
|
15
|
+
KEY_ENTER: number;
|
|
16
|
+
KEY_SHIFT: number;
|
|
17
|
+
KEY_CTRL: number;
|
|
18
|
+
KEY_ALT: number;
|
|
19
|
+
KEY_PAUSE_BREAK: number;
|
|
20
|
+
KEY_CAPS_LOCK: number;
|
|
21
|
+
KEY_ESCAPE: number;
|
|
22
|
+
KEY_PAGE_UP: number;
|
|
23
|
+
KEY_PAGE_DOWN: number;
|
|
24
|
+
KEY_END: number;
|
|
25
|
+
KEY_HOME: number;
|
|
26
|
+
KEY_LEFT_ARROW: number;
|
|
27
|
+
KEY_UP_ARROW: number;
|
|
28
|
+
KEY_RIGHT_ARROW: number;
|
|
29
|
+
KEY_DOWN_ARROW: number;
|
|
30
|
+
KEY_INSERT: number;
|
|
31
|
+
KEY_DELETE: number;
|
|
32
|
+
KEY_NUM_0: number;
|
|
33
|
+
KEY_NUM_1: number;
|
|
34
|
+
KEY_NUM_2: number;
|
|
35
|
+
KEY_NUM_3: number;
|
|
36
|
+
KEY_NUM_4: number;
|
|
37
|
+
KEY_NUM_5: number;
|
|
38
|
+
KEY_NUM_6: number;
|
|
39
|
+
KEY_NUM_7: number;
|
|
40
|
+
KEY_NUM_8: number;
|
|
41
|
+
KEY_NUM_9: number;
|
|
42
|
+
KEY_A: number;
|
|
43
|
+
KEY_B: number;
|
|
44
|
+
KEY_C: number;
|
|
45
|
+
KEY_D: number;
|
|
46
|
+
KEY_E: number;
|
|
47
|
+
KEY_F: number;
|
|
48
|
+
KEY_G: number;
|
|
49
|
+
KEY_H: number;
|
|
50
|
+
KEY_I: number;
|
|
51
|
+
KEY_J: number;
|
|
52
|
+
KEY_K: number;
|
|
53
|
+
KEY_L: number;
|
|
54
|
+
KEY_M: number;
|
|
55
|
+
KEY_N: number;
|
|
56
|
+
KEY_O: number;
|
|
57
|
+
KEY_P: number;
|
|
58
|
+
KEY_Q: number;
|
|
59
|
+
KEY_R: number;
|
|
60
|
+
KEY_S: number;
|
|
61
|
+
KEY_T: number;
|
|
62
|
+
KEY_U: number;
|
|
63
|
+
KEY_V: number;
|
|
64
|
+
KEY_W: number;
|
|
65
|
+
KEY_X: number;
|
|
66
|
+
KEY_Y: number;
|
|
67
|
+
KEY_Z: number;
|
|
68
|
+
KEY_LEFT_WINDOW: number;
|
|
69
|
+
KEY_RIGHT_WINDOW: number;
|
|
70
|
+
KEY_SELECT_KEY: number;
|
|
71
|
+
KEY_NUMPAD_0: number;
|
|
72
|
+
KEY_NUMPAD_1: number;
|
|
73
|
+
KEY_NUMPAD_2: number;
|
|
74
|
+
KEY_NUMPAD_3: number;
|
|
75
|
+
KEY_NUMPAD_4: number;
|
|
76
|
+
KEY_NUMPAD_5: number;
|
|
77
|
+
KEY_NUMPAD_6: number;
|
|
78
|
+
KEY_NUMPAD_7: number;
|
|
79
|
+
KEY_NUMPAD_8: number;
|
|
80
|
+
KEY_NUMPAD_9: number;
|
|
81
|
+
KEY_MULTIPLY: number;
|
|
82
|
+
KEY_ADD: number;
|
|
83
|
+
KEY_SUBTRACT: number;
|
|
84
|
+
KEY_DECIMAL_POINT: number;
|
|
85
|
+
KEY_DIVIDE: number;
|
|
86
|
+
KEY_F1: number;
|
|
87
|
+
KEY_F2: number;
|
|
88
|
+
KEY_F3: number;
|
|
89
|
+
KEY_F4: number;
|
|
90
|
+
KEY_F5: number;
|
|
91
|
+
KEY_F6: number;
|
|
92
|
+
KEY_F7: number;
|
|
93
|
+
KEY_F8: number;
|
|
94
|
+
KEY_F9: number;
|
|
95
|
+
KEY_F10: number;
|
|
96
|
+
KEY_F11: number;
|
|
97
|
+
KEY_F12: number;
|
|
98
|
+
KEY_NUM_LOCK: number;
|
|
99
|
+
KEY_SCROLL_LOCK: number;
|
|
100
|
+
KEY_SEMI_COLON: number;
|
|
101
|
+
KEY_EQUAL_SIGN: number;
|
|
102
|
+
KEY_COMMA: number;
|
|
103
|
+
KEY_DASH: number;
|
|
104
|
+
KEY_PERIOD: number;
|
|
105
|
+
KEY_FORWARD_SLASH: number;
|
|
106
|
+
KEY_GRAVE_ACCENT: number;
|
|
107
|
+
KEY_OPEN_BRACKET: number;
|
|
108
|
+
KEY_BACK_SLASH: number;
|
|
109
|
+
KEY_CLOSE_BRACKET: number;
|
|
110
|
+
KEY_SINGLE_QUOTE: number;
|
|
111
|
+
KEY_SPACE: number;
|
|
112
|
+
MOUSE_LEFT_BUTTON: number;
|
|
113
|
+
MOUSE_MIDDLE_BUTTON: number;
|
|
114
|
+
MOUSE_RIGHT_BUTTON: number;
|
|
115
|
+
|
|
116
|
+
element: HTMLCanvasElement;
|
|
117
|
+
|
|
118
|
+
altDown: boolean;
|
|
119
|
+
ctrlDown: boolean;
|
|
120
|
+
mouseDownLeft: boolean;
|
|
121
|
+
mouseDownMiddle: boolean;
|
|
122
|
+
mouseDownRight: boolean;
|
|
123
|
+
keyDown: boolean[];
|
|
124
|
+
enabled: boolean;
|
|
125
|
+
keyboardEnabled: boolean;
|
|
126
|
+
mouseover: boolean;
|
|
127
|
+
mouseCanvasPos: number[];
|
|
128
|
+
|
|
129
|
+
|
|
13
130
|
/**
|
|
14
131
|
* Sets whether input handlers are enabled.
|
|
15
132
|
*/
|
|
@@ -16,4 +16,45 @@ export declare class AmbientLight extends Light {
|
|
|
16
16
|
* @param {AmbientLightConfiguration} [cfg] AmbientLight configuration
|
|
17
17
|
*/
|
|
18
18
|
constructor(owner: Component, cfg: AmbientLightConfiguration);
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Sets the RGB color of this AmbientLight.
|
|
22
|
+
*
|
|
23
|
+
* Default value is ````[0.7, 0.7, 0.8]````.
|
|
24
|
+
*
|
|
25
|
+
* @param {Number[]} color The AmbientLight's RGB color.
|
|
26
|
+
*/
|
|
27
|
+
set color(color: number[]);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Gets the RGB color of this AmbientLight.
|
|
31
|
+
*
|
|
32
|
+
* Default value is ````[0.7, 0.7, 0.8]````.
|
|
33
|
+
*
|
|
34
|
+
* @returns {Number[]} The AmbientLight's RGB color.
|
|
35
|
+
*/
|
|
36
|
+
get color(): number;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Sets the intensity of this AmbientLight.
|
|
40
|
+
*
|
|
41
|
+
* Default value is ````1.0```` for maximum intensity.
|
|
42
|
+
*
|
|
43
|
+
* @param {Number} intensity The AmbientLight's intensity.
|
|
44
|
+
*/
|
|
45
|
+
set intensity(intensity: number);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Gets the intensity of this AmbientLight.
|
|
49
|
+
*
|
|
50
|
+
* Default value is ````1.0```` for maximum intensity.
|
|
51
|
+
*
|
|
52
|
+
* @returns {Number} The AmbientLight's intensity.
|
|
53
|
+
*/
|
|
54
|
+
get intensity(): number;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Destroys this AmbientLight.
|
|
58
|
+
*/
|
|
59
|
+
destroy(): void;
|
|
19
60
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Component } from '../Component';
|
|
2
|
+
|
|
3
|
+
export declare type CubeTextureConfiguration = {
|
|
4
|
+
/**Optional ID for this CubeTexture, unique among all components in the parent scene, generated automatically when omitted. */
|
|
5
|
+
id?: string;
|
|
6
|
+
/**Paths to six image files to load into this CubeTexture. */
|
|
7
|
+
src: string[];
|
|
8
|
+
/**Flips this CubeTexture's source data along its vertical axis when true. */
|
|
9
|
+
flipY?: boolean;
|
|
10
|
+
/**Encoding format. Supported values are {@link LinearEncoding} and {@link sRGBEncoding}. */
|
|
11
|
+
encoding?: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export declare class CubeTexture extends Component {
|
|
15
|
+
/**
|
|
16
|
+
* @constructor
|
|
17
|
+
* @param {Component} owner Owner component. When destroyed, the owner will destroy this component as well.
|
|
18
|
+
* @param {CubeTextureConfiguration} [cfg] Configs
|
|
19
|
+
*/
|
|
20
|
+
constructor(owner: Component, cfg?: CubeTextureConfiguration);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Destroys this CubeTexture
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
destroy(): void;
|
|
27
|
+
}
|
|
@@ -22,4 +22,81 @@ export declare class DirLight extends Light {
|
|
|
22
22
|
* @param {DirLightConfiguration} [cfg] DirLight configuration
|
|
23
23
|
*/
|
|
24
24
|
constructor(owner: Component, cfg: DirLightConfiguration);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Sets the direction in which the DirLight is shining.
|
|
28
|
+
*
|
|
29
|
+
* Default value is ````[1.0, 1.0, 1.0]````.
|
|
30
|
+
*
|
|
31
|
+
* @param {Number[]} value The direction vector.
|
|
32
|
+
*/
|
|
33
|
+
set dir(value: number);
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Gets the direction in which the DirLight is shining.
|
|
37
|
+
*
|
|
38
|
+
* Default value is ````[1.0, 1.0, 1.0]````.
|
|
39
|
+
*
|
|
40
|
+
* @returns {Number[]} The direction vector.
|
|
41
|
+
*/
|
|
42
|
+
get dir(): number;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Sets the RGB color of this DirLight.
|
|
46
|
+
*
|
|
47
|
+
* Default value is ````[0.7, 0.7, 0.8]````.
|
|
48
|
+
*
|
|
49
|
+
* @param {Number[]} color The DirLight's RGB color.
|
|
50
|
+
*/
|
|
51
|
+
set color(color: number[]);
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Gets the RGB color of this DirLight.
|
|
55
|
+
*
|
|
56
|
+
* Default value is ````[0.7, 0.7, 0.8]````.
|
|
57
|
+
*
|
|
58
|
+
* @returns {Number[]} The DirLight's RGB color.
|
|
59
|
+
*/
|
|
60
|
+
get color(): number[];
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Sets the intensity of this DirLight.
|
|
64
|
+
*
|
|
65
|
+
* Default intensity is ````1.0```` for maximum intensity.
|
|
66
|
+
*
|
|
67
|
+
* @param {Number} intensity The DirLight's intensity
|
|
68
|
+
*/
|
|
69
|
+
set intensity(intensity: number);
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Gets the intensity of this DirLight.
|
|
73
|
+
*
|
|
74
|
+
* Default value is ````1.0```` for maximum intensity.
|
|
75
|
+
*
|
|
76
|
+
* @returns {Number} The DirLight's intensity.
|
|
77
|
+
*/
|
|
78
|
+
get intensity(): number;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Sets if this DirLight casts a shadow.
|
|
82
|
+
*
|
|
83
|
+
* Default value is ````false````.
|
|
84
|
+
*
|
|
85
|
+
* @param {Boolean} castsShadow Set ````true```` to cast shadows.
|
|
86
|
+
*/
|
|
87
|
+
set castsShadow(castsShadow: boolean);
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Gets if this DirLight casts a shadow.
|
|
91
|
+
*
|
|
92
|
+
* Default value is ````false````.
|
|
93
|
+
*
|
|
94
|
+
* @returns {Boolean} ````true```` if this DirLight casts shadows.
|
|
95
|
+
*/
|
|
96
|
+
get castsShadow(): boolean;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Destroys this DirLight.
|
|
100
|
+
*/
|
|
101
|
+
destroy(): void;
|
|
25
102
|
}
|