@splnlss/3d-story-viewer 0.8.1 → 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-DaqGSC4W.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");
@@ -39358,16 +39445,18 @@ export {
39358
39445
  ZeroFactor as b7,
39359
39446
  CustomBlending as b8,
39360
39447
  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,
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,
39371
39460
  Matrix2 as ba,
39372
39461
  Vector4 as bb,
39373
39462
  DataTextureLoader as bc,
@@ -39386,14 +39475,14 @@ export {
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,