@splnlss/3d-story-viewer 0.8.0 → 0.8.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.
@@ -1 +1 @@
1
- "use strict";const e=require("./index-D87IZDc6.cjs");module.exports=e.computeElevation;
1
+ "use strict";const e=require("./index-XZNzHig1.cjs");module.exports=e.computeElevation;
@@ -1,4 +1,4 @@
1
- import { bw } from "./index-Hz3jbrou.js";
1
+ import { by } from "./index-BgprA821.js";
2
2
  export {
3
- bw as default
3
+ by as default
4
4
  };
@@ -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");
@@ -39283,7 +39370,7 @@ export {
39283
39370
  SkinnedMesh as Z,
39284
39371
  LineSegments as _,
39285
39372
  Vector2 as a,
39286
- SIGNED_RED_GREEN_RGTC2_Format as a$,
39373
+ RGB_BPTC_UNSIGNED_Format as a$,
39287
39374
  LineLoop as a0,
39288
39375
  Points as a1,
39289
39376
  Group as a2,
@@ -39294,33 +39381,33 @@ export {
39294
39381
  Bone as a7,
39295
39382
  InterpolateDiscrete as a8,
39296
39383
  InterpolateLinear as a9,
39297
- OneFactor as aA,
39298
- ZeroFactor as aB,
39299
- CustomBlending as aC,
39300
- Box2 as aD,
39301
- Matrix2 as aE,
39302
- Vector4 as aF,
39303
- DataTextureLoader as aG,
39304
- HalfFloatType as aH,
39305
- FloatType as aI,
39306
- DataUtils as aJ,
39307
- REVISION as aK,
39308
- CompressedTexture as aL,
39309
- TextureSource as aM,
39310
- NoColorSpace as aN,
39311
- RGBAFormat as aO,
39312
- ImageUtils as aP,
39313
- Scene as aQ,
39314
- ecefToGeodeticPosition as aR,
39315
- getEnuBasis as aS,
39316
- BackSide as aT,
39317
- BoxGeometry as aU,
39318
- CompressedCubeTexture as aV,
39319
- CompressedArrayTexture as aW,
39320
- RGBA_PVRTC_2BPPV1_Format as aX,
39321
- RGBA_PVRTC_4BPPV1_Format as aY,
39322
- RGBA_BPTC_Format as aZ,
39323
- RED_GREEN_RGTC2_Format as a_,
39384
+ RED_RGTC1_Format as aA,
39385
+ SIGNED_RED_RGTC1_Format as aB,
39386
+ RGBA_S3TC_DXT5_Format as aC,
39387
+ RGB_S3TC_DXT1_Format as aD,
39388
+ RGBA_S3TC_DXT1_Format as aE,
39389
+ RGBA_ASTC_6x6_Format as aF,
39390
+ RGBA_ASTC_4x4_Format as aG,
39391
+ SIGNED_RG11_EAC_Format as aH,
39392
+ RG11_EAC_Format as aI,
39393
+ SIGNED_R11_EAC_Format as aJ,
39394
+ R11_EAC_Format as aK,
39395
+ RGB_ETC2_Format as aL,
39396
+ RGBA_ETC2_EAC_Format as aM,
39397
+ RGBFormat as aN,
39398
+ RedFormat as aO,
39399
+ RGFormat as aP,
39400
+ RGBAFormat as aQ,
39401
+ UnsignedByteType as aR,
39402
+ HalfFloatType as aS,
39403
+ UnsignedInt101111Type as aT,
39404
+ UnsignedInt5999Type as aU,
39405
+ UnsignedShortType as aV,
39406
+ FloatType as aW,
39407
+ DataTexture as aX,
39408
+ Data3DTexture as aY,
39409
+ RGB_PVRTC_4BPPV1_Format as aZ,
39410
+ RGB_ETC1_Format as a_,
39324
39411
  InterleavedBufferAttribute as aa,
39325
39412
  Texture as ab,
39326
39413
  VectorKeyframeTrack as ac,
@@ -39338,62 +39425,64 @@ export {
39338
39425
  DefaultLoadingManager as ao,
39339
39426
  Matrix3$1 as ap,
39340
39427
  TextureUtils as aq,
39341
- Float32BufferAttribute as ar,
39342
- RGFormat as as,
39343
- UnsignedByteType as at,
39344
- DataTexture as au,
39345
- LinearMipMapLinearFilter as av,
39346
- Triangle as aw,
39347
- CanvasTexture as ax,
39348
- WebGLRenderer as ay,
39349
- WebGLRenderTarget as az,
39428
+ CompressedCubeTexture as ar,
39429
+ CompressedArrayTexture as as,
39430
+ CompressedTexture as at,
39431
+ NoColorSpace as au,
39432
+ RGBA_PVRTC_2BPPV1_Format as av,
39433
+ RGBA_PVRTC_4BPPV1_Format as aw,
39434
+ RGBA_BPTC_Format as ax,
39435
+ RED_GREEN_RGTC2_Format as ay,
39436
+ SIGNED_RED_GREEN_RGTC2_Format as az,
39350
39437
  Mesh as b,
39351
- RED_RGTC1_Format as b0,
39352
- SIGNED_RED_RGTC1_Format as b1,
39353
- RGBA_S3TC_DXT5_Format as b2,
39354
- RGB_S3TC_DXT1_Format as b3,
39355
- RGBA_S3TC_DXT1_Format as b4,
39356
- RGBA_ASTC_6x6_Format as b5,
39357
- RGBA_ASTC_4x4_Format as b6,
39358
- SIGNED_RG11_EAC_Format as b7,
39359
- RG11_EAC_Format as b8,
39360
- SIGNED_R11_EAC_Format as b9,
39361
- RGBAIntegerFormat as bA,
39362
- WebGLArrayRenderTarget as bB,
39363
- GLSL3 as bC,
39364
- Timer as bD,
39365
- WebGLCubeRenderTarget as bE,
39366
- CubeCamera as bF,
39367
- Camera as bG,
39368
- PMREMGenerator as bH,
39369
- InstancedBufferGeometry as bI,
39370
- RawShaderMaterial as bJ,
39371
- R11_EAC_Format as ba,
39372
- RGB_ETC2_Format as bb,
39373
- RGBA_ETC2_EAC_Format as bc,
39374
- RGBFormat as bd,
39375
- RedFormat as be,
39376
- UnsignedInt101111Type as bf,
39377
- UnsignedInt5999Type as bg,
39378
- UnsignedShortType as bh,
39379
- Data3DTexture as bi,
39380
- RGB_PVRTC_4BPPV1_Format as bj,
39381
- RGB_ETC1_Format as bk,
39382
- RGB_BPTC_UNSIGNED_Format as bl,
39438
+ Float32BufferAttribute as b0,
39439
+ LinearMipMapLinearFilter as b1,
39440
+ Triangle as b2,
39441
+ CanvasTexture as b3,
39442
+ WebGLRenderer as b4,
39443
+ WebGLRenderTarget as b5,
39444
+ OneFactor as b6,
39445
+ ZeroFactor as b7,
39446
+ CustomBlending as b8,
39447
+ Box2 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
+ Matrix2 as ba,
39461
+ Vector4 as bb,
39462
+ DataTextureLoader as bc,
39463
+ DataUtils as bd,
39464
+ REVISION as be,
39465
+ TextureSource as bf,
39466
+ ImageUtils as bg,
39467
+ Scene as bh,
39468
+ ecefToGeodeticPosition as bi,
39469
+ getEnuBasis as bj,
39470
+ BackSide as bk,
39471
+ BoxGeometry as bl,
39383
39472
  normalizeLayerOffset as bm,
39384
39473
  geodeticOffsetToEcefDelta as bn,
39385
39474
  validateGeodeticPosition as bo,
39386
39475
  validateTuple as bp,
39387
39476
  validateScale as bq,
39388
39477
  geodeticToEcefPosition as br,
39389
- AgXToneMapping as bs,
39390
- EquirectangularReflectionMapping as bt,
39391
- validateRotation as bu,
39392
- requireFiniteNumber as bv,
39393
- computeElevation as bw,
39394
- DataArrayTexture as bx,
39395
- RGIntegerFormat as by,
39396
- UnsignedIntType as bz,
39478
+ enuToEcefDelta as bs,
39479
+ RingGeometry as bt,
39480
+ AgXToneMapping as bu,
39481
+ EquirectangularReflectionMapping as bv,
39482
+ validateRotation 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,