vis-core 0.15.4 → 0.15.6

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.
@@ -41312,7 +41312,7 @@ function Kl(i) {
41312
41312
  const t = new _t();
41313
41313
  return t.color.setScalar(i), t;
41314
41314
  }
41315
- const sX = "0.15.4", L1 = !1;
41315
+ const sX = "0.15.6", L1 = !1;
41316
41316
  class ya {
41317
41317
  constructor(t, e = {}) {
41318
41318
  A(this, "container");
@@ -41988,6 +41988,38 @@ class aX extends We {
41988
41988
  dispose(e = !0) {
41989
41989
  super.dispose(e), this.areaArr.length = 0, this.lineArr && (this.lineArr.length = 0), this.extrudelineArr && (this.extrudelineArr.length = 0);
41990
41990
  }
41991
+ // test(material: THREE.Material) {
41992
+ // material.onBeforeCompile = (shader) => {
41993
+ // shader.vertexShader = `
41994
+ // varying float vHeightPercent;
41995
+ // ${shader.vertexShader}
41996
+ // `.replace(
41997
+ // `#include <fog_vertex>`,
41998
+ // `
41999
+ // #include <fog_vertex>
42000
+ // vec4 zzz =vec4( transformed, 1.0 );
42001
+ // //min
42002
+ // float min = 1.0;
42003
+ // float max = 2.0;
42004
+ // float heightPercent = (zzz.z - min) / (max - min);
42005
+ // vHeightPercent = heightPercent;
42006
+ // `
42007
+ // );
42008
+ // shader.fragmentShader = `
42009
+ // varying float vHeightPercent;
42010
+ // ${shader.fragmentShader}
42011
+ // `.replace(
42012
+ // `#include <dithering_fragment>`,
42013
+ // `
42014
+ // #include <dithering_fragment>
42015
+ // vec3 valleyColor = vec3(0.0, 0.0, 1.0);
42016
+ // vec3 peakColor = vec3(1.0, 0.0, 0.0);
42017
+ // vec3 interpolatedColor = mix(valleyColor, peakColor, vHeightPercent);
42018
+ // gl_FragColor.rgb = interpolatedColor;
42019
+ // `
42020
+ // );
42021
+ // };
42022
+ // }
41991
42023
  }
41992
42024
  class oX extends We {
41993
42025
  constructor(e) {
@@ -44760,6 +44792,22 @@ const rT = Je(zt({}, ds), {
44760
44792
  });
44761
44793
  });
44762
44794
  }
44795
+ checkBehindEarth(e, n) {
44796
+ const s = new N(0, 0, 0), l = new N(0, 0, 0), a = this.options.radius, o = () => {
44797
+ const c = e();
44798
+ if (!c.length) return;
44799
+ this.pencil.cameraControls.getPosition(l, !1);
44800
+ const d = s.clone().sub(l), h = Math.sqrt(
44801
+ Math.pow(d.length(), 2) - Math.pow(a, 2)
44802
+ ), r = [], u = [];
44803
+ c.forEach((m) => {
44804
+ m.position.clone().sub(l).length() > h ? r.push(m) : u.push(m);
44805
+ }), n(r, u);
44806
+ };
44807
+ o(), this.pencil.cameraControls.addEventListener("update", () => {
44808
+ o();
44809
+ });
44810
+ }
44763
44811
  };
44764
44812
  A(mo, "VisName", "earth");
44765
44813
  let Qo = mo;
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "0.15.4";
1
+ declare const _default: "0.15.6";
2
2
  export default _default;
@@ -3,6 +3,7 @@ import * as THREE from 'three';
3
3
  import { Draw as DrawController } from 'gl-draw/dist/plugins';
4
4
  import { MeshLineMaterial } from 'gl-draw/dist/objects';
5
5
  import Countries from './objects/countries';
6
+ import { BaseObject } from 'gl-draw';
6
7
  interface EarthOptions {
7
8
  assetsPrefix?: string;
8
9
  mapDepth?: number;
@@ -57,5 +58,6 @@ export default class extends Base {
57
58
  area: ConstructorParameters<typeof THREE.MeshBasicMaterial>[0];
58
59
  line: ConstructorParameters<typeof MeshLineMaterial>[0];
59
60
  }): Promise<Countries | undefined>;
61
+ checkBehindEarth(objArr: () => BaseObject[], cb: (behind: BaseObject[], front: BaseObject[]) => any): void;
60
62
  }
61
63
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vis-core",
3
- "version": "0.15.4",
3
+ "version": "0.15.6",
4
4
  "scripts": {
5
5
  "start": "npm run version && PORT=5173 bundler-dev",
6
6
  "build:site": "npm run version &&PUBLIC_EXCLUDE=public/city bundler",