@splnlss/3d-story-viewer 0.8.1 → 0.8.3
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/build/computeElevation.cjs +1 -1
- package/build/computeElevation.js +2 -2
- package/build/index-XZNzHig1.cjs +1 -0
- package/build/{index-DaqGSC4W.js → index-a8PLKOvo.js} +135 -46
- package/build/{main-CY1MzgxV.js → main-CEG3MR57.js} +7051 -6159
- package/build/main-DOWS9MQ7.cjs +1 -0
- package/build/{spark.module-BGYmUUum.js → spark.module-CHPihKhu.js} +2 -2
- package/build/{spark.module-Y1ABc5im.cjs → spark.module-CsQUyNT4.cjs} +1 -1
- package/build/types/src/viewer/GlobeManager.d.ts +10 -0
- package/build/types/src/viewer/WebXRSession.d.ts +77 -0
- package/build/types/src/viewer/XRAttributionPanel.d.ts +23 -0
- package/build/types/src/viewer/XRComfortOverlay.d.ts +15 -0
- package/build/types/src/viewer/XRFrameInput.d.ts +30 -0
- package/build/types/src/viewer/XRNavigationCue.d.ts +10 -0
- package/build/types/src/viewer/XRPlayerRig.d.ts +92 -0
- package/build/types/src/viewer/XRRenderBridge.d.ts +27 -0
- package/build/types/src/viewer/index.d.ts +92 -0
- package/build/types/src/viewer/updateTilesCamera.d.ts +2 -0
- package/build/viewer.cjs +1 -1
- package/build/viewer.js +3 -3
- package/package.json +1 -1
- package/build/index-D87IZDc6.cjs +0 -1
- package/build/main-DFAyOsl5.cjs +0 -1
|
@@ -14837,6 +14837,84 @@ class PlaneGeometry extends BufferGeometry {
|
|
|
14837
14837
|
return new PlaneGeometry(data.width, data.height, data.widthSegments, data.heightSegments);
|
|
14838
14838
|
}
|
|
14839
14839
|
}
|
|
14840
|
+
class RingGeometry extends BufferGeometry {
|
|
14841
|
+
/**
|
|
14842
|
+
* Constructs a new ring geometry.
|
|
14843
|
+
*
|
|
14844
|
+
* @param {number} [innerRadius=0.5] - The inner radius of the ring.
|
|
14845
|
+
* @param {number} [outerRadius=1] - The outer radius of the ring.
|
|
14846
|
+
* @param {number} [thetaSegments=32] - Number of segments. A higher number means the ring will be more round. Minimum is `3`.
|
|
14847
|
+
* @param {number} [phiSegments=1] - Number of segments per ring segment. Minimum is `1`.
|
|
14848
|
+
* @param {number} [thetaStart=0] - Starting angle in radians.
|
|
14849
|
+
* @param {number} [thetaLength=Math.PI*2] - Central angle in radians.
|
|
14850
|
+
*/
|
|
14851
|
+
constructor(innerRadius = 0.5, outerRadius = 1, thetaSegments = 32, phiSegments = 1, thetaStart = 0, thetaLength = Math.PI * 2) {
|
|
14852
|
+
super();
|
|
14853
|
+
this.type = "RingGeometry";
|
|
14854
|
+
this.parameters = {
|
|
14855
|
+
innerRadius,
|
|
14856
|
+
outerRadius,
|
|
14857
|
+
thetaSegments,
|
|
14858
|
+
phiSegments,
|
|
14859
|
+
thetaStart,
|
|
14860
|
+
thetaLength
|
|
14861
|
+
};
|
|
14862
|
+
thetaSegments = Math.max(3, thetaSegments);
|
|
14863
|
+
phiSegments = Math.max(1, phiSegments);
|
|
14864
|
+
const indices = [];
|
|
14865
|
+
const vertices = [];
|
|
14866
|
+
const normals = [];
|
|
14867
|
+
const uvs = [];
|
|
14868
|
+
let radius = innerRadius;
|
|
14869
|
+
const radiusStep = (outerRadius - innerRadius) / phiSegments;
|
|
14870
|
+
const vertex2 = new Vector3$1();
|
|
14871
|
+
const uv = new Vector2();
|
|
14872
|
+
for (let j = 0; j <= phiSegments; j++) {
|
|
14873
|
+
for (let i = 0; i <= thetaSegments; i++) {
|
|
14874
|
+
const segment = thetaStart + i / thetaSegments * thetaLength;
|
|
14875
|
+
vertex2.x = radius * Math.cos(segment);
|
|
14876
|
+
vertex2.y = radius * Math.sin(segment);
|
|
14877
|
+
vertices.push(vertex2.x, vertex2.y, vertex2.z);
|
|
14878
|
+
normals.push(0, 0, 1);
|
|
14879
|
+
uv.x = (vertex2.x / outerRadius + 1) / 2;
|
|
14880
|
+
uv.y = (vertex2.y / outerRadius + 1) / 2;
|
|
14881
|
+
uvs.push(uv.x, uv.y);
|
|
14882
|
+
}
|
|
14883
|
+
radius += radiusStep;
|
|
14884
|
+
}
|
|
14885
|
+
for (let j = 0; j < phiSegments; j++) {
|
|
14886
|
+
const thetaSegmentLevel = j * (thetaSegments + 1);
|
|
14887
|
+
for (let i = 0; i < thetaSegments; i++) {
|
|
14888
|
+
const segment = i + thetaSegmentLevel;
|
|
14889
|
+
const a = segment;
|
|
14890
|
+
const b = segment + thetaSegments + 1;
|
|
14891
|
+
const c = segment + thetaSegments + 2;
|
|
14892
|
+
const d = segment + 1;
|
|
14893
|
+
indices.push(a, b, d);
|
|
14894
|
+
indices.push(b, c, d);
|
|
14895
|
+
}
|
|
14896
|
+
}
|
|
14897
|
+
this.setIndex(indices);
|
|
14898
|
+
this.setAttribute("position", new Float32BufferAttribute(vertices, 3));
|
|
14899
|
+
this.setAttribute("normal", new Float32BufferAttribute(normals, 3));
|
|
14900
|
+
this.setAttribute("uv", new Float32BufferAttribute(uvs, 2));
|
|
14901
|
+
}
|
|
14902
|
+
copy(source) {
|
|
14903
|
+
super.copy(source);
|
|
14904
|
+
this.parameters = Object.assign({}, source.parameters);
|
|
14905
|
+
return this;
|
|
14906
|
+
}
|
|
14907
|
+
/**
|
|
14908
|
+
* Factory method for creating an instance of this class from the given
|
|
14909
|
+
* JSON object.
|
|
14910
|
+
*
|
|
14911
|
+
* @param {Object} data - A JSON object representing the serialized geometry.
|
|
14912
|
+
* @return {RingGeometry} A new instance.
|
|
14913
|
+
*/
|
|
14914
|
+
static fromJSON(data) {
|
|
14915
|
+
return new RingGeometry(data.innerRadius, data.outerRadius, data.thetaSegments, data.phiSegments, data.thetaStart, data.thetaLength);
|
|
14916
|
+
}
|
|
14917
|
+
}
|
|
14840
14918
|
function cloneUniforms(src) {
|
|
14841
14919
|
const dst = {};
|
|
14842
14920
|
for (const u in src) {
|
|
@@ -31445,6 +31523,15 @@ function getEnuBasis(longitude, latitude) {
|
|
|
31445
31523
|
up: [cosLatitude * cosLongitude, cosLatitude * sinLongitude, sinLatitude]
|
|
31446
31524
|
};
|
|
31447
31525
|
}
|
|
31526
|
+
function enuToEcefDelta(translation, longitude, latitude) {
|
|
31527
|
+
validateTuple(translation, "ENU translation");
|
|
31528
|
+
const { east, north, up } = getEnuBasis(longitude, latitude);
|
|
31529
|
+
return [
|
|
31530
|
+
east[0] * translation[0] + north[0] * translation[1] + up[0] * translation[2],
|
|
31531
|
+
east[1] * translation[0] + north[1] * translation[1] + up[1] * translation[2],
|
|
31532
|
+
east[2] * translation[0] + north[2] * translation[1] + up[2] * translation[2]
|
|
31533
|
+
];
|
|
31534
|
+
}
|
|
31448
31535
|
function geodeticOffsetToEcefDelta(position, offset) {
|
|
31449
31536
|
validateLongitudeLatitude(position.lon, position.lat, "Layer root");
|
|
31450
31537
|
requireFiniteNumber(position.alt, "Layer root altitude");
|
|
@@ -39348,52 +39435,54 @@ export {
|
|
|
39348
39435
|
RED_GREEN_RGTC2_Format as ay,
|
|
39349
39436
|
SIGNED_RED_GREEN_RGTC2_Format as az,
|
|
39350
39437
|
Mesh as b,
|
|
39351
|
-
|
|
39352
|
-
|
|
39353
|
-
|
|
39354
|
-
|
|
39355
|
-
|
|
39356
|
-
|
|
39357
|
-
|
|
39358
|
-
|
|
39359
|
-
|
|
39360
|
-
|
|
39361
|
-
|
|
39362
|
-
|
|
39363
|
-
|
|
39364
|
-
|
|
39365
|
-
|
|
39366
|
-
|
|
39367
|
-
|
|
39368
|
-
|
|
39369
|
-
|
|
39370
|
-
|
|
39371
|
-
|
|
39372
|
-
|
|
39373
|
-
|
|
39374
|
-
|
|
39375
|
-
|
|
39376
|
-
|
|
39377
|
-
|
|
39378
|
-
|
|
39379
|
-
|
|
39380
|
-
|
|
39381
|
-
|
|
39382
|
-
|
|
39383
|
-
|
|
39384
|
-
|
|
39385
|
-
|
|
39386
|
-
|
|
39387
|
-
|
|
39388
|
-
|
|
39389
|
-
|
|
39390
|
-
|
|
39391
|
-
|
|
39392
|
-
|
|
39393
|
-
|
|
39394
|
-
|
|
39395
|
-
|
|
39396
|
-
|
|
39438
|
+
REVISION as b0,
|
|
39439
|
+
TextureSource as b1,
|
|
39440
|
+
ImageUtils as b2,
|
|
39441
|
+
Scene as b3,
|
|
39442
|
+
ecefToGeodeticPosition as b4,
|
|
39443
|
+
getEnuBasis as b5,
|
|
39444
|
+
Float32BufferAttribute as b6,
|
|
39445
|
+
LinearMipMapLinearFilter as b7,
|
|
39446
|
+
Triangle as b8,
|
|
39447
|
+
CanvasTexture as b9,
|
|
39448
|
+
RGIntegerFormat as bA,
|
|
39449
|
+
UnsignedIntType as bB,
|
|
39450
|
+
RGBAIntegerFormat as bC,
|
|
39451
|
+
WebGLArrayRenderTarget as bD,
|
|
39452
|
+
GLSL3 as bE,
|
|
39453
|
+
Timer as bF,
|
|
39454
|
+
WebGLCubeRenderTarget as bG,
|
|
39455
|
+
CubeCamera as bH,
|
|
39456
|
+
Camera as bI,
|
|
39457
|
+
PMREMGenerator as bJ,
|
|
39458
|
+
InstancedBufferGeometry as bK,
|
|
39459
|
+
RawShaderMaterial as bL,
|
|
39460
|
+
WebGLRenderer as ba,
|
|
39461
|
+
WebGLRenderTarget as bb,
|
|
39462
|
+
OneFactor as bc,
|
|
39463
|
+
ZeroFactor as bd,
|
|
39464
|
+
CustomBlending as be,
|
|
39465
|
+
Box2 as bf,
|
|
39466
|
+
Matrix2 as bg,
|
|
39467
|
+
Vector4 as bh,
|
|
39468
|
+
validateGeodeticPosition as bi,
|
|
39469
|
+
validateRotation as bj,
|
|
39470
|
+
geodeticToEcefPosition as bk,
|
|
39471
|
+
DataTextureLoader as bl,
|
|
39472
|
+
DataUtils as bm,
|
|
39473
|
+
BackSide as bn,
|
|
39474
|
+
BoxGeometry as bo,
|
|
39475
|
+
normalizeLayerOffset as bp,
|
|
39476
|
+
geodeticOffsetToEcefDelta as bq,
|
|
39477
|
+
validateTuple as br,
|
|
39478
|
+
validateScale as bs,
|
|
39479
|
+
enuToEcefDelta as bt,
|
|
39480
|
+
RingGeometry as bu,
|
|
39481
|
+
AgXToneMapping as bv,
|
|
39482
|
+
EquirectangularReflectionMapping as bw,
|
|
39483
|
+
requireFiniteNumber as bx,
|
|
39484
|
+
computeElevation as by,
|
|
39485
|
+
DataArrayTexture as bz,
|
|
39397
39486
|
ShaderMaterial as c,
|
|
39398
39487
|
Plane as d,
|
|
39399
39488
|
Raycaster as e,
|