@openglobus/og 0.15.1 → 0.15.2
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/README.md +10 -4
- package/css/og.css +44 -45
- package/dist/@openglobus/og.css +1 -1
- package/dist/@openglobus/og.esm.js +2 -2
- package/dist/@openglobus/og.esm.js.map +1 -1
- package/dist/@openglobus/og.umd.js +2 -2
- package/dist/@openglobus/og.umd.js.map +1 -1
- package/package.json +12 -12
- package/src/og/Clock.js +1 -1
- package/src/og/Events.js +1 -1
- package/src/og/Extent.js +1 -1
- package/src/og/Globe.js +3 -5
- package/src/og/Popup.js +38 -63
- package/src/og/astro/earth.js +2 -2
- package/src/og/astro/rotation.js +2 -2
- package/src/og/bv/Box.js +1 -0
- package/src/og/bv/index.js +1 -1
- package/src/og/camera/Camera.js +4 -4
- package/src/og/camera/PlanetCamera.js +26 -6
- package/src/og/camera/index.js +1 -1
- package/src/og/control/Atmosphere.js +3 -8
- package/src/og/control/CompassButton.js +4 -5
- package/src/og/control/EarthCoordinates.js +3 -2
- package/src/og/control/EarthNavigation.js +0 -1
- package/src/og/control/GeoImageDragControl.js +2 -2
- package/src/og/control/KeyboardNavigation.js +3 -2
- package/src/og/control/LayerAnimation.js +2 -2
- package/src/og/control/LayerSwitcher.js +5 -4
- package/src/og/control/Lighting.js +106 -35
- package/src/og/control/MouseNavigation.js +4 -4
- package/src/og/control/MouseWheelZoomControl.js +2 -2
- package/src/og/control/RulerSwitcher.js +4 -3
- package/src/og/control/ScaleControl.js +2 -2
- package/src/og/control/ShowFps.js +2 -1
- package/src/og/control/SimpleNavigation.js +2 -1
- package/src/og/control/SimpleSkyBackground.js +2 -2
- package/src/og/control/Sun.js +8 -1
- package/src/og/control/ToggleWireframe.js +2 -1
- package/src/og/control/TouchNavigation.js +4 -3
- package/src/og/control/ZoomControl.js +6 -5
- package/src/og/control/index.js +10 -10
- package/src/og/control/ruler/RulerScene.js +19 -11
- package/src/og/control/selection/Selection.js +1 -1
- package/src/og/control/selection/SelectionScene.js +5 -8
- package/src/og/control/timeline/TimelineControl.js +3 -4
- package/src/og/control/timeline/TimelineModel.js +2 -2
- package/src/og/control/timeline/TimelineView.js +10 -5
- package/src/og/control/visibleExtent/Segment.js +5 -5
- package/src/og/control/visibleExtent/VisibleExtent.js +1 -1
- package/src/og/ellipsoid/Ellipsoid.js +3 -3
- package/src/og/entity/BaseBillboard.js +2 -2
- package/src/og/entity/BillboardHandler.js +10 -2
- package/src/og/entity/Entity.js +10 -51
- package/src/og/entity/EntityCollection.js +3 -20
- package/src/og/entity/GeoObject.js +2 -4
- package/src/og/entity/GeoObjectHandler.js +12 -11
- package/src/og/entity/Geometry.js +2 -2
- package/src/og/entity/GeometryHandler.js +2 -2
- package/src/og/entity/Label.js +2 -2
- package/src/og/entity/LabelHandler.js +7 -5
- package/src/og/entity/Polyline.js +8 -7
- package/src/og/entity/Ray.js +1 -2
- package/src/og/entity/RayHandler.js +4 -0
- package/src/og/entity/Strip.js +8 -5
- package/src/og/entity/index.js +1 -1
- package/src/og/index.core.js +4 -4
- package/src/og/index.js +4 -4
- package/src/og/index.webgl.js +3 -3
- package/src/og/layer/BaseGeoImage.js +2 -2
- package/src/og/layer/GeoImage.js +2 -2
- package/src/og/layer/GeoTexture2d.js +1 -1
- package/src/og/layer/Layer.js +3 -3
- package/src/og/layer/Vector.js +7 -11
- package/src/og/layer/WMS.js +2 -1
- package/src/og/layer/XYZ.js +2 -4
- package/src/og/math/Line3.js +0 -1
- package/src/og/math/Plane.js +0 -1
- package/src/og/math/Ray.js +0 -1
- package/src/og/math/Vec2.js +62 -62
- package/src/og/math/Vec3.js +1 -1
- package/src/og/math/Vec4.js +1 -1
- package/src/og/math/index.js +1 -1
- package/src/og/proj/EPSG3857.js +1 -1
- package/src/og/proj/EPSG4326.js +1 -1
- package/src/og/quadTree/EarthQuadTreeStrategy.js +4 -4
- package/src/og/quadTree/MarsQuadTreeStrategy.js +4 -4
- package/src/og/quadTree/Node.js +1 -1
- package/src/og/quadTree/Wgs84QuadTreeStrategy.js +4 -4
- package/src/og/quadTree/index.js +2 -2
- package/src/og/renderer/Renderer.js +196 -77
- package/src/og/renderer/RendererEvents.js +35 -10
- package/src/og/scene/Axes.js +2 -2
- package/src/og/scene/Planet.js +47 -75
- package/src/og/scene/RenderNode.js +2 -13
- package/src/og/scene/SkyBox.js +1 -1
- package/src/og/scene/index.js +2 -2
- package/src/og/segment/Segment.js +5 -5
- package/src/og/segment/SegmentLonLatWgs84.js +2 -3
- package/src/og/shaders/drawnode.js +5 -1
- package/src/og/shaders/geoObject.js +2 -6
- package/src/og/shaders/pickingMask.js +31 -0
- package/src/og/terrain/BilTerrain.js +4 -4
- package/src/og/terrain/GlobusTerrain.js +7 -7
- package/src/og/terrain/MapboxTerrain.js +2 -2
- package/src/og/terrain/index.js +2 -2
- package/src/og/ui/Button.js +5 -4
- package/src/og/ui/Dialog.js +3 -6
- package/src/og/ui/Slider.js +29 -3
- package/src/og/ui/View.js +5 -5
- package/src/og/ui/icons.js +3 -0
- package/src/og/utils/FontAtlas.js +2 -2
- package/src/og/utils/GeoImageCreator.js +0 -1
- package/src/og/utils/NormalMapCreator.js +6 -5
- package/src/og/utils/TerrainWorker.js +1 -1
- package/src/og/utils/VectorTileCreator.js +4 -4
- package/src/og/utils/shared.js +1 -1
- package/src/og/webgl/Framebuffer.js +3 -1
- package/src/og/webgl/Handler.js +77 -62
- package/src/og/webgl/Multisample.js +18 -7
- package/src/og/webgl/Program.js +2 -2
- package/src/og/webgl/index.js +2 -2
- package/types/Popup.d.ts +8 -21
- package/types/camera/PlanetCamera.d.ts +1 -0
- package/types/control/Sun.d.ts +1 -0
- package/types/control/ruler/RulerScene.d.ts +4 -3
- package/types/entity/Entity.d.ts +2 -19
- package/types/entity/EntityCollection.d.ts +0 -7
- package/types/math/Vec2.d.ts +95 -95
- package/types/renderer/Renderer.d.ts +28 -16
- package/types/scene/Planet.d.ts +2 -7
- package/types/shaders/pickingMask.d.ts +2 -0
- package/types/ui/Slider.d.ts +3 -0
- package/types/ui/View.d.ts +1 -0
- package/types/ui/icons.d.ts +1 -0
- package/types/webgl/Framebuffer.d.ts +1 -0
- package/types/webgl/Handler.d.ts +3 -2
- package/src/og/entity/ShapeHandler.js +0 -99
- package/src/og/shaders/shape.js +0 -135
- package/src/og/shapes/BaseShape.js +0 -557
- package/src/og/shapes/Icosphere.js +0 -179
- package/src/og/shapes/Sphere.js +0 -100
- package/types/entity/ShapeHandler.d.ts +0 -22
- package/types/shaders/shape.d.ts +0 -4
- package/types/shapes/BaseShape.d.ts +0 -250
- package/types/shapes/Sphere.d.ts +0 -41
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module og/shape/BaseShape
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
"use strict";
|
|
6
|
-
|
|
7
|
-
import { BaseShape } from "./BaseShape.js";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @class
|
|
11
|
-
* @extends {BaseShape}
|
|
12
|
-
* @param {Object} options - Icosphere parameters:
|
|
13
|
-
* @param {Vec3} [options.position] - Icosphere position.
|
|
14
|
-
* @param {Quat} [options.orientation] - Icosphere orientation(rotation).
|
|
15
|
-
* @param {Vec3} [options.scale] - Scale vector.
|
|
16
|
-
* @param {Array.<number>} [options.color] - Icosphere RGBA color. (exactly 4 entries)
|
|
17
|
-
* @param {string} [options.src] - Texture image url source.
|
|
18
|
-
* @param {boolean} [options.visibility] - Icosphere visibility.
|
|
19
|
-
* @param {number} [options.size] - Icosphere radius.
|
|
20
|
-
* @param {number} [options.level] - Icosphere complexity level.
|
|
21
|
-
*/
|
|
22
|
-
class Icosphere extends BaseShape {
|
|
23
|
-
constructor(options) {
|
|
24
|
-
super(options);
|
|
25
|
-
/**
|
|
26
|
-
* Icosphere radius.
|
|
27
|
-
* @protected
|
|
28
|
-
* @type {number}
|
|
29
|
-
*/
|
|
30
|
-
this._size = options.size || 1.0;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Icosphere recursion level.
|
|
34
|
-
* @protected
|
|
35
|
-
* @type {number}
|
|
36
|
-
*/
|
|
37
|
-
this._level = options.level || 0;
|
|
38
|
-
|
|
39
|
-
this._index = 0;
|
|
40
|
-
this._middlePointIndexCache = {};
|
|
41
|
-
|
|
42
|
-
this._createData();
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// add vertex to mesh, fix position to be on unit sphere, return index
|
|
46
|
-
_addVertex(p) {
|
|
47
|
-
var length = Math.sqrt(p[0] * p[0] + p[1] * p[1] + p[2] * p[2]);
|
|
48
|
-
this._positionData.push(
|
|
49
|
-
(this._size * p[0]) / length,
|
|
50
|
-
(this._size * p[1]) / length,
|
|
51
|
-
(this._size * p[2]) / length
|
|
52
|
-
);
|
|
53
|
-
return this._index++;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// return index of point in the middle of p1 and p2
|
|
57
|
-
_getMiddlePoint(p1, p2) {
|
|
58
|
-
// first check if we have it already
|
|
59
|
-
var firstIsSmaller = p1 < p2;
|
|
60
|
-
var smallerIndex = firstIsSmaller ? p1 : p2;
|
|
61
|
-
var greaterIndex = firstIsSmaller ? p2 : p1;
|
|
62
|
-
|
|
63
|
-
var key = smallerIndex + "_" + greaterIndex;
|
|
64
|
-
|
|
65
|
-
var ret = this._middlePointIndexCache[key];
|
|
66
|
-
if (ret) {
|
|
67
|
-
return ret;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
var point1 = [
|
|
71
|
-
this._positionData[p1 * 3],
|
|
72
|
-
this._positionData[p1 * 3 + 1],
|
|
73
|
-
this._positionData[p1 * 3 + 2]
|
|
74
|
-
];
|
|
75
|
-
var point2 = [
|
|
76
|
-
this._positionData[p2 * 3],
|
|
77
|
-
this._positionData[p2 * 3 + 1],
|
|
78
|
-
this._positionData[p2 * 3 + 2]
|
|
79
|
-
];
|
|
80
|
-
var middle = [
|
|
81
|
-
(point1[0] + point2[0]) / 2.0,
|
|
82
|
-
(point1[1] + point2[1]) / 2.0,
|
|
83
|
-
(point1[2] + point2[2]) / 2.0
|
|
84
|
-
];
|
|
85
|
-
|
|
86
|
-
// add vertex makes sure point is on unit sphere
|
|
87
|
-
var i = this._addVertex(middle);
|
|
88
|
-
this._middlePointIndexCache[key] = i;
|
|
89
|
-
return i;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Create specific shape vertices data.
|
|
94
|
-
* @protected
|
|
95
|
-
* @virtual
|
|
96
|
-
*/
|
|
97
|
-
_createData() {
|
|
98
|
-
this._positionData = [];
|
|
99
|
-
this._indexData = [];
|
|
100
|
-
this._index = 0;
|
|
101
|
-
this._middlePointIndexCache = {};
|
|
102
|
-
|
|
103
|
-
// create 12 vertices of a icosahedron
|
|
104
|
-
var t = (1.0 + Math.sqrt(5.0)) / 2.0;
|
|
105
|
-
|
|
106
|
-
this._addVertex([-1, t, 0]);
|
|
107
|
-
this._addVertex([1, t, 0]);
|
|
108
|
-
this._addVertex([-1, -t, 0]);
|
|
109
|
-
this._addVertex([1, -t, 0]);
|
|
110
|
-
|
|
111
|
-
this._addVertex([0, -1, t]);
|
|
112
|
-
this._addVertex([0, 1, t]);
|
|
113
|
-
this._addVertex([0, -1, -t]);
|
|
114
|
-
this._addVertex([0, 1, -t]);
|
|
115
|
-
|
|
116
|
-
this._addVertex([t, 0, -1]);
|
|
117
|
-
this._addVertex([t, 0, 1]);
|
|
118
|
-
this._addVertex([-t, 0, -1]);
|
|
119
|
-
this._addVertex([-t, 0, 1]);
|
|
120
|
-
|
|
121
|
-
// create 20 triangles of the icosahedron
|
|
122
|
-
var faces = [];
|
|
123
|
-
|
|
124
|
-
// 5 faces around point 0
|
|
125
|
-
faces.push([0, 11, 5]);
|
|
126
|
-
faces.push([0, 5, 1]);
|
|
127
|
-
faces.push([0, 1, 7]);
|
|
128
|
-
faces.push([0, 7, 10]);
|
|
129
|
-
faces.push([0, 10, 11]);
|
|
130
|
-
|
|
131
|
-
// 5 adjacent faces
|
|
132
|
-
faces.push([1, 5, 9]);
|
|
133
|
-
faces.push([5, 11, 4]);
|
|
134
|
-
faces.push([11, 10, 2]);
|
|
135
|
-
faces.push([10, 7, 6]);
|
|
136
|
-
faces.push([7, 1, 8]);
|
|
137
|
-
|
|
138
|
-
// 5 faces around point 3
|
|
139
|
-
faces.push([3, 9, 4]);
|
|
140
|
-
faces.push([3, 4, 2]);
|
|
141
|
-
faces.push([3, 2, 6]);
|
|
142
|
-
faces.push([3, 6, 8]);
|
|
143
|
-
faces.push([3, 8, 9]);
|
|
144
|
-
|
|
145
|
-
// 5 adjacent faces
|
|
146
|
-
faces.push([4, 9, 5]);
|
|
147
|
-
faces.push([2, 4, 11]);
|
|
148
|
-
faces.push([6, 2, 10]);
|
|
149
|
-
faces.push([8, 6, 7]);
|
|
150
|
-
faces.push([9, 8, 1]);
|
|
151
|
-
|
|
152
|
-
// refine triangles
|
|
153
|
-
for (let i = 0; i < this._level; i++) {
|
|
154
|
-
var faces2 = [];
|
|
155
|
-
for (let j = 0; j < faces.length; j++) {
|
|
156
|
-
let tri = faces[j];
|
|
157
|
-
// replace triangle by 4 triangles
|
|
158
|
-
var a = this._getMiddlePoint(tri[0], tri[1]);
|
|
159
|
-
var b = this._getMiddlePoint(tri[1], tri[2]);
|
|
160
|
-
var c = this._getMiddlePoint(tri[2], tri[0]);
|
|
161
|
-
|
|
162
|
-
faces2.push([tri[0], a, c]);
|
|
163
|
-
faces2.push([tri[1], b, a]);
|
|
164
|
-
faces2.push([tri[2], c, b]);
|
|
165
|
-
faces2.push([a, b, c]);
|
|
166
|
-
}
|
|
167
|
-
faces = faces2;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
for (let i = 0; i < faces.length; i++) {
|
|
171
|
-
let tri = faces[i];
|
|
172
|
-
this._indexData.push(tri[0]);
|
|
173
|
-
this._indexData.push(tri[1]);
|
|
174
|
-
this._indexData.push(tri[2]);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export { Icosphere };
|
package/src/og/shapes/Sphere.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module og/shape/BaseShape
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
"use strict";
|
|
6
|
-
|
|
7
|
-
import { BaseShape } from "./BaseShape.js";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* @class
|
|
11
|
-
* @extends {BaseShape}
|
|
12
|
-
* @param {Object} options - Sphere parameters:
|
|
13
|
-
* @param {Vec3} [options.position] - Sphere position.
|
|
14
|
-
* @param {Quat} [options.orientation] - Sphere orientation(rotation).
|
|
15
|
-
* @param {Vec3} [options.scale] - Scale vector.
|
|
16
|
-
* @param {Array.<number>} [options.color] - Sphere RGBA color. (exactly 4 entries)
|
|
17
|
-
* @param {string} [options.src] - Texture image url source.
|
|
18
|
-
* @param {boolean} [options.visibility] - Sphere visibility.
|
|
19
|
-
* @param {number} [options.radius=100] - Sphere radius.
|
|
20
|
-
* @param {number} [options.latBands=16] - Number of latitude bands.
|
|
21
|
-
* @param {number} [options.lonBands=16] - Number of longitude bands.
|
|
22
|
-
*/
|
|
23
|
-
class Sphere extends BaseShape {
|
|
24
|
-
constructor(options) {
|
|
25
|
-
super(options);
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Sphere radius.
|
|
29
|
-
* @protected
|
|
30
|
-
* @type {number}
|
|
31
|
-
*/
|
|
32
|
-
this._radius = options.radius || 1;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Number of latitude bands.
|
|
36
|
-
* @protected
|
|
37
|
-
* @type {number}
|
|
38
|
-
*/
|
|
39
|
-
this._latBands = options.latBands || 16;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Number of longitude bands.
|
|
43
|
-
* @protected
|
|
44
|
-
* @type {number}
|
|
45
|
-
*/
|
|
46
|
-
this._lonBands = options.lonBands || 16;
|
|
47
|
-
|
|
48
|
-
//BUG: virtual method in constructor
|
|
49
|
-
this._createData();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Create specific shape vertices data.
|
|
54
|
-
* @protected
|
|
55
|
-
* @virtual
|
|
56
|
-
*/
|
|
57
|
-
_createData() {
|
|
58
|
-
for (let latNumber = 0; latNumber <= this._latBands; latNumber++) {
|
|
59
|
-
var theta = (latNumber * Math.PI) / this._latBands;
|
|
60
|
-
var sinTheta = Math.sin(theta);
|
|
61
|
-
var cosTheta = Math.cos(theta);
|
|
62
|
-
|
|
63
|
-
for (let longNumber = 0; longNumber <= this._lonBands; longNumber++) {
|
|
64
|
-
var phi = (longNumber * 2 * Math.PI) / this._lonBands;
|
|
65
|
-
var sinPhi = Math.sin(phi);
|
|
66
|
-
var cosPhi = Math.cos(phi);
|
|
67
|
-
var x = cosPhi * sinTheta;
|
|
68
|
-
var y = cosTheta;
|
|
69
|
-
var z = sinPhi * sinTheta;
|
|
70
|
-
var u = 1 - longNumber / this._lonBands;
|
|
71
|
-
var v = latNumber / this._latBands;
|
|
72
|
-
this._normalData.push(x);
|
|
73
|
-
this._normalData.push(y);
|
|
74
|
-
this._normalData.push(z);
|
|
75
|
-
this._textureCoordData.push(u);
|
|
76
|
-
this._textureCoordData.push(v);
|
|
77
|
-
this._positionData.push(this._radius * x);
|
|
78
|
-
this._positionData.push(this._radius * y);
|
|
79
|
-
this._positionData.push(this._radius * z);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
for (let latNumber = 0; latNumber < this._latBands; latNumber++) {
|
|
84
|
-
for (let longNumber = 0; longNumber < this._lonBands; longNumber++) {
|
|
85
|
-
var first = latNumber * (this._lonBands + 1) + longNumber;
|
|
86
|
-
var second = first + this._lonBands + 1;
|
|
87
|
-
|
|
88
|
-
this._indexData.push(first);
|
|
89
|
-
this._indexData.push(first + 1);
|
|
90
|
-
this._indexData.push(second);
|
|
91
|
-
|
|
92
|
-
this._indexData.push(second);
|
|
93
|
-
this._indexData.push(first + 1);
|
|
94
|
-
this._indexData.push(second + 1);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export { Sphere };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export class ShapeHandler {
|
|
2
|
-
static set _staticCounter(arg: any);
|
|
3
|
-
static get _staticCounter(): any;
|
|
4
|
-
constructor(entityCollection: any);
|
|
5
|
-
/**
|
|
6
|
-
* Picking rendering option.
|
|
7
|
-
* @public
|
|
8
|
-
* @type {boolean}
|
|
9
|
-
*/
|
|
10
|
-
public pickingEnabled: boolean;
|
|
11
|
-
_entityCollection: any;
|
|
12
|
-
_renderer: any;
|
|
13
|
-
_shapes: any[];
|
|
14
|
-
__staticId: number;
|
|
15
|
-
_initProgram(): void;
|
|
16
|
-
setRenderNode(renderNode: any): void;
|
|
17
|
-
add(shape: any): void;
|
|
18
|
-
remove(shape: any): void;
|
|
19
|
-
draw(): void;
|
|
20
|
-
drawPicking(): void;
|
|
21
|
-
clear(): void;
|
|
22
|
-
}
|
package/types/shaders/shape.d.ts
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base geometry shape class.
|
|
3
|
-
* @class
|
|
4
|
-
* @param {Object} options - Shape parameters:
|
|
5
|
-
* @param {Vec3} [options.position] - Shape position.
|
|
6
|
-
* @param {Quat} [options.orientation] - Shape orientation(rotation).
|
|
7
|
-
* @param {Vec3} [options.scale] - Scale vector.
|
|
8
|
-
* @param {Array.<number>} [options.color] - Shape RGBA color. (exactly 4 entries)
|
|
9
|
-
* @param {string} [options.src] - Texture image url source.
|
|
10
|
-
* @param {boolean} [options.visibility] - Shape visibility.
|
|
11
|
-
*/
|
|
12
|
-
export class BaseShape {
|
|
13
|
-
static set _staticCounter(arg: any);
|
|
14
|
-
static get _staticCounter(): any;
|
|
15
|
-
constructor(options: any);
|
|
16
|
-
/**
|
|
17
|
-
* Unic identifier.
|
|
18
|
-
* @public
|
|
19
|
-
* @readonly
|
|
20
|
-
* @type {number}
|
|
21
|
-
*/
|
|
22
|
-
public readonly id: number;
|
|
23
|
-
/**
|
|
24
|
-
* Shape position.
|
|
25
|
-
* @public
|
|
26
|
-
* @type {Vec3}
|
|
27
|
-
*/
|
|
28
|
-
public position: Vec3;
|
|
29
|
-
/**
|
|
30
|
-
* Shape orientation(rotation)
|
|
31
|
-
* @public
|
|
32
|
-
* @type {Quat}
|
|
33
|
-
*/
|
|
34
|
-
public orientation: Quat;
|
|
35
|
-
/**
|
|
36
|
-
* Scale.
|
|
37
|
-
* @public
|
|
38
|
-
* @type {Vec3}
|
|
39
|
-
*/
|
|
40
|
-
public scale: Vec3;
|
|
41
|
-
/**
|
|
42
|
-
* Shape RGBA color.
|
|
43
|
-
* @public
|
|
44
|
-
* @type {Array.<number>} - (exactly 4 entries)
|
|
45
|
-
*/
|
|
46
|
-
public color: Array<number>;
|
|
47
|
-
/**
|
|
48
|
-
* Shape visibility.
|
|
49
|
-
* @public
|
|
50
|
-
* @type {boolean}
|
|
51
|
-
*/
|
|
52
|
-
public visibility: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Image url source.
|
|
55
|
-
* @protected
|
|
56
|
-
* @type {string}
|
|
57
|
-
*/
|
|
58
|
-
protected _src: string;
|
|
59
|
-
/**
|
|
60
|
-
* Vertices position gl buffer.
|
|
61
|
-
* @protected
|
|
62
|
-
*/
|
|
63
|
-
protected _positionBuffer: any;
|
|
64
|
-
/**
|
|
65
|
-
* Vertices normal gl buffer.
|
|
66
|
-
* @protected
|
|
67
|
-
*/
|
|
68
|
-
protected _normalBuffer: any;
|
|
69
|
-
/**
|
|
70
|
-
* Vertices indexes gl buffer.
|
|
71
|
-
* @protected
|
|
72
|
-
*/
|
|
73
|
-
protected _indexBuffer: any;
|
|
74
|
-
/**
|
|
75
|
-
* Vertex texture coordinates gl buffer.
|
|
76
|
-
* @protected
|
|
77
|
-
*/
|
|
78
|
-
protected _textureCoordBuffer: any;
|
|
79
|
-
/**
|
|
80
|
-
* Vertex positions.
|
|
81
|
-
* @protected
|
|
82
|
-
* @type {Array.<number>}
|
|
83
|
-
*/
|
|
84
|
-
protected _positionData: Array<number>;
|
|
85
|
-
/**
|
|
86
|
-
* Vertex normals.
|
|
87
|
-
* @protected
|
|
88
|
-
* @type {Array.<number>}
|
|
89
|
-
*/
|
|
90
|
-
protected _normalData: Array<number>;
|
|
91
|
-
/**
|
|
92
|
-
* Vertex indeces.
|
|
93
|
-
* @protected
|
|
94
|
-
* @type {Array.<number>}
|
|
95
|
-
*/
|
|
96
|
-
protected _indexData: Array<number>;
|
|
97
|
-
/**
|
|
98
|
-
* Vertex texture coordinates.
|
|
99
|
-
* @protected
|
|
100
|
-
* @type {Array.<number>}
|
|
101
|
-
*/
|
|
102
|
-
protected _textureCoordData: Array<number>;
|
|
103
|
-
/**
|
|
104
|
-
* Scale matrix.
|
|
105
|
-
* @protected
|
|
106
|
-
* @type {Mat4}
|
|
107
|
-
*/
|
|
108
|
-
protected _mxScale: Mat4;
|
|
109
|
-
/**
|
|
110
|
-
* Translation matrix.
|
|
111
|
-
* @protected
|
|
112
|
-
* @type {Mat4}
|
|
113
|
-
*/
|
|
114
|
-
protected _mxTranslation: Mat4;
|
|
115
|
-
/**
|
|
116
|
-
* Model matrix.
|
|
117
|
-
* @protected
|
|
118
|
-
* @type {Mat4}
|
|
119
|
-
*/
|
|
120
|
-
protected _mxModel: Mat4;
|
|
121
|
-
/**
|
|
122
|
-
* Gl texture pointer.
|
|
123
|
-
* @protected
|
|
124
|
-
*/
|
|
125
|
-
protected texture: any;
|
|
126
|
-
/**
|
|
127
|
-
* Assigned render node.
|
|
128
|
-
* @protected
|
|
129
|
-
* @type {RenderNode}
|
|
130
|
-
*/
|
|
131
|
-
protected _renderNode: RenderNode;
|
|
132
|
-
/**
|
|
133
|
-
* Assigned picking color.
|
|
134
|
-
* @protected
|
|
135
|
-
* @type {Array.<number>} - (exactly 3 entries)
|
|
136
|
-
*/
|
|
137
|
-
protected _pickingColor: Array<number>;
|
|
138
|
-
/**
|
|
139
|
-
* Entity instance that holds this shape.
|
|
140
|
-
* @protected
|
|
141
|
-
* @type {Entity}
|
|
142
|
-
*/
|
|
143
|
-
protected _entity: Entity;
|
|
144
|
-
/**
|
|
145
|
-
* Handler that stores and renders this shape object.
|
|
146
|
-
* @protected
|
|
147
|
-
* @type {ShapeHandler}
|
|
148
|
-
*/
|
|
149
|
-
protected _handler: ShapeHandler;
|
|
150
|
-
/**
|
|
151
|
-
* Shape handler array index.
|
|
152
|
-
* @protected
|
|
153
|
-
* @type {number}
|
|
154
|
-
*/
|
|
155
|
-
protected _handlerIndex: number;
|
|
156
|
-
/**
|
|
157
|
-
* Clear shape parameters.
|
|
158
|
-
* @public
|
|
159
|
-
*/
|
|
160
|
-
public clear(): void;
|
|
161
|
-
/**
|
|
162
|
-
* Sets shape color.
|
|
163
|
-
* @public
|
|
164
|
-
* @param {Array.<number>} color - RGBA color values array. (exactly 4 entries)
|
|
165
|
-
*/
|
|
166
|
-
public setColor(color: Array<number>): void;
|
|
167
|
-
/**
|
|
168
|
-
* Sets shape color.
|
|
169
|
-
* @public
|
|
170
|
-
* @param {Vec4} color - RGBA color vector.
|
|
171
|
-
*/
|
|
172
|
-
public setColor4v(color: Vec4): void;
|
|
173
|
-
/**
|
|
174
|
-
* Sets shape opacity value.
|
|
175
|
-
* @public
|
|
176
|
-
* @param {number} opacity - Opacity value.
|
|
177
|
-
*/
|
|
178
|
-
public setOpacity(opacity: number): void;
|
|
179
|
-
/**
|
|
180
|
-
* Delete gl buffers.
|
|
181
|
-
* @protected
|
|
182
|
-
*/
|
|
183
|
-
protected _deleteBuffers(): void;
|
|
184
|
-
/**
|
|
185
|
-
* Sets shape visibility.
|
|
186
|
-
* @public
|
|
187
|
-
* @param {boolean} visibility - Visibility.
|
|
188
|
-
*/
|
|
189
|
-
public setVisibility(visibility: boolean): void;
|
|
190
|
-
/**
|
|
191
|
-
* Gets visibilty flag.
|
|
192
|
-
* @public
|
|
193
|
-
* @returns {boolean} -
|
|
194
|
-
*/
|
|
195
|
-
public getVisibility(): boolean;
|
|
196
|
-
/**
|
|
197
|
-
* Assign render node.
|
|
198
|
-
* @public
|
|
199
|
-
* @param {RenderNode} renderNode - Render node to assign.
|
|
200
|
-
*/
|
|
201
|
-
public setRenderNode(renderNode: RenderNode): void;
|
|
202
|
-
/**
|
|
203
|
-
* Sets shape position.
|
|
204
|
-
* @public
|
|
205
|
-
* @param {Vec3} position - Shape position.
|
|
206
|
-
*/
|
|
207
|
-
public setPosition3v(position: Vec3): void;
|
|
208
|
-
/**
|
|
209
|
-
* Translate shape position to vector.
|
|
210
|
-
* @public
|
|
211
|
-
* @param {Vec3} vec - Translation vector.
|
|
212
|
-
*/
|
|
213
|
-
public translate3v(vec: Vec3): void;
|
|
214
|
-
/**
|
|
215
|
-
* Sets shape scale.
|
|
216
|
-
* @param {Vec3} scale - Scale vector.
|
|
217
|
-
*/
|
|
218
|
-
setScale3v(scale: Vec3): void;
|
|
219
|
-
setScale(scale: any): void;
|
|
220
|
-
/**
|
|
221
|
-
* Removes shape from shape handler.
|
|
222
|
-
* @public
|
|
223
|
-
*/
|
|
224
|
-
public remove(): void;
|
|
225
|
-
/**
|
|
226
|
-
* Assign picking color.
|
|
227
|
-
* @protected
|
|
228
|
-
* @param {Vec3} color - Picking RGB color.
|
|
229
|
-
*/
|
|
230
|
-
protected setPickingColor3v(color: Vec3): void;
|
|
231
|
-
/**
|
|
232
|
-
* Creates buffers.
|
|
233
|
-
* @protected
|
|
234
|
-
*/
|
|
235
|
-
protected _createBuffers(): void;
|
|
236
|
-
/**
|
|
237
|
-
* Update model matrix.
|
|
238
|
-
* @public
|
|
239
|
-
*/
|
|
240
|
-
public refresh(): void;
|
|
241
|
-
/**
|
|
242
|
-
* Shape rendering.
|
|
243
|
-
* @public
|
|
244
|
-
*/
|
|
245
|
-
public draw(): void;
|
|
246
|
-
drawPicking(): void;
|
|
247
|
-
}
|
|
248
|
-
import { Vec3 } from "../math/Vec3.js";
|
|
249
|
-
import { Quat } from "../math/Quat.js";
|
|
250
|
-
import { Mat4 } from "../math/Mat4.js";
|
package/types/shapes/Sphere.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @class
|
|
3
|
-
* @extends {BaseShape}
|
|
4
|
-
* @param {Object} options - Sphere parameters:
|
|
5
|
-
* @param {Vec3} [options.position] - Sphere position.
|
|
6
|
-
* @param {Quat} [options.orientation] - Sphere orientation(rotation).
|
|
7
|
-
* @param {Vec3} [options.scale] - Scale vector.
|
|
8
|
-
* @param {Array.<number>} [options.color] - Sphere RGBA color. (exactly 4 entries)
|
|
9
|
-
* @param {string} [options.src] - Texture image url source.
|
|
10
|
-
* @param {boolean} [options.visibility] - Sphere visibility.
|
|
11
|
-
* @param {number} [options.radius=100] - Sphere radius.
|
|
12
|
-
* @param {number} [options.latBands=16] - Number of latitude bands.
|
|
13
|
-
* @param {number} [options.lonBands=16] - Number of longitude bands.
|
|
14
|
-
*/
|
|
15
|
-
export class Sphere extends BaseShape {
|
|
16
|
-
/**
|
|
17
|
-
* Sphere radius.
|
|
18
|
-
* @protected
|
|
19
|
-
* @type {number}
|
|
20
|
-
*/
|
|
21
|
-
protected _radius: number;
|
|
22
|
-
/**
|
|
23
|
-
* Number of latitude bands.
|
|
24
|
-
* @protected
|
|
25
|
-
* @type {number}
|
|
26
|
-
*/
|
|
27
|
-
protected _latBands: number;
|
|
28
|
-
/**
|
|
29
|
-
* Number of longitude bands.
|
|
30
|
-
* @protected
|
|
31
|
-
* @type {number}
|
|
32
|
-
*/
|
|
33
|
-
protected _lonBands: number;
|
|
34
|
-
/**
|
|
35
|
-
* Create specific shape vertices data.
|
|
36
|
-
* @protected
|
|
37
|
-
* @virtual
|
|
38
|
-
*/
|
|
39
|
-
protected _createData(): void;
|
|
40
|
-
}
|
|
41
|
-
import { BaseShape } from "./BaseShape.js";
|