@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.
@@ -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
- Float32BufferAttribute as b0,
39352
- LinearMipMapLinearFilter as b1,
39353
- Triangle as b2,
39354
- CanvasTexture as b3,
39355
- WebGLRenderer as b4,
39356
- WebGLRenderTarget as b5,
39357
- OneFactor as b6,
39358
- ZeroFactor as b7,
39359
- CustomBlending as b8,
39360
- Box2 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
- Matrix2 as ba,
39372
- Vector4 as bb,
39373
- DataTextureLoader as bc,
39374
- DataUtils as bd,
39375
- REVISION as be,
39376
- TextureSource as bf,
39377
- ImageUtils as bg,
39378
- Scene as bh,
39379
- ecefToGeodeticPosition as bi,
39380
- getEnuBasis as bj,
39381
- BackSide as bk,
39382
- BoxGeometry as bl,
39383
- normalizeLayerOffset as bm,
39384
- geodeticOffsetToEcefDelta as bn,
39385
- validateGeodeticPosition as bo,
39386
- validateTuple as bp,
39387
- validateScale as bq,
39388
- 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,
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,