@openglobus/og 1.0.0-rc7 → 1.0.0-rc9
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 +2 -0
- package/lib/Globe.d.ts +4 -2
- package/lib/Object3d.d.ts +1 -1
- package/lib/assets/LabelWorker.worker-C24YLEkW.js.map +1 -0
- package/lib/assets/PlainSegmentWorker.worker-DJHXd0bF.js.map +1 -0
- package/lib/assets/TerrainWorker.worker-B4Gp0jCy.js.map +1 -0
- package/lib/camera/Camera.d.ts +18 -2
- package/lib/camera/PlanetCamera.d.ts +0 -3
- package/lib/control/depthCamera/DepthCamera.d.ts +98 -0
- package/lib/control/depthCamera/DepthCameraHandler.d.ts +25 -0
- package/lib/control/depthCamera/depth_camera.d.ts +2 -0
- package/lib/control/entityEditor/CameraEditorView.d.ts +49 -0
- package/lib/control/entityEditor/EntityEditor.d.ts +2 -1
- package/lib/control/entityEditor/EntityEditorDialog.d.ts +15 -47
- package/lib/control/entityEditor/EntityEditorScene.d.ts +16 -0
- package/lib/control/entityEditor/EntityEditorView.d.ts +68 -0
- package/lib/control/entityEditor/ProjectorEditorView.d.ts +31 -0
- package/lib/control/entityEditor/RotateEntity.d.ts +5 -1
- package/lib/control/index.d.ts +2 -3
- package/lib/entity/ray/Ray.d.ts +2 -0
- package/lib/index.d.ts +4 -0
- package/lib/og.css +2 -1
- package/lib/og.es.js +1 -1
- package/lib/og.es.js.map +1 -1
- package/lib/quadTree/QuadTreeStrategy.d.ts +1 -0
- package/lib/renderer/Renderer.d.ts +3 -0
- package/lib/renderer/projectors/Projector.d.ts +12 -15
- package/lib/renderer/projectors/ProjectorManager.d.ts +4 -2
- package/lib/scene/Planet.d.ts +2 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/ui/Color.d.ts +5 -2
- package/lib/ui/Input.d.ts +12 -1
- package/lib/ui/TitleBarView.d.ts +21 -0
- package/lib/ui/index.d.ts +1 -0
- package/lib/utils/gltf/types.d.ts +5 -4
- package/package.json +11 -9
- package/lib/assets/LabelWorker.worker-DYd7xn3M.js.map +0 -1
- package/lib/assets/PlainSegmentWorker.worker-JsKldq-e.js.map +0 -1
- package/lib/assets/TerrainWorker.worker-CqUJvMOv.js.map +0 -1
- package/lib/control/CameraFrameComposer.d.ts +0 -19
- package/lib/control/CameraFrameHandler.d.ts +0 -26
- package/lib/control/cameraDepthHandler/CameraDepthHandler.d.ts +0 -49
- package/lib/control/cameraDepthHandler/camera_depth.d.ts +0 -2
package/README.md
CHANGED
package/lib/Globe.d.ts
CHANGED
|
@@ -18,8 +18,9 @@ export interface IGlobeParams {
|
|
|
18
18
|
attributionContainer?: HTMLElement;
|
|
19
19
|
target?: string | HTMLElement;
|
|
20
20
|
skybox?: Scene;
|
|
21
|
-
|
|
21
|
+
pixelRatio?: number;
|
|
22
22
|
msaa?: number;
|
|
23
|
+
deferredDisabled?: boolean;
|
|
23
24
|
name?: string;
|
|
24
25
|
frustums?: NumberArray2[];
|
|
25
26
|
ellipsoid?: Ellipsoid;
|
|
@@ -120,7 +121,8 @@ export interface IGlobeParams {
|
|
|
120
121
|
* @param {number} [options.loadingBatchSize=12] -
|
|
121
122
|
* @param {number} [options.quadTreeStrategyPrototype] - Prototype of quadTree. QuadTreeStrategy for Earth is default.
|
|
122
123
|
* @param {number} [options.msaa=0] - MSAA antialiasing parameter: 2,4,8,16. Default is 0.
|
|
123
|
-
* @param {
|
|
124
|
+
* @param {boolean} [options.deferredDisabled=false] - Disables deferred and WOIT pipelines and renders objects with forward shaders.
|
|
125
|
+
* @param {number} [options.pixelRatio] - Device pixel ratio. Default is current screen DPI.
|
|
124
126
|
* @param {boolean} [options.atmosphereEnabled] - Enables atmosphere effect.
|
|
125
127
|
* @param {boolean} [options.transtitionOpacityEnabled] - Enables terrain smooth opacity transition effect.
|
|
126
128
|
* @param {IAtmosphereParams} [options.atmosphereParameters] - Atmosphere model parameters.
|
package/lib/Object3d.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ declare class Object3d {
|
|
|
71
71
|
static scale(vertices: number[], s: Vec3): void;
|
|
72
72
|
static centroid(vertices: number[]): number[];
|
|
73
73
|
static translate(vertices: number[], v: NumberArray3): void;
|
|
74
|
-
static getNormals(vertices: number[]): number[];
|
|
74
|
+
static getNormals(vertices: number[], indices?: number[]): number[];
|
|
75
75
|
static createSphere(lonBands?: number, latBands?: number, radius?: number, offsetX?: number, offsetY?: number, offsetZ?: number): Object3d;
|
|
76
76
|
static createDisc(radius?: number, height?: number, radialSegments?: number, isTop?: boolean, startIndex?: number, offsetX?: number, offsetY?: number, offsetZ?: number): Object3d;
|
|
77
77
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LabelWorker.worker-C24YLEkW.js","names":[],"sources":["../../src/entity/label/LabelWorker.worker.js"],"sourcesContent":["\"use strict\";\n\nfunction concatTypedArrays(dest, index, source) {\n let len = source.length,\n offset = index * len;\n for (let i = 0; i < len; i++) {\n dest[offset + i] = source[i];\n }\n}\n\nfunction srgbToLinear(v) {\n return Math.pow(v, 2.2);\n}\n\nself.onmessage = function (e) {\n var labelData = e.data.labelData,\n id = labelData[0],\n maxLetters = labelData[1],\n isVisible = labelData[2],\n /*3, 4, 5*/ _positionHigh_x = labelData[3],\n _positionHigh_y = labelData[4],\n _positionHigh_z = labelData[5],\n /*6, 7, 8*/ _positionLow_x = labelData[6],\n _positionLow_y = labelData[7],\n _positionLow_z = labelData[8],\n /*9*/ _size = labelData[9],\n /*10, 11*/ _offset_x = labelData[10],\n _offset_y = labelData[11],\n /*12, 13, 14, 15*/ _color_x = labelData[12],\n _color_y = labelData[13],\n _color_z = labelData[14],\n _color_w = labelData[15],\n /*16*/ _rotation = labelData[16],\n /*17, 18, 19*/ _alignedAxis_x = labelData[17],\n _alignedAxis_y = labelData[18],\n _alignedAxis_z = labelData[19],\n /*20*/ _fontIndex = labelData[20],\n /*21*/ _outline = labelData[21],\n /*22, 23, 24, 25*/ _outlineColor_x = labelData[22],\n _outlineColor_y = labelData[23],\n _outlineColor_z = labelData[24],\n _outlineColor_w = labelData[25],\n /*26, 27, 28*/ _pickingColor_x = labelData[26],\n _pickingColor_y = labelData[27],\n _pickingColor_z = labelData[28];\n\n let _vertexArr = new Float32Array(maxLetters * 12),\n _texCoordArr = new Float32Array(maxLetters * 24),\n _gliphParamArr = new Float32Array(maxLetters * 24),\n _positionHighArr = new Float32Array(maxLetters * 18),\n _positionLowArr = new Float32Array(maxLetters * 18),\n _sizeArr = new Float32Array(maxLetters * 6),\n _offsetArr = new Float32Array(maxLetters * 12),\n _rgbaArr = new Float32Array(maxLetters * 24),\n _rotationArr = new Float32Array(maxLetters * 6),\n _alignedAxisArr = new Float32Array(maxLetters * 18),\n _fontIndexArr = new Float32Array(maxLetters * 6),\n _outlineArr = new Float32Array(maxLetters * 6),\n _outlineColorArr = new Float32Array(maxLetters * 24),\n _pickingColorArr = new Float32Array(maxLetters * 18);\n\n for (let i = 0; i < maxLetters; i++) {\n if (isVisible !== 0) {\n concatTypedArrays(_vertexArr, i, [0, 0, 0, -1, 1, -1, 1, -1, 1, 0, 0, 0]);\n } else {\n concatTypedArrays(_vertexArr, i, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);\n }\n\n concatTypedArrays(\n _texCoordArr,\n i,\n [0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0]\n );\n concatTypedArrays(_gliphParamArr, i, [1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0]);\n\n var x = _positionHigh_x,\n y = _positionHigh_y,\n z = _positionHigh_z,\n w;\n concatTypedArrays(_positionHighArr, i, [x, y, z, x, y, z, x, y, z, x, y, z, x, y, z, x, y, z]);\n\n x = _positionLow_x;\n y = _positionLow_y;\n z = _positionLow_z;\n concatTypedArrays(_positionLowArr, i, [x, y, z, x, y, z, x, y, z, x, y, z, x, y, z, x, y, z]);\n\n x = _size;\n concatTypedArrays(_sizeArr, i, [x, x, x, x, x, x]);\n\n x = _offset_x;\n y = _offset_y;\n concatTypedArrays(_offsetArr, i, [x, y, x, y, x, y, x, y, x, y, x, y]);\n\n x = srgbToLinear(_color_x);\n y = srgbToLinear(_color_y);\n z = srgbToLinear(_color_z);\n w = _color_w;\n concatTypedArrays(_rgbaArr, i, [x, y, z, w, x, y, z, w, x, y, z, w, x, y, z, w, x, y, z, w, x, y, z, w]);\n\n x = _rotation;\n concatTypedArrays(_rotationArr, i, [x, x, x, x, x, x]);\n\n x = _alignedAxis_x;\n y = _alignedAxis_y;\n z = _alignedAxis_z;\n concatTypedArrays(_alignedAxisArr, i, [x, y, z, x, y, z, x, y, z, x, y, z, x, y, z, x, y, z]);\n\n x = _fontIndex;\n concatTypedArrays(_fontIndexArr, i, [x, x, x, x, x, x]);\n\n x = _outline;\n concatTypedArrays(_outlineArr, i, [x, x, x, x, x, x]);\n\n x = srgbToLinear(_outlineColor_x);\n y = srgbToLinear(_outlineColor_y);\n z = srgbToLinear(_outlineColor_z);\n w = _outlineColor_w;\n concatTypedArrays(_outlineColorArr, i, [\n x,\n y,\n z,\n w,\n x,\n y,\n z,\n w,\n x,\n y,\n z,\n w,\n x,\n y,\n z,\n w,\n x,\n y,\n z,\n w,\n x,\n y,\n z,\n w\n ]);\n\n x = _pickingColor_x / 255;\n y = _pickingColor_y / 255;\n z = _pickingColor_z / 255;\n concatTypedArrays(_pickingColorArr, i, [x, y, z, x, y, z, x, y, z, x, y, z, x, y, z, x, y, z]);\n }\n\n self.postMessage(\n {\n id: id,\n vertexArr: _vertexArr,\n texCoordArr: _texCoordArr,\n gliphParamArr: _gliphParamArr,\n positionHighArr: _positionHighArr,\n positionLowArr: _positionLowArr,\n sizeArr: _sizeArr,\n offsetArr: _offsetArr,\n rgbaArr: _rgbaArr,\n rotationArr: _rotationArr,\n alignedAxisArr: _alignedAxisArr,\n fontIndexArr: _fontIndexArr,\n outlineArr: _outlineArr,\n outlineColorArr: _outlineColorArr,\n pickingColorArr: _pickingColorArr\n },\n [\n _vertexArr.buffer,\n _texCoordArr.buffer,\n _gliphParamArr.buffer,\n _positionHighArr.buffer,\n _positionLowArr.buffer,\n _sizeArr.buffer,\n _offsetArr.buffer,\n _rgbaArr.buffer,\n _rotationArr.buffer,\n _alignedAxisArr.buffer,\n _fontIndexArr.buffer,\n _outlineArr.buffer,\n _outlineColorArr.buffer,\n _pickingColorArr.buffer\n ]\n );\n};\n"],"mappings":"yBAEA,SAAS,EAAkB,EAAM,EAAO,EAAA,CACpC,IAAI,EAAM,EAAO,OACb,EAAS,EAAQ,EACrB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAK,IACrB,EAAK,EAAS,GAAK,EAAO,EAElC,CAEA,SAAS,EAAa,EAAA,CAClB,OAAgB,GAAG,GACvB,CAEA,KAAK,UAAY,SAAU,EAAA,CACvB,IAAI,EAAY,EAAE,KAAK,UACnB,EAAK,EAAU,GACf,EAAa,EAAU,GACvB,EAAY,EAAU,GACV,EAAkB,EAAU,GACxC,EAAkB,EAAU,GAC5B,EAAkB,EAAU,GAChB,EAAiB,EAAU,GACvC,EAAiB,EAAU,GAC3B,EAAiB,EAAU,GACrB,EAAQ,EAAU,GACb,EAAY,EAAU,IACjC,EAAY,EAAU,IACH,EAAW,EAAU,IACxC,EAAW,EAAU,IACrB,EAAW,EAAU,IACrB,EAAW,EAAU,IACd,EAAY,EAAU,IACd,EAAiB,EAAU,IAC1C,EAAiB,EAAU,IAC3B,EAAiB,EAAU,IACpB,EAAa,EAAU,IACvB,EAAW,EAAU,IACT,EAAkB,EAAU,IAC/C,EAAkB,EAAU,IAC5B,EAAkB,EAAU,IAC5B,EAAkB,EAAU,IACb,EAAkB,EAAU,IAC3C,EAAkB,EAAU,IAC5B,EAAkB,EAAU,IAEhC,IAAI,EAAa,IAAI,aAA0B,GAAb,CAAA,EAC9B,EAAe,IAAI,aAA0B,GAAb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ACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CAAA,CAAA,EAMJ,EAAkB,EAAkB,EAAG,CAHvC,EAAI,EAAkB,IACtB,EAAI,EAAkB,IACtB,EAAI,EAAkB,IAC2B,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,CAAA,CAAA,CAC/F,CAEA,KAAK,YACD,CACQ,GAAA,EACJ,UAAW,EACX,YAAa,EACb,cAAe,EACf,gBAAiB,EACjB,eAAgB,EAChB,QAAS,EACT,UAAW,EACX,QAAS,EACT,YAAa,EACb,eAAgB,EAChB,aAAc,EACd,WAAY,EACZ,gBAAiB,EACjB,gBAAiB,CAAA,EAErB,CACI,EAAW,OACX,EAAa,OACb,EAAe,OACf,EAAiB,OACjB,EAAgB,OAChB,EAAS,OACT,EAAW,OACX,EAAS,OACT,EAAa,OACb,EAAgB,OAChB,EAAc,OACd,EAAY,OACZ,EAAiB,OACjB,EAAiB,MAAA,CAAA,CAG7B,CAAA,EAAA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlainSegmentWorker.worker-DJHXd0bF.js","names":[],"sources":["../../src/utils/PlainSegmentWorker.worker.js"],"sourcesContent":["\"use strict\";\n\nlet model = null;\n\nlet cached_ix = null;\nlet cached_iy = null;\nlet v00 = null;\nlet v01 = null;\nlet v10 = null;\nlet v11 = null;\n//let t = null;\n\nfunction rawval(ix, iy) {\n if (iy < 0) {\n iy = -iy;\n ix += model.width / 2;\n } else if (iy >= model.height) {\n iy = 2 * (model.height - 1) - iy;\n ix += model.width / 2;\n }\n\n if (ix < 0) {\n ix += model.width;\n } else if (ix >= model.width) {\n ix -= model.width;\n }\n\n var k = (iy * model.width + ix) * 2 + model.i;\n\n return (model.rawfile[k] << 8) | model.rawfile[k + 1];\n}\n\nfunction getHeightMSL(lon, lat) {\n if (!model) return 0;\n\n if (lon < 0) lon += 360.0;\n\n var fy = (90 - lat) * model.rlatres;\n var fx = lon * model.rlonres;\n var iy = Math.floor(fy);\n var ix = Math.floor(fx);\n\n fx -= ix;\n fy -= iy;\n\n if (iy === model.height - 1) {\n iy--;\n }\n\n if (cached_ix !== ix || cached_iy !== iy) {\n cached_ix = ix;\n cached_iy = iy;\n\n v00 = rawval(ix, iy);\n v01 = rawval(ix + 1, iy);\n v10 = rawval(ix, iy + 1);\n v11 = rawval(ix + 1, iy + 1);\n }\n\n let h = null;\n\n var a = (1 - fx) * v00 + fx * v01;\n var b = (1 - fx) * v10 + fx * v11;\n\n h = (1 - fy) * a + fy * b;\n\n return model.offset + model.scale * h;\n}\n\nconst HALF_PI = Math.PI * 0.5;\nconst POLE = 20037508.34;\nconst PI_BY_POLE = Math.PI / POLE;\nconst INV_POLE_BY_180 = 180.0 / POLE;\nconst INV_PI_BY_180 = 180.0 / Math.PI;\nconst INV_PI_BY_180_HALF_PI = INV_PI_BY_180 * HALF_PI;\nconst RADIANS = Math.PI / 180.0;\nconst INV_PI_BY_360 = INV_PI_BY_180 * 2.0;\n\nlet E2 = 0.0,\n A = 0.0;\n\nlet _projFunc = null;\n\nconst Vec3 = function (x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z;\n};\n\nvar geodeticToCartesian = function (lon, lat, heightFactor, res) {\n let h = getHeightMSL(lon, lat) * heightFactor;\n\n let latrad = RADIANS * lat,\n lonrad = RADIANS * lon;\n\n let slt = Math.sin(latrad);\n\n let N = A / Math.sqrt(1.0 - E2 * slt * slt);\n let nc = (N + h) * Math.cos(latrad);\n\n res.x = nc * Math.cos(lonrad);\n res.y = nc * Math.sin(lonrad);\n res.z = (N * (1 - E2) + h) * slt;\n};\n\nvar geodeticToCartesianInverse = function (lon, lat, heightFactor, res) {\n geodeticToCartesian(\n lon * INV_POLE_BY_180,\n INV_PI_BY_360 * Math.atan(Math.exp(lat * PI_BY_POLE)) - INV_PI_BY_180_HALF_PI,\n heightFactor,\n res\n );\n};\n\nvar worldPos = new Vec3(0.0, 0.0, 0.0);\nvar rtcPos = new Vec3(0.0, 0.0, 0.0);\nvar _tempHigh = new Vec3(0.0, 0.0, 0.0);\nvar _tempLow = new Vec3(0.0, 0.0, 0.0);\n\nvar doubleToTwoFloats = function (v, high, low) {\n let x = v.x,\n y = v.y,\n z = v.z;\n\n var doubleHigh;\n\n if (x >= 0.0) {\n doubleHigh = Math.floor(x / 65536.0) * 65536.0;\n high.x = Math.fround(doubleHigh);\n low.x = Math.fround(x - doubleHigh);\n } else {\n doubleHigh = Math.floor(-x / 65536.0) * 65536.0;\n high.x = Math.fround(-doubleHigh);\n low.x = Math.fround(x + doubleHigh);\n }\n\n if (y >= 0.0) {\n doubleHigh = Math.floor(y / 65536.0) * 65536.0;\n high.y = Math.fround(doubleHigh);\n low.y = Math.fround(y - doubleHigh);\n } else {\n doubleHigh = Math.floor(-y / 65536.0) * 65536.0;\n high.y = Math.fround(-doubleHigh);\n low.y = Math.fround(y + doubleHigh);\n }\n\n if (z >= 0.0) {\n doubleHigh = Math.floor(z / 65536.0) * 65536.0;\n high.z = Math.fround(doubleHigh);\n low.z = Math.fround(z - doubleHigh);\n } else {\n doubleHigh = Math.floor(-z / 65536.0) * 65536.0;\n high.z = Math.fround(-doubleHigh);\n low.z = Math.fround(z + doubleHigh);\n }\n};\n\nself.onmessage = function (msg) {\n if (msg.data.model) {\n model = msg.data.model;\n model.rawfile = msg.data.rawfile;\n } else if (msg.data.params) {\n let rtc_x = msg.data.params[14];\n let rtc_y = msg.data.params[15];\n let rtc_z = msg.data.params[16];\n\n let xmin = 549755748352.0,\n xmax = -549755748352.0,\n ymin = 549755748352.0,\n ymax = -549755748352.0,\n zmin = 549755748352.0,\n zmax = -549755748352.0;\n\n E2 = msg.data.params[8];\n A = msg.data.params[9];\n\n let gridSize = msg.data.params[2],\n fgs = msg.data.params[3],\n r2_x = msg.data.params[10],\n r2_y = msg.data.params[11],\n r2_z = msg.data.params[12];\n\n let heightFactor = msg.data.params[13];\n\n if (msg.data.params[1] === 0.0) {\n _projFunc = geodeticToCartesianInverse;\n } else {\n _projFunc = geodeticToCartesian;\n }\n\n let maxFgs = Math.max(fgs, gridSize);\n let llStep = (msg.data.params[6] - msg.data.params[4]) / maxFgs;\n let ltStep = (msg.data.params[7] - msg.data.params[5]) / maxFgs;\n\n let esw_lon = msg.data.params[4],\n ene_lat = msg.data.params[7];\n\n let dg = Math.max(fgs / gridSize, 1.0),\n gs = maxFgs + 1;\n\n const gsgs = gs * gs;\n\n const gridSize3 = (gridSize + 1) * (gridSize + 1) * 3;\n\n let plainNormals = new Float32Array(gridSize3);\n\n let plainVertices = new Float64Array(gridSize3);\n let plainVerticesHigh = new Float32Array(gridSize3);\n let plainVerticesLow = new Float32Array(gridSize3);\n let normalMapNormals = new Float32Array(gsgs * 3);\n let normalMapVertices = new Float64Array(gsgs * 3);\n\n let ind = 0,\n nmInd = 0;\n\n for (let k = 0; k < gsgs; k++) {\n let j = k % gs,\n i = ~~(k / gs);\n\n _projFunc(esw_lon + j * llStep, ene_lat - i * ltStep, heightFactor, worldPos);\n\n let nx = worldPos.x * r2_x,\n ny = worldPos.y * r2_y,\n nz = worldPos.z * r2_z;\n let l = 1.0 / Math.sqrt(nx * nx + ny * ny + nz * nz);\n let nxl = nx * l,\n nyl = ny * l,\n nzl = nz * l;\n\n rtcPos.x = worldPos.x - rtc_x;\n rtcPos.y = worldPos.y - rtc_y;\n rtcPos.z = worldPos.z - rtc_z;\n\n normalMapVertices[nmInd] = rtcPos.x;\n normalMapNormals[nmInd++] = nxl;\n\n normalMapVertices[nmInd] = rtcPos.y;\n normalMapNormals[nmInd++] = nyl;\n\n normalMapVertices[nmInd] = rtcPos.z;\n normalMapNormals[nmInd++] = nzl;\n\n if (i % dg === 0 && j % dg === 0) {\n doubleToTwoFloats(rtcPos, _tempHigh, _tempLow);\n\n plainVertices[ind] = rtcPos.x;\n plainVerticesHigh[ind] = _tempHigh.x;\n plainVerticesLow[ind] = _tempLow.x;\n plainNormals[ind++] = nxl;\n\n plainVertices[ind] = rtcPos.y;\n plainVerticesHigh[ind] = _tempHigh.y;\n plainVerticesLow[ind] = _tempLow.y;\n plainNormals[ind++] = nyl;\n\n plainVertices[ind] = rtcPos.z;\n plainVerticesHigh[ind] = _tempHigh.z;\n plainVerticesLow[ind] = _tempLow.z;\n plainNormals[ind++] = nzl;\n\n if (worldPos.x < xmin) xmin = worldPos.x;\n if (worldPos.x > xmax) xmax = worldPos.x;\n if (worldPos.y < ymin) ymin = worldPos.y;\n if (worldPos.y > ymax) ymax = worldPos.y;\n if (worldPos.z < zmin) zmin = worldPos.z;\n if (worldPos.z > zmax) zmax = worldPos.z;\n }\n }\n\n let x = (xmax - xmin) * 0.5,\n y = (ymax - ymin) * 0.5,\n z = (zmax - zmin) * 0.5;\n\n let plainRadius = Math.sqrt(x * x + y * y + z * z);\n\n self.postMessage(\n {\n id: msg.data.params[0],\n plainVertices: plainVertices,\n plainVerticesHigh: plainVerticesHigh,\n plainVerticesLow: plainVerticesLow,\n plainNormals: plainNormals,\n normalMapNormals: normalMapNormals,\n normalMapVertices: normalMapVertices,\n plainRadius: plainRadius,\n relativeCenter: [rtc_x, rtc_y, rtc_z]\n },\n [\n plainVertices.buffer,\n plainVerticesHigh.buffer,\n plainVerticesLow.buffer,\n plainNormals.buffer,\n normalMapNormals.buffer,\n normalMapVertices.buffer\n ]\n );\n }\n};\n"],"mappings":"yBAEA,IAAI,EAAQ,KAER,EAAY,KACZ,EAAY,KACZ,EAAM,KACN,EAAM,KACN,EAAM,KACN,EAAM,KAGV,SAAS,EAAO,EAAI,EAAA,CACZ,EAAK,GACL,EAAA,CAAM,EACN,GAAM,EAAM,MAAQ,GACb,GAAM,EAAM,SACnB,EAAK,GAAK,EAAM,OAAS,GAAK,EAC9B,GAAM,EAAM,MAAQ,GAGpB,EAAK,EACL,GAAM,EAAM,MACL,GAAM,EAAM,QACnB,GAAM,EAAM,OAGhB,IAAI,EAA8B,GAAzB,EAAK,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AAO,EAAS,GAE/C,CAEA,IAAI,EAAoB,IAAf,EAAO,GACZ,EAAoB,IAAf,EAAO,GACZ,EAAoB,IAAf,EAAO,GAEZ,EAAc,KAAK,KAAK,EAAI,EAAI,EAAI,EAAI,EAAI,CAAA,EAEhD,KAAK,YACD,CACI,GAAI,EAAI,KAAK,OAAO,GACL,cAAA,EACI,kBAAA,EACD,iBAAA,EACJ,aAAA,EACI,iBAAA,EACC,kBAAA,EACN,YAAA,EACb,eAAgB,CAAC,EAAO,EAAO,CAAA,CAAA,EAEnC,CACI,EAAc,OACd,EAAkB,OAClB,EAAiB,OACjB,EAAa,OACb,EAAiB,OACjB,EAAkB,MAAA,CAAA,CAG9B,CACJ,CAAA,EAAA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TerrainWorker.worker-B4Gp0jCy.js","names":[],"sources":["../../src/utils/TerrainWorker.worker.js"],"sourcesContent":["\"use strict\";\n//\n//Terrain worker\n//\n\nfunction binarySearchFast(arr, x) {\n let start = 0,\n end = arr.length - 1;\n while (start <= end) {\n let k = Math.floor((start + end) * 0.5);\n if (Math.abs(arr[k] - x) < 1e-3) return k;\n else if (arr[k] < x) start = k + 1;\n else end = k - 1;\n }\n return -1;\n}\n\nfunction checkNoDataValue(noDataValues, value) {\n return binarySearchFast(noDataValues, value) !== -1;\n}\n\nvar Vec3 = function (x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z;\n};\n\nvar doubleToTwoFloats = function (v, high, low) {\n let x = v.x,\n y = v.y,\n z = v.z;\n\n var doubleHigh;\n\n if (x >= 0.0) {\n doubleHigh = Math.floor(x / 65536.0) * 65536.0;\n high.x = Math.fround(doubleHigh);\n low.x = Math.fround(x - doubleHigh);\n } else {\n doubleHigh = Math.floor(-x / 65536.0) * 65536.0;\n high.x = Math.fround(-doubleHigh);\n low.x = Math.fround(x + doubleHigh);\n }\n\n if (y >= 0.0) {\n doubleHigh = Math.floor(y / 65536.0) * 65536.0;\n high.y = Math.fround(doubleHigh);\n low.y = Math.fround(y - doubleHigh);\n } else {\n doubleHigh = Math.floor(-y / 65536.0) * 65536.0;\n high.y = Math.fround(-doubleHigh);\n low.y = Math.fround(y + doubleHigh);\n }\n\n if (z >= 0.0) {\n doubleHigh = Math.floor(z / 65536.0) * 65536.0;\n high.z = Math.fround(doubleHigh);\n low.z = Math.fround(z - doubleHigh);\n } else {\n doubleHigh = Math.floor(-z / 65536.0) * 65536.0;\n high.z = Math.fround(-doubleHigh);\n low.z = Math.fround(z + doubleHigh);\n }\n};\n\nVec3.prototype.sub = function (v) {\n return new Vec3(this.x - v.x, this.y - v.y, this.z - v.z);\n};\n\nVec3.prototype.add = function (v) {\n return new Vec3(this.x + v.x, this.y + v.y, this.z + v.z);\n};\n\nVec3.prototype.cross = function (v) {\n return new Vec3(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x);\n};\n\nVec3.prototype.normalize = function () {\n var x = this.x,\n y = this.y,\n z = this.z;\n var length = 1.0 / Math.sqrt(x * x + y * y + z * z);\n this.x = x * length;\n this.y = y * length;\n this.z = z * length;\n return this;\n};\n\nVec3.prototype.distance = function (v) {\n return this.sub(v).length();\n};\n\nVec3.prototype.length = function () {\n return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n};\n\nvar blerp = function (x, y, fQ11, fQ21, fQ12, fQ22) {\n return fQ11 * (1.0 - x) * (1.0 - y) + fQ21 * x * (1.0 - y) + fQ12 * (1.0 - x) * y + fQ22 * x * y;\n};\n\nvar _tempVec = new Vec3(0.0, 0.0, 0.0);\nvar _rtcTempVec = new Vec3(0.0, 0.0, 0.0);\n\nvar _tempHigh = new Vec3(0.0, 0.0, 0.0),\n _tempLow = new Vec3(0.0, 0.0, 0.0);\n\nself.onmessage = function (e) {\n var elevations = e.data.elevations,\n this_plainVertices = e.data.this_plainVertices,\n this_plainNormals = e.data.this_plainNormals,\n this_normalMapVertices = e.data.this_normalMapVertices,\n this_normalMapNormals = e.data.this_normalMapNormals,\n heightFactor = e.data.heightFactor,\n gridSize = e.data.gridSize,\n noDataValues = e.data.noDataValues,\n id = e.data.id;\n\n let rtc_x = e.data.relativeCenter[0],\n rtc_y = e.data.relativeCenter[1],\n rtc_z = e.data.relativeCenter[2];\n\n var xmin = 549755748352.0,\n xmax = -549755748352.0,\n ymin = 549755748352.0,\n ymax = -549755748352.0,\n zmin = 549755748352.0,\n zmax = -549755748352.0;\n\n const fileGridSize = Math.sqrt(elevations.length) - 1;\n\n const fileGridSize_one = fileGridSize + 1;\n const fileGridSize_one_x2 = fileGridSize_one * fileGridSize_one;\n const tgs = gridSize;\n const dg = fileGridSize / tgs;\n const gs = tgs + 1;\n const hf = heightFactor;\n\n var vInd = 0,\n noDataInd = 0;\n\n var gsgs3 = gs * gs * 3;\n\n var terrainVertices = new Float64Array(gsgs3),\n terrainVerticesHigh = new Float32Array(gsgs3),\n terrainVerticesLow = new Float32Array(gsgs3),\n noDataVertices = new Uint8Array(gs * gs);\n\n var normalMapNormals, normalMapVertices;\n\n var nv = this_normalMapVertices,\n nn = this_normalMapNormals;\n\n if (fileGridSize >= tgs) {\n normalMapNormals = new Float32Array(fileGridSize_one_x2 * 3);\n normalMapVertices = new Float64Array(fileGridSize_one_x2 * 3);\n\n for (let k = 0; k < fileGridSize_one_x2; k++) {\n var j = k % fileGridSize_one,\n i = ~~(k / fileGridSize_one);\n\n //\n // V0\n //\n var hInd0 = k;\n var vInd0 = hInd0 * 3;\n var currElv = elevations[hInd0];\n if (checkNoDataValue(noDataValues, currElv)) {\n currElv = 0.0;\n }\n var h0 = hf * currElv;\n var v0 = new Vec3(\n rtc_x + nv[vInd0] + h0 * nn[vInd0],\n rtc_y + nv[vInd0 + 1] + h0 * nn[vInd0 + 1],\n rtc_z + nv[vInd0 + 2] + h0 * nn[vInd0 + 2]\n );\n\n normalMapVertices[vInd0] = v0.x - rtc_x;\n normalMapVertices[vInd0 + 1] = v0.y - rtc_y;\n normalMapVertices[vInd0 + 2] = v0.z - rtc_z;\n\n //\n // The vertex goes into screen buffer\n if (i % dg === 0 && j % dg === 0) {\n let currVert = new Vec3(rtc_x + nv[vInd0], rtc_y + nv[vInd0 + 1], rtc_z + nv[vInd0 + 2]);\n let nextVert = new Vec3(rtc_x + nv[vInd0 + 3], rtc_y + nv[vInd0 + 4], rtc_z + nv[vInd0 + 5]);\n\n let nextElv = elevations[hInd0 + 1];\n if (checkNoDataValue(noDataValues, nextElv)) {\n nextElv = 0.0;\n }\n\n let eps = false;\n if (noDataValues.length === 0) {\n let step = currVert.distance(nextVert);\n let deltaElv = Math.abs(currElv - nextElv);\n eps = deltaElv / step > 10.0 || currElv < -5000;\n }\n\n if (eps) {\n noDataVertices[noDataInd] = 1;\n } else {\n noDataVertices[noDataInd] = 0;\n if (v0.x < xmin) xmin = v0.x;\n if (v0.x > xmax) xmax = v0.x;\n if (v0.y < ymin) ymin = v0.y;\n if (v0.y > ymax) ymax = v0.y;\n if (v0.z < zmin) zmin = v0.z;\n if (v0.z > zmax) zmax = v0.z;\n }\n\n let rtc_v0 = new Vec3(v0.x - rtc_x, v0.y - rtc_y, v0.z - rtc_z);\n doubleToTwoFloats(rtc_v0, _tempHigh, _tempLow);\n\n terrainVerticesHigh[vInd] = _tempHigh.x;\n terrainVerticesLow[vInd] = _tempLow.x;\n terrainVertices[vInd++] = rtc_v0.x;\n\n terrainVerticesHigh[vInd] = _tempHigh.y;\n terrainVerticesLow[vInd] = _tempLow.y;\n terrainVertices[vInd++] = rtc_v0.y;\n\n terrainVerticesHigh[vInd] = _tempHigh.z;\n terrainVerticesLow[vInd] = _tempLow.z;\n terrainVertices[vInd++] = rtc_v0.z;\n\n noDataInd++;\n }\n\n if (i !== fileGridSize && j !== fileGridSize) {\n //\n // V1\n //\n var hInd1 = k + 1;\n var vInd1 = hInd1 * 3;\n var elv = elevations[hInd1];\n if (checkNoDataValue(noDataValues, elv)) {\n elv = 0.0;\n }\n var h1 = hf * elv;\n var v1 = new Vec3(\n rtc_x + nv[vInd1] + h1 * nn[vInd1],\n rtc_y + nv[vInd1 + 1] + h1 * nn[vInd1 + 1],\n rtc_z + nv[vInd1 + 2] + h1 * nn[vInd1 + 2]\n );\n\n normalMapVertices[vInd1] = v1.x - rtc_x;\n normalMapVertices[vInd1 + 1] = v1.y - rtc_y;\n normalMapVertices[vInd1 + 2] = v1.z - rtc_z;\n\n //\n // V2\n //\n var hInd2 = k + fileGridSize_one;\n var vInd2 = hInd2 * 3;\n elv = elevations[hInd2];\n if (checkNoDataValue(noDataValues, elv)) {\n elv = 0.0;\n }\n var h2 = hf * elv;\n var v2 = new Vec3(\n rtc_x + nv[vInd2] + h2 * nn[vInd2],\n rtc_y + nv[vInd2 + 1] + h2 * nn[vInd2 + 1],\n rtc_z + nv[vInd2 + 2] + h2 * nn[vInd2 + 2]\n );\n\n normalMapVertices[vInd2] = v2.x - rtc_x;\n normalMapVertices[vInd2 + 1] = v2.y - rtc_y;\n normalMapVertices[vInd2 + 2] = v2.z - rtc_z;\n\n //\n // V3\n //\n var hInd3 = k + fileGridSize_one + 1;\n var vInd3 = hInd3 * 3;\n elv = elevations[hInd3];\n if (checkNoDataValue(noDataValues, elv)) {\n elv = 0.0;\n }\n var h3 = hf * elv;\n var v3 = new Vec3(\n rtc_x + nv[vInd3] + h3 * nn[vInd3],\n rtc_y + nv[vInd3 + 1] + h3 * nn[vInd3 + 1],\n rtc_z + nv[vInd3 + 2] + h3 * nn[vInd3 + 2]\n );\n\n normalMapVertices[vInd3] = v3.x - rtc_x;\n normalMapVertices[vInd3 + 1] = v3.y - rtc_y;\n normalMapVertices[vInd3 + 2] = v3.z - rtc_z;\n\n //\n // Normal\n //\n var e10 = v1.sub(v0),\n e20 = v2.sub(v0),\n e30 = v3.sub(v0);\n\n var sw = e20.cross(e30).normalize();\n var ne = e30.cross(e10).normalize();\n var n0 = ne.add(sw).normalize();\n\n normalMapNormals[vInd0] += n0.x;\n normalMapNormals[vInd0 + 1] += n0.y;\n normalMapNormals[vInd0 + 2] += n0.z;\n\n normalMapNormals[vInd1] += ne.x;\n normalMapNormals[vInd1 + 1] += ne.y;\n normalMapNormals[vInd1 + 2] += ne.z;\n\n normalMapNormals[vInd2] += sw.x;\n normalMapNormals[vInd2 + 1] += sw.y;\n normalMapNormals[vInd2 + 2] += sw.z;\n\n normalMapNormals[vInd3] += n0.x;\n normalMapNormals[vInd3 + 1] += n0.y;\n normalMapNormals[vInd3 + 2] += n0.z;\n }\n }\n } else {\n normalMapNormals = new Float32Array(gsgs3);\n normalMapVertices = new Float64Array(gsgs3);\n\n var oneSize = tgs / fileGridSize;\n var gsgs = gsgs3 / 3;\n var fgsOne = fileGridSize + 1;\n\n for (let i = 0; i < gsgs; i++) {\n let ii = Math.floor(i / gs),\n ij = i % gs;\n\n let qii = ii % oneSize,\n qij = ij % oneSize;\n\n let hlt_ind = Math.floor(ii / oneSize) * fgsOne + Math.floor(ij / oneSize);\n\n if (ij === tgs) {\n hlt_ind -= 1;\n qij = oneSize;\n }\n\n if (ii === tgs) {\n hlt_ind -= fgsOne;\n qii = oneSize;\n }\n\n let hrt_ind = hlt_ind + 1,\n hlb_ind = hlt_ind + fgsOne,\n hrb_ind = hlb_ind + 1;\n\n let h_lt = elevations[hlt_ind],\n h_rt = elevations[hrt_ind],\n h_lb = elevations[hlb_ind],\n h_rb = elevations[hrb_ind];\n\n if (checkNoDataValue(noDataValues, h_lt)) {\n h_lt = 0.0;\n }\n\n if (checkNoDataValue(noDataValues, h_rt)) {\n h_rt = 0.0;\n }\n\n if (checkNoDataValue(noDataValues, h_lb)) {\n h_lb = 0.0;\n }\n\n if (checkNoDataValue(noDataValues, h_rb)) {\n h_rb = 0.0;\n }\n\n let hi = blerp(qij / oneSize, qii / oneSize, h_lt, h_rt, h_lb, h_rb);\n\n let i3 = i * 3;\n\n _rtcTempVec.x = this_plainVertices[i3] + hi * this_plainNormals[i3];\n _rtcTempVec.y = this_plainVertices[i3 + 1] + hi * this_plainNormals[i3 + 1];\n _rtcTempVec.z = this_plainVertices[i3 + 2] + hi * this_plainNormals[i3 + 2];\n\n doubleToTwoFloats(_rtcTempVec, _tempHigh, _tempLow);\n\n terrainVertices[i3] = _rtcTempVec.x;\n terrainVertices[i3 + 1] = _rtcTempVec.y;\n terrainVertices[i3 + 2] = _rtcTempVec.z;\n\n terrainVerticesHigh[i3] = _tempHigh.x;\n terrainVerticesHigh[i3 + 1] = _tempHigh.y;\n terrainVerticesHigh[i3 + 2] = _tempHigh.z;\n\n terrainVerticesLow[i3] = _tempLow.x;\n terrainVerticesLow[i3 + 1] = _tempLow.y;\n terrainVerticesLow[i3 + 2] = _tempLow.z;\n\n _tempVec.x = _rtcTempVec.x + rtc_x;\n _tempVec.y = _rtcTempVec.y + rtc_y;\n _tempVec.z = _rtcTempVec.z + rtc_z;\n\n if (_tempVec.x < xmin) xmin = _tempVec.x;\n if (_tempVec.x > xmax) xmax = _tempVec.x;\n if (_tempVec.y < ymin) ymin = _tempVec.y;\n if (_tempVec.y > ymax) ymax = _tempVec.y;\n if (_tempVec.z < zmin) zmin = _tempVec.z;\n if (_tempVec.z > zmax) zmax = _tempVec.z;\n }\n\n normalMapVertices.set(terrainVertices);\n\n for (let k = 0; k < gsgs; k++) {\n let j = k % gs,\n i = ~~(k / gs);\n\n if (i !== tgs && j !== tgs) {\n let v0ind = k * 3,\n v1ind = v0ind + 3,\n v2ind = v0ind + gs * 3,\n v3ind = v2ind + 3;\n\n let v0 = new Vec3(\n terrainVertices[v0ind] + rtc_x,\n terrainVertices[v0ind + 1] + rtc_y,\n terrainVertices[v0ind + 2] + rtc_z\n ),\n v1 = new Vec3(\n terrainVertices[v1ind] + rtc_x,\n terrainVertices[v1ind + 1] + rtc_y,\n terrainVertices[v1ind + 2] + rtc_z\n ),\n v2 = new Vec3(\n terrainVertices[v2ind] + rtc_x,\n terrainVertices[v2ind + 1] + rtc_y,\n terrainVertices[v2ind + 2] + rtc_z\n ),\n v3 = new Vec3(\n terrainVertices[v3ind] + rtc_x,\n terrainVertices[v3ind + 1] + rtc_y,\n terrainVertices[v3ind + 2] + rtc_z\n );\n\n let e10 = v1.sub(v0).normalize(),\n e20 = v2.sub(v0).normalize(),\n e30 = v3.sub(v0).normalize();\n\n let sw = e20.cross(e30).normalize();\n let ne = e30.cross(e10).normalize();\n let n0 = ne.add(sw).normalize();\n\n normalMapNormals[v0ind] += n0.x;\n normalMapNormals[v0ind + 1] += n0.y;\n normalMapNormals[v0ind + 2] += n0.z;\n\n normalMapNormals[v1ind] += ne.x;\n normalMapNormals[v1ind + 1] += ne.y;\n normalMapNormals[v1ind + 2] += ne.z;\n\n normalMapNormals[v2ind] += sw.x;\n normalMapNormals[v2ind + 1] += sw.y;\n normalMapNormals[v2ind + 2] += sw.z;\n\n normalMapNormals[v3ind] += n0.x;\n normalMapNormals[v3ind + 1] += n0.y;\n normalMapNormals[v3ind + 2] += n0.z;\n }\n }\n }\n\n self.postMessage(\n {\n id: id,\n normalMapNormals: normalMapNormals,\n normalMapVertices: normalMapVertices,\n terrainVertices: terrainVertices,\n terrainVerticesHigh: terrainVerticesHigh,\n terrainVerticesLow: terrainVerticesLow,\n noDataVertices: noDataVertices,\n bounds: [xmin, ymin, zmin, xmax, ymax, zmax],\n relativeCenter: e.data.relativeCenter\n },\n [\n normalMapNormals.buffer,\n normalMapVertices.buffer,\n terrainVertices.buffer,\n terrainVerticesHigh.buffer,\n terrainVerticesLow.buffer,\n noDataVertices.buffer\n ]\n );\n};\n"],"mappings":"yBAiBA,SAAS,EAAiB,EAAc,EAAA,CACpC,OAbJ,SAA0B,EAAK,EAAA,CAC3B,IAAI,EAAQ,EACR,EAAM,EAAI,OAAS,EACvB,KAAO,GAAS,GAAK,CACjB,IAAI,EAAI,KAAK,MAAsB,IAAf,EAAQ,EAAA,EAC5B,GAAI,KAAK,IAAI,EAAI,GAAK,CAAA,EAAK,KAAM,OAAO,EAC/B,EAAI,GAAK,EAAG,EAAQ,EAAI,EAC5B,EAAM,EAAI,CACnB,CACA,M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AA,CAG3B,CAAA,EAAA,CAAA"}
|
package/lib/camera/Camera.d.ts
CHANGED
|
@@ -144,6 +144,12 @@ declare class Camera {
|
|
|
144
144
|
protected _pb: Vec3;
|
|
145
145
|
protected _peye: Vec3;
|
|
146
146
|
isMoving: boolean;
|
|
147
|
+
protected _pViewAngle: number;
|
|
148
|
+
protected _pAspect: number;
|
|
149
|
+
protected _pWidth: number;
|
|
150
|
+
protected _pHeight: number;
|
|
151
|
+
protected _pIsOrthographic: boolean;
|
|
152
|
+
protected _pFocusDistance: number;
|
|
147
153
|
protected _tanViewAngle_hrad: number;
|
|
148
154
|
_tanViewAngle_hradOneByHeight: number;
|
|
149
155
|
protected _projSizeConst: number;
|
|
@@ -245,10 +251,20 @@ declare class Camera {
|
|
|
245
251
|
*/
|
|
246
252
|
isFlying(): boolean;
|
|
247
253
|
/**
|
|
248
|
-
* Checks
|
|
254
|
+
* Checks camera movement and projection changes.
|
|
249
255
|
* @public
|
|
250
256
|
*/
|
|
251
|
-
|
|
257
|
+
checkViewChanges(): void;
|
|
258
|
+
/**
|
|
259
|
+
* Checks whether the camera stopped moving and dispatches `moveend`.
|
|
260
|
+
* @protected
|
|
261
|
+
*/
|
|
262
|
+
protected _checkMoveEnd(): void;
|
|
263
|
+
/**
|
|
264
|
+
* Checks whether the camera view or projection changed and dispatches `viewchange`.
|
|
265
|
+
* @protected
|
|
266
|
+
*/
|
|
267
|
+
protected _checkViewChange(): void;
|
|
252
268
|
/**
|
|
253
269
|
* Binds picking colors for all frustums.
|
|
254
270
|
* @public
|
|
@@ -14,9 +14,6 @@ export interface IPlanetFlyCartesianParams extends IFlyCartesianParams {
|
|
|
14
14
|
preventLock?: boolean;
|
|
15
15
|
linearPath?: boolean;
|
|
16
16
|
}
|
|
17
|
-
export interface IPlanetFlyDistanceParams extends IPlanetFlyCartesianParams {
|
|
18
|
-
distance?: number;
|
|
19
|
-
}
|
|
20
17
|
/**
|
|
21
18
|
* Planet camera.
|
|
22
19
|
* @class
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Camera } from "../../camera/Camera";
|
|
2
|
+
import { PlanetCamera } from "../../camera/PlanetCamera";
|
|
3
|
+
import { Entity } from "../../entity/Entity";
|
|
4
|
+
import { LonLat } from "../../LonLat";
|
|
5
|
+
import { Vec3 } from "../../math/Vec3";
|
|
6
|
+
import { QuadTreeStrategy } from "../../quadTree";
|
|
7
|
+
import type { Renderer } from "../../renderer/Renderer";
|
|
8
|
+
import type { Planet } from "../../scene/Planet";
|
|
9
|
+
import { Framebuffer } from "../../webgl";
|
|
10
|
+
import { Vector } from "../../layer/Vector";
|
|
11
|
+
import type { DepthCameraHandler } from "./DepthCameraHandler";
|
|
12
|
+
interface IPerimeterSegmentsData {
|
|
13
|
+
segments: LonLat[][];
|
|
14
|
+
isClosed: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface IDepthCameraParams {
|
|
17
|
+
enabled?: boolean;
|
|
18
|
+
width?: number;
|
|
19
|
+
height?: number;
|
|
20
|
+
near?: number;
|
|
21
|
+
far?: number;
|
|
22
|
+
verticalViewAngle?: number;
|
|
23
|
+
horizontalViewAngle?: number;
|
|
24
|
+
showFrustum?: boolean;
|
|
25
|
+
showFootprint?: boolean;
|
|
26
|
+
excludeLayers?: Vector[];
|
|
27
|
+
bias?: number;
|
|
28
|
+
normalBias?: number;
|
|
29
|
+
depthEpsilon?: number;
|
|
30
|
+
}
|
|
31
|
+
export declare class DepthCamera {
|
|
32
|
+
protected static __counter__: number;
|
|
33
|
+
readonly id: number;
|
|
34
|
+
readonly width: number;
|
|
35
|
+
readonly height: number;
|
|
36
|
+
readonly near: number;
|
|
37
|
+
readonly far: number;
|
|
38
|
+
readonly verticalViewAngle: number;
|
|
39
|
+
readonly horizontalViewAngle?: number;
|
|
40
|
+
readonly excludeLayers: Vector[];
|
|
41
|
+
bias: number;
|
|
42
|
+
normalBias: number;
|
|
43
|
+
depthEpsilon: number;
|
|
44
|
+
enabled: boolean;
|
|
45
|
+
camera: Camera;
|
|
46
|
+
framebuffer: Framebuffer;
|
|
47
|
+
quadTreeStrategy: QuadTreeStrategy;
|
|
48
|
+
_handler: DepthCameraHandler | null;
|
|
49
|
+
_handlerIndex: number;
|
|
50
|
+
protected _planet: Planet | null;
|
|
51
|
+
protected _renderer: Renderer | null;
|
|
52
|
+
protected _initialized: boolean;
|
|
53
|
+
protected _forceOwnQuadTreeStrategyPass: boolean;
|
|
54
|
+
protected _showFrustum: boolean;
|
|
55
|
+
protected _showFootprint: boolean;
|
|
56
|
+
protected _cameraFrustumEntity: Entity | null;
|
|
57
|
+
protected _cameraFootprintEntity: Entity | null;
|
|
58
|
+
protected _cameraFootprintSegmentPointCounts: number[];
|
|
59
|
+
protected _cameraFootprintClosedState: boolean;
|
|
60
|
+
protected _prevCameraPos: Vec3;
|
|
61
|
+
protected _prevCameraPitch: number;
|
|
62
|
+
protected _prevCameraYaw: number;
|
|
63
|
+
protected _prevCameraRoll: number;
|
|
64
|
+
protected _prevCameraFrustumEntityPos: Vec3;
|
|
65
|
+
protected _prevCameraFrustumEntityPitch: number;
|
|
66
|
+
protected _prevCameraFrustumEntityYaw: number;
|
|
67
|
+
protected _prevCameraFrustumEntityRoll: number;
|
|
68
|
+
constructor(params?: IDepthCameraParams);
|
|
69
|
+
get initialized(): boolean;
|
|
70
|
+
get showFrustum(): boolean;
|
|
71
|
+
set showFrustum(showFrustum: boolean);
|
|
72
|
+
get showFootprint(): boolean;
|
|
73
|
+
set showFootprint(showFootprint: boolean);
|
|
74
|
+
get cameraFootprintEntity(): Entity | null;
|
|
75
|
+
get cameraFrustumEntity(): Entity | null;
|
|
76
|
+
get frustumScale(): Vec3;
|
|
77
|
+
init(planet: Planet, renderer: Renderer): void;
|
|
78
|
+
destroy(): void;
|
|
79
|
+
frame(): void;
|
|
80
|
+
prepareFrame(): void;
|
|
81
|
+
finishFrame(): void;
|
|
82
|
+
renderFootprint(): void;
|
|
83
|
+
getCamera(): Camera;
|
|
84
|
+
getFramebuffer(): Framebuffer;
|
|
85
|
+
getDepthTexture(): WebGLTexture;
|
|
86
|
+
getCartesianFromPixelTerrain(x: number, y: number): Vec3 | undefined;
|
|
87
|
+
getLonLatFromPixelTerrain(x: number, y: number): LonLat | undefined;
|
|
88
|
+
protected _createCameraFootprintEntity(): Entity;
|
|
89
|
+
protected _createCameraFrustumEntity(): Entity;
|
|
90
|
+
protected _createCamera(planet: Planet): Camera;
|
|
91
|
+
protected _createFramebuffer(renderer: Renderer): Framebuffer;
|
|
92
|
+
protected _createQuadTreeStrategy(planet: Planet, camera: PlanetCamera): QuadTreeStrategy;
|
|
93
|
+
protected _getQuadTreeStrategy(depthCamera: PlanetCamera): QuadTreeStrategy;
|
|
94
|
+
protected _segmentsPass(camera: PlanetCamera, quadTreeStrategy: QuadTreeStrategy): void;
|
|
95
|
+
protected _geoObjectsPass(camera: PlanetCamera): void;
|
|
96
|
+
protected _collectPerimeterLonLats(width: number, height: number): IPerimeterSegmentsData;
|
|
97
|
+
}
|
|
98
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Control, IControlParams } from "../Control";
|
|
2
|
+
import { DepthCamera } from "./DepthCamera";
|
|
3
|
+
import { Vector } from "../../layer";
|
|
4
|
+
export interface IDepthCameraHandlerParams extends IControlParams {
|
|
5
|
+
depthCameras?: DepthCamera[];
|
|
6
|
+
}
|
|
7
|
+
export declare class DepthCameraHandler extends Control {
|
|
8
|
+
protected _depthCameras: DepthCamera[];
|
|
9
|
+
readonly cameraFootprintLayer: Vector;
|
|
10
|
+
readonly cameraFrustumLayer: Vector;
|
|
11
|
+
constructor(params?: IDepthCameraHandlerParams);
|
|
12
|
+
get depthCameras(): DepthCamera[];
|
|
13
|
+
add(depthCamera: DepthCamera): DepthCamera;
|
|
14
|
+
remove(): void;
|
|
15
|
+
remove(depthCamera: DepthCamera): boolean;
|
|
16
|
+
clear(): void;
|
|
17
|
+
oninit(): void;
|
|
18
|
+
onactivate(): void;
|
|
19
|
+
ondeactivate(): void;
|
|
20
|
+
onremove(): void;
|
|
21
|
+
protected _initDepthCamera(depthCamera: DepthCamera): void;
|
|
22
|
+
protected _addDepthCameraEntities(depthCamera: DepthCamera): void;
|
|
23
|
+
protected _removeDepthCameraEntities(depthCamera: DepthCamera): void;
|
|
24
|
+
protected _onDraw: () => void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Camera } from "../../camera/Camera";
|
|
2
|
+
import type { DepthCamera } from "../depthCamera/DepthCamera";
|
|
3
|
+
import { Entity } from "../../entity/Entity";
|
|
4
|
+
import { Checkbox } from "../../ui/Checkbox";
|
|
5
|
+
import { Input } from "../../ui/Input";
|
|
6
|
+
import { TitleBarView } from "../../ui/TitleBarView";
|
|
7
|
+
import { View, type IViewParams } from "../../ui/View";
|
|
8
|
+
interface ICameraEditorViewParams extends IViewParams {
|
|
9
|
+
entity: Entity;
|
|
10
|
+
}
|
|
11
|
+
export declare function hasEntityEditorDepthCamera(entity: Entity): boolean;
|
|
12
|
+
export declare class CameraEditorView extends View<Entity> {
|
|
13
|
+
protected _nearView: Input;
|
|
14
|
+
protected _farView: Input;
|
|
15
|
+
protected _verticalFovView: Input;
|
|
16
|
+
protected _horizontalFovView: Input;
|
|
17
|
+
protected _viewportWidthView: Input;
|
|
18
|
+
protected _viewportHeightView: Input;
|
|
19
|
+
protected _showFrustumView: Checkbox;
|
|
20
|
+
protected _showFootprintView: Checkbox;
|
|
21
|
+
protected _biasView: Input;
|
|
22
|
+
protected _normalBiasView: Input;
|
|
23
|
+
protected _depthEpsilonView: Input;
|
|
24
|
+
protected _titleBarView: TitleBarView;
|
|
25
|
+
protected _bodyEl: HTMLElement | null;
|
|
26
|
+
protected _depthCamera: DepthCamera | null;
|
|
27
|
+
constructor(params: ICameraEditorViewParams);
|
|
28
|
+
bindEntity(entity: Entity): void;
|
|
29
|
+
render(params?: unknown): this;
|
|
30
|
+
refresh(): void;
|
|
31
|
+
protected _getCamera(): Camera | null;
|
|
32
|
+
remove(): void;
|
|
33
|
+
protected _onTitleBarChange: (isCollapsed: boolean) => void;
|
|
34
|
+
protected _setNearFar(near: number, far: number): void;
|
|
35
|
+
protected _syncFrustumEntityScale(): void;
|
|
36
|
+
protected _onChangeNear: (value: string) => void;
|
|
37
|
+
protected _onChangeFar: (value: string) => void;
|
|
38
|
+
protected _onChangeVerticalFov: (value: string) => void;
|
|
39
|
+
protected _onChangeHorizontalFov: (value: string) => void;
|
|
40
|
+
protected _setViewportSize(width: number, height: number): void;
|
|
41
|
+
protected _onChangeViewportWidth: (value: string) => void;
|
|
42
|
+
protected _onChangeViewportHeight: (value: string) => void;
|
|
43
|
+
protected _onChangeShowFrustum: (showFrustum: boolean) => void;
|
|
44
|
+
protected _onChangeShowFootprint: (showFootprint: boolean) => void;
|
|
45
|
+
protected _onChangeBias: (value: string) => void;
|
|
46
|
+
protected _onChangeNormalBias: (value: string) => void;
|
|
47
|
+
protected _onChangeDepthEpsilon: (value: string) => void;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Control, type IControlParams } from "../Control";
|
|
2
|
-
import { EntityEditorScene } from "./EntityEditorScene";
|
|
2
|
+
import { EntityEditorScene, type EditModeName } from "./EntityEditorScene";
|
|
3
3
|
import { EntityEditorDialog } from "./EntityEditorDialog";
|
|
4
4
|
import { Entity } from "../../entity/Entity";
|
|
5
5
|
import { Dialog } from "../../ui";
|
|
6
6
|
export interface IEntityEditorParams extends IControlParams {
|
|
7
|
+
editMode?: EditModeName;
|
|
7
8
|
}
|
|
8
9
|
export declare class EntityEditor extends Control {
|
|
9
10
|
protected _entityEditorScene: EntityEditorScene;
|
|
@@ -1,35 +1,17 @@
|
|
|
1
1
|
import { Dialog, type IDialogParams } from "../../ui/Dialog";
|
|
2
2
|
import { EntityEditorScene } from "./EntityEditorScene";
|
|
3
3
|
import { Entity } from "../../entity/Entity";
|
|
4
|
-
import { Input } from "../../ui/Input";
|
|
5
|
-
import { Checkbox } from "../../ui/Checkbox";
|
|
6
4
|
import { Vec3 } from "../../math/Vec3";
|
|
7
|
-
import {
|
|
5
|
+
import { CameraEditorView } from "./CameraEditorView";
|
|
6
|
+
import { EntityEditorView } from "./EntityEditorView";
|
|
7
|
+
import { ProjectorEditorView } from "./ProjectorEditorView";
|
|
8
8
|
interface IEntityEditorDialog extends IDialogParams {
|
|
9
9
|
model: EntityEditorScene;
|
|
10
10
|
}
|
|
11
11
|
export declare class EntityEditorDialog extends Dialog<EntityEditorScene> {
|
|
12
|
-
protected
|
|
13
|
-
protected
|
|
14
|
-
protected
|
|
15
|
-
protected _heightView: Input;
|
|
16
|
-
protected _xView: Input;
|
|
17
|
-
protected _yView: Input;
|
|
18
|
-
protected _zView: Input;
|
|
19
|
-
protected _absXView: Input;
|
|
20
|
-
protected _absYView: Input;
|
|
21
|
-
protected _absZView: Input;
|
|
22
|
-
protected _pitchView: Input;
|
|
23
|
-
protected _yawView: Input;
|
|
24
|
-
protected _rollView: Input;
|
|
25
|
-
protected _absolutePitchView: Input;
|
|
26
|
-
protected _absoluteYawView: Input;
|
|
27
|
-
protected _absoluteRollView: Input;
|
|
28
|
-
protected _scaleView: Input;
|
|
29
|
-
protected _scaleXView: Input;
|
|
30
|
-
protected _scaleYView: Input;
|
|
31
|
-
protected _scaleZView: Input;
|
|
32
|
-
protected _opacityView: Slider;
|
|
12
|
+
protected _entityView: EntityEditorView | null;
|
|
13
|
+
protected _cameraView: CameraEditorView | null;
|
|
14
|
+
protected _projectorView: ProjectorEditorView | null;
|
|
33
15
|
constructor(params: IEntityEditorDialog);
|
|
34
16
|
render(params: any): this;
|
|
35
17
|
protected _onVisibility: (vis: boolean) => void;
|
|
@@ -37,34 +19,20 @@ export declare class EntityEditorDialog extends Dialog<EntityEditorScene> {
|
|
|
37
19
|
protected _initSceneEvents(): void;
|
|
38
20
|
protected _clearSceneEvents(): void;
|
|
39
21
|
protected _onSelect: (entity: Entity) => void;
|
|
40
|
-
protected
|
|
22
|
+
protected _refreshViews(entity: Entity): void;
|
|
23
|
+
protected _refreshEntityView(entity: Entity): void;
|
|
24
|
+
protected _removeEntityView(): void;
|
|
25
|
+
protected _refreshCameraView(entity: Entity): void;
|
|
26
|
+
protected _removeCameraView(): void;
|
|
27
|
+
protected _refreshProjectorView(entity: Entity): void;
|
|
28
|
+
protected _removeProjectorView(): void;
|
|
29
|
+
protected _removeViews(): void;
|
|
41
30
|
protected _setDialogTitle(entity: Entity): void;
|
|
42
31
|
hide(): void;
|
|
43
|
-
protected _onUnselect: (
|
|
44
|
-
protected _onChangeRelativePosition: (checked: boolean) => void;
|
|
32
|
+
protected _onUnselect: () => void;
|
|
45
33
|
protected _onPosition: (pos: Vec3, entity: Entity) => void;
|
|
46
34
|
protected _onPitch: (a: number, entity: Entity) => void;
|
|
47
35
|
protected _onYaw: (a: number, entity: Entity) => void;
|
|
48
36
|
protected _onRoll: (a: number, entity: Entity) => void;
|
|
49
|
-
protected _onChangeLon: (val: string) => void;
|
|
50
|
-
protected _onChangeLat: (val: string) => void;
|
|
51
|
-
protected _onChangeHeight: (val: string) => void;
|
|
52
|
-
protected _onChangeX: (val: string) => void;
|
|
53
|
-
protected _onChangeY: (val: string) => void;
|
|
54
|
-
protected _onChangeZ: (val: string) => void;
|
|
55
|
-
protected _onChangeAbsoluteX: (val: string) => void;
|
|
56
|
-
protected _onChangeAbsoluteY: (val: string) => void;
|
|
57
|
-
protected _onChangeAbsoluteZ: (val: string) => void;
|
|
58
|
-
protected _onChangePitch: (val: string) => void;
|
|
59
|
-
protected _onChangeYaw: (val: string) => void;
|
|
60
|
-
protected _onChangeRoll: (val: string) => void;
|
|
61
|
-
protected _onChangeAbsolutePitch: (val: string) => void;
|
|
62
|
-
protected _onChangeAbsoluteYaw: (val: string) => void;
|
|
63
|
-
protected _onChangeAbsoluteRoll: (val: string) => void;
|
|
64
|
-
protected _onChangeScale: (val: string) => void;
|
|
65
|
-
protected _onChangeScaleX: (val: string) => void;
|
|
66
|
-
protected _onChangeScaleY: (val: string) => void;
|
|
67
|
-
protected _onChangeScaleZ: (val: string) => void;
|
|
68
|
-
protected _onChangeOpacity: (val: number) => void;
|
|
69
37
|
}
|
|
70
38
|
export {};
|
|
@@ -15,7 +15,12 @@ import { EntityCollection } from "../../entity/EntityCollection";
|
|
|
15
15
|
export interface IEntityEditorSceneParams {
|
|
16
16
|
planet?: Planet;
|
|
17
17
|
name?: string;
|
|
18
|
+
editMode?: EditModeName;
|
|
18
19
|
}
|
|
20
|
+
export declare const NATIVE_MODE = 0;
|
|
21
|
+
export declare const YAW_MODE = 1;
|
|
22
|
+
export type EditMode = typeof NATIVE_MODE | typeof YAW_MODE;
|
|
23
|
+
export type EditModeName = "native" | "yaw";
|
|
19
24
|
type EntityEditorSceneEventsList = [
|
|
20
25
|
"mousemove",
|
|
21
26
|
"mouseenter",
|
|
@@ -62,6 +67,7 @@ declare class EntityEditorScene extends Scene {
|
|
|
62
67
|
protected _axisTrackLayer: EntityCollection;
|
|
63
68
|
protected _selectedEntity: Entity | null;
|
|
64
69
|
protected _selectedEntityCart: Vec3;
|
|
70
|
+
protected _selectedEntityRotation: Quat;
|
|
65
71
|
protected _selectedEntityPitch: number;
|
|
66
72
|
protected _selectedEntityYaw: number;
|
|
67
73
|
protected _selectedEntityRoll: number;
|
|
@@ -73,10 +79,14 @@ declare class EntityEditorScene extends Scene {
|
|
|
73
79
|
protected _selectedMove: string | null;
|
|
74
80
|
protected _ops: Record<string, (mouseState: IMouseState) => void>;
|
|
75
81
|
protected _axisTrackVisibility: boolean;
|
|
82
|
+
protected _editMode: EditMode;
|
|
76
83
|
constructor(options?: IEntityEditorSceneParams);
|
|
77
84
|
get ellipsoid(): Ellipsoid | undefined;
|
|
78
85
|
get planet(): Planet | null;
|
|
86
|
+
get editMode(): EditMode;
|
|
87
|
+
set editMode(mode: EditMode);
|
|
79
88
|
bindPlanet(planet: Planet): void;
|
|
89
|
+
protected _parseEditMode(mode: EditModeName | undefined): EditMode;
|
|
80
90
|
init(): void;
|
|
81
91
|
onremove(): void;
|
|
82
92
|
protected _addAxisLayers(): void;
|
|
@@ -113,6 +123,12 @@ declare class EntityEditorScene extends Scene {
|
|
|
113
123
|
protected _moveXY: (e: IMouseState) => void;
|
|
114
124
|
protected _moveZY: (e: IMouseState) => void;
|
|
115
125
|
getFrameRotation(cartesian: Vec3): Quat;
|
|
126
|
+
protected _isPlanetEntity(entity: Entity): boolean;
|
|
127
|
+
protected _isYawMode(): boolean;
|
|
128
|
+
protected _getYawModeFrameRotation(entity: Entity, cart: Vec3): Quat;
|
|
129
|
+
protected _getEntityRotation(entity: Entity, cart: Vec3): Quat;
|
|
130
|
+
protected _setRotateEntityCartesian3v(entity: Entity, cart: Vec3): void;
|
|
131
|
+
protected _setEntityRotation(entity: Entity, rotation: Quat, cart: Vec3): void;
|
|
116
132
|
protected _rotatePitch: (e: IMouseState) => void;
|
|
117
133
|
protected _rotateYaw: (e: IMouseState) => void;
|
|
118
134
|
protected _rotateRoll: (e: IMouseState) => void;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Entity } from "../../entity/Entity";
|
|
2
|
+
import { Checkbox } from "../../ui/Checkbox";
|
|
3
|
+
import { Input } from "../../ui/Input";
|
|
4
|
+
import { Slider } from "../../ui/Slider";
|
|
5
|
+
import { TitleBarView } from "../../ui/TitleBarView";
|
|
6
|
+
import { View, type IViewParams } from "../../ui/View";
|
|
7
|
+
import { EntityEditorScene } from "./EntityEditorScene";
|
|
8
|
+
interface IEntityEditorViewParams extends IViewParams {
|
|
9
|
+
model: EntityEditorScene;
|
|
10
|
+
entity?: Entity;
|
|
11
|
+
}
|
|
12
|
+
export declare class EntityEditorView extends View<EntityEditorScene> {
|
|
13
|
+
protected _entity: Entity | null;
|
|
14
|
+
protected _titleBarView: TitleBarView;
|
|
15
|
+
protected _bodyEl: HTMLElement | null;
|
|
16
|
+
protected _relativePositionView: Checkbox;
|
|
17
|
+
protected _yawModeView: Checkbox;
|
|
18
|
+
protected _lonView: Input;
|
|
19
|
+
protected _latView: Input;
|
|
20
|
+
protected _heightView: Input;
|
|
21
|
+
protected _xView: Input;
|
|
22
|
+
protected _yView: Input;
|
|
23
|
+
protected _zView: Input;
|
|
24
|
+
protected _absXView: Input;
|
|
25
|
+
protected _absYView: Input;
|
|
26
|
+
protected _absZView: Input;
|
|
27
|
+
protected _pitchView: Input;
|
|
28
|
+
protected _yawView: Input;
|
|
29
|
+
protected _rollView: Input;
|
|
30
|
+
protected _absolutePitchView: Input;
|
|
31
|
+
protected _absoluteYawView: Input;
|
|
32
|
+
protected _absoluteRollView: Input;
|
|
33
|
+
protected _scaleView: Input;
|
|
34
|
+
protected _scaleXView: Input;
|
|
35
|
+
protected _scaleYView: Input;
|
|
36
|
+
protected _scaleZView: Input;
|
|
37
|
+
protected _opacityView: Slider;
|
|
38
|
+
constructor(params: IEntityEditorViewParams);
|
|
39
|
+
bindEntity(entity: Entity): void;
|
|
40
|
+
render(params?: unknown): this;
|
|
41
|
+
refresh(entity?: Entity | null): void;
|
|
42
|
+
refreshRotation(entity?: Entity | null): void;
|
|
43
|
+
remove(): void;
|
|
44
|
+
protected _onTitleBarChange: (isCollapsed: boolean) => void;
|
|
45
|
+
protected _onChangeRelativePosition: (checked: boolean) => void;
|
|
46
|
+
protected _onChangeYawMode: (checked: boolean) => void;
|
|
47
|
+
protected _onChangeLon: (val: string) => void;
|
|
48
|
+
protected _onChangeLat: (val: string) => void;
|
|
49
|
+
protected _onChangeHeight: (val: string) => void;
|
|
50
|
+
protected _onChangeX: (val: string) => void;
|
|
51
|
+
protected _onChangeY: (val: string) => void;
|
|
52
|
+
protected _onChangeZ: (val: string) => void;
|
|
53
|
+
protected _onChangeAbsoluteX: (val: string) => void;
|
|
54
|
+
protected _onChangeAbsoluteY: (val: string) => void;
|
|
55
|
+
protected _onChangeAbsoluteZ: (val: string) => void;
|
|
56
|
+
protected _onChangePitch: (val: string) => void;
|
|
57
|
+
protected _onChangeYaw: (val: string) => void;
|
|
58
|
+
protected _onChangeRoll: (val: string) => void;
|
|
59
|
+
protected _onChangeAbsolutePitch: (val: string) => void;
|
|
60
|
+
protected _onChangeAbsoluteYaw: (val: string) => void;
|
|
61
|
+
protected _onChangeAbsoluteRoll: (val: string) => void;
|
|
62
|
+
protected _onChangeScale: (val: string) => void;
|
|
63
|
+
protected _onChangeScaleX: (val: string) => void;
|
|
64
|
+
protected _onChangeScaleY: (val: string) => void;
|
|
65
|
+
protected _onChangeScaleZ: (val: string) => void;
|
|
66
|
+
protected _onChangeOpacity: (val: number) => void;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Checkbox } from "../../ui/Checkbox";
|
|
2
|
+
import { Color } from "../../ui/Color";
|
|
3
|
+
import { Input } from "../../ui/Input";
|
|
4
|
+
import { TitleBarView } from "../../ui/TitleBarView";
|
|
5
|
+
import { View, type IViewParams } from "../../ui/View";
|
|
6
|
+
import { type Projector } from "../../renderer/projectors/Projector";
|
|
7
|
+
interface IProjectorEditorViewParams extends IViewParams {
|
|
8
|
+
projector: Projector;
|
|
9
|
+
}
|
|
10
|
+
export declare class ProjectorEditorView extends View<Projector> {
|
|
11
|
+
protected _enabledView: Checkbox;
|
|
12
|
+
protected _colorView: Color;
|
|
13
|
+
protected _opacityView: Input;
|
|
14
|
+
protected _priorityView: Input;
|
|
15
|
+
protected _modeEl: HTMLSelectElement | null;
|
|
16
|
+
protected _modeRowEl: HTMLElement | null;
|
|
17
|
+
protected _titleBarView: TitleBarView;
|
|
18
|
+
protected _bodyEl: HTMLElement | null;
|
|
19
|
+
constructor(params: IProjectorEditorViewParams);
|
|
20
|
+
bindProjector(projector: Projector): void;
|
|
21
|
+
render(params?: unknown): this;
|
|
22
|
+
refresh(): void;
|
|
23
|
+
remove(): void;
|
|
24
|
+
protected _onTitleBarChange: (isCollapsed: boolean) => void;
|
|
25
|
+
protected _onChangeEnabled: (enabled: boolean) => void;
|
|
26
|
+
protected _onChangeColor: (color: string) => void;
|
|
27
|
+
protected _onChangeOpacity: (value: string) => void;
|
|
28
|
+
protected _onChangePriority: (value: string) => void;
|
|
29
|
+
protected _onChangeMode: () => void;
|
|
30
|
+
}
|
|
31
|
+
export {};
|