@vesium/special 1.0.1-beta.27 → 1.0.1-beta.54

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,83 +0,0 @@
1
- var VesiumSpecial=function(d,t){"use strict";var v=Object.defineProperty,I=(e,a,c)=>a in e?v(e,a,{enumerable:!0,configurable:!0,writable:!0,value:c}):e[a]=c,n=(e,a,c)=>I(e,typeof a!="symbol"?a+"":a,c);function h(e){return typeof e=="function"}function i(e,a){return e===a||h(e?.equals)&&e.equals(a)||h(a?.equals)&&a.equals(e)}function l(e){return!t.defined(e)||!!e.isConstant}function W(e){return t.Material._materialCache.getMaterial(e)}function g(e,a){return t.Material._materialCache.addMaterial(e,a)}function S(e){return e&&h(e.getValue)}function o(e,a){return S(e)?e.getValue(a):e}function q(e,a=!1){return S(e)?e:h(e)?new t.CallbackProperty(e,a):new t.ConstantProperty(e)}function s(e,a,c,r){let p;const _=u=>{var y;p?.(),t.defined(u?.definitionChanged)&&(p=(y=u?.definitionChanged)==null?void 0:y.addEventListener(()=>{e.definitionChanged.raiseEvent(e,a,u,u)}))},f=`_${a}`,T=q(c);e[f]=T,_(T),Object.defineProperty(e,a,{get(){return e[f]},set(u){const y=e[f];e[f]!==u&&(e[f]=u,_(u),t.defined(e.definitionChanged)&&e.definitionChanged.raiseEvent(e,a,u,y))}})}const E=`uniform vec4 color;
2
- uniform float speed;
3
-
4
- #define PI 3.14159265359
5
-
6
- czm_material czm_getMaterial(czm_materialInput materialInput) {
7
- czm_material material = czm_getDefaultMaterial(materialInput);
8
- vec2 st = materialInput.st;
9
-
10
- float dis = distance(st, vec2(0.5, 0.5));
11
-
12
- vec2 scrPt = st * 2.0 - 1.0;
13
- float time = czm_frameNumber * speed / 1000.0;
14
- mat2 rot;
15
- float theta = -time * 1.0 * PI - 2.2;
16
- float cosTheta, sinTheta;
17
- cosTheta = cos(theta);
18
- sinTheta = sin(theta);
19
- rot[0][0] = cosTheta;
20
- rot[0][1] = -sinTheta;
21
- rot[1][0] = sinTheta;
22
- rot[1][1] = cosTheta;
23
- vec2 scrPtRot = rot * scrPt;
24
- float angle = 1.0 - (atan(scrPtRot.y, scrPtRot.x) / 6.2831 + 0.5);
25
- float falloff = length(scrPtRot);
26
- material.alpha = pow(angle, 2.0) * falloff;
27
- material.diffuse = color.rgb;
28
-
29
- if(dis > 0.47) {
30
- float perDis = 0.5 / 1.0;
31
- float disNum;
32
- float bl = .0;
33
- for(int i = 0; i <= 9; i++) {
34
- if(float(i) <= 1.0) {
35
- disNum = perDis * float(i) - dis;
36
- if(disNum > 0.0) {
37
- if(disNum < perDis) {
38
- bl = 1.0 - disNum / perDis;
39
- } else if(disNum - perDis < perDis) {
40
- bl = 1.0 - abs(1.0 - disNum / perDis);
41
- }
42
- float alpha = 1.0 - (0.5 - dis) / 0.03;
43
- if(material.alpha < alpha) {
44
- material.alpha = alpha;
45
- }
46
- }
47
- }
48
- }
49
- }
50
- return material;
51
- }
52
- `,m="EllipseRadarScan",b={color:t.Color.YELLOW,speed:10};g(m,{fabric:{type:m,source:E,uniforms:{...b}},translucent(e){const a=e.uniforms;return a.color.alpha<1||a.color.alpha<1}});class D{constructor(a={}){n(this,"color"),n(this,"speed"),n(this,"_definitionChanged",new t.Event),s(this,"color",a.color),s(this,"speed",a.speed)}get isConstant(){return l(this.color)&&l(this.speed)}getType(a){return m}get definitionChanged(){return this._definitionChanged}getValue(a,c){const r=b;return Object.assign(c??{},{color:o(this.color,a)??r.color,speed:o(this.speed,a)??r.speed})}equals(a){return i(this.color,a?.color)&&i(this.speed,a?.speed)}}const F=`uniform vec4 color;
53
- uniform float speed;
54
-
55
- #define PI 3.14159265359
56
-
57
-
58
-
59
-
60
- czm_material czm_getMaterial(czm_materialInput materialInput) {
61
- czm_material material = czm_getDefaultMaterial(materialInput);
62
- vec2 st = materialInput.st;
63
- vec2 scrPt = st * 2.0 - 1.0;
64
- float time = czm_frameNumber * speed / 1000.0;
65
- mat2 rot;
66
- float theta = -time * 1.0 * PI - 2.2;
67
- float cosTheta, sinTheta;
68
- cosTheta = cos(theta);
69
- sinTheta = sin(theta);
70
- rot[0][0] = cosTheta;
71
- rot[0][1] = -sinTheta;
72
- rot[1][0] = sinTheta;
73
- rot[1][1] = cosTheta;
74
- vec2 scrPtRot = rot * scrPt;
75
- float angle = 1.0 - (atan(scrPtRot.y, scrPtRot.x) / 6.2831 + 0.5);
76
- float falloff = length(scrPtRot);
77
- material.alpha = pow(angle, 2.0) * falloff;
78
- material.diffuse = color.rgb;
79
- return material;
80
- }
81
- circular
82
- `,M="RadarScan",P={color:t.Color.YELLOW,speed:10};g(M,{fabric:{type:M,source:F,uniforms:{...P}},translucent(e){const a=e.uniforms;return a.color.alpha<1||a.color.alpha<1}});class w{constructor(a={}){n(this,"color"),n(this,"speed"),n(this,"_definitionChanged",new t.Event),s(this,"color",a.color),s(this,"speed",a.speed)}get isConstant(){return l(this.color)&&l(this.speed)}getType(a){return M}get definitionChanged(){return this._definitionChanged}getValue(a,c){const r=P;return Object.assign(c??{},{color:o(this.color,a)??r.color,speed:o(this.speed,a)??r.speed})}equals(a){return i(this.color,a?.color)&&i(this.speed,a?.speed)}}const C="WaterRipple",R={baseWaterColor:new t.Color(.2,.3,.6,1),blendColor:new t.Color(0,1,.699,1),specularMap:t.Material.DefaultImageId,normalMap:t.buildModuleUrl("Assets/Textures/waterNormals.jpg"),frequency:1e4,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},z=W("Water");g(C,{fabric:{type:C,source:z.fabric.source,uniforms:{...R}},translucent(e){const a=e.uniforms;return a.baseWaterColor.alpha<1||a.blendColor.alpha<1}});class N{constructor(a={}){n(this,"baseWaterColor"),n(this,"blendColor"),n(this,"specularMap"),n(this,"normalMap"),n(this,"frequency"),n(this,"animationSpeed"),n(this,"amplitude"),n(this,"specularIntensity"),n(this,"fadeFactor"),n(this,"_definitionChanged",new t.Event),s(this,"baseWaterColor",a.baseWaterColor),s(this,"blendColor",a.blendColor),s(this,"specularMap",a.specularMap),s(this,"normalMap",a.normalMap),s(this,"frequency",a.frequency),s(this,"animationSpeed",a.animationSpeed),s(this,"amplitude",a.amplitude),s(this,"specularIntensity",a.specularIntensity),s(this,"fadeFactor",a.fadeFactor)}get isConstant(){return l(this.baseWaterColor)&&l(this.blendColor)&&l(this.specularMap)&&l(this.normalMap)&&l(this.frequency)&&l(this.animationSpeed)&&l(this.amplitude)&&l(this.specularIntensity)&&l(this.fadeFactor)}getType(a){return C}get definitionChanged(){return this._definitionChanged}getValue(a,c){const r=R;return Object.assign(c??{},{baseWaterColor:o(this.baseWaterColor,a)??r.baseWaterColor,blendColor:o(this.blendColor,a)??r.blendColor,specularMap:o(this.specularMap,a)??r.specularMap,normalMap:o(this.normalMap,a)??r.normalMap,frequency:o(this.frequency,a)??r.frequency,animationSpeed:o(this.animationSpeed,a)??r.animationSpeed,amplitude:o(this.amplitude,a)??r.amplitude,specularIntensity:o(this.specularIntensity,a)??r.specularIntensity,fadeFactor:o(this.fadeFactor,a)??r.fadeFactor})}equals(a){return i(this.baseWaterColor,a?.baseWaterColor)&&i(this.blendColor,a?.blendColor)&&i(this.specularMap,a?.specularMap)&&i(this.normalMap,a?.normalMap)&&i(this.frequency,a?.frequency)&&i(this.animationSpeed,a?.animationSpeed)&&i(this.amplitude,a?.amplitude)&&i(this.specularIntensity,a?.specularIntensity)&&i(this.fadeFactor,a?.fadeFactor)}}return d.EllipseRadarScanMaterialDefaultUniforms=b,d.EllipseRadarScanMaterialProperty=D,d.EllipseRadarScanMaterialType=m,d.RadarScanMaterialDefaultUniforms=P,d.RadarScanMaterialProperty=w,d.RadarScanMaterialType=M,d.WaterRippleMaterialDefaultUniforms=R,d.WaterRippleMaterialProperty=N,d.WaterRippleMaterialType=C,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"}),d}({},Cesium);
83
- //# sourceMappingURL=index.iife.min.js.map
@@ -1,83 +0,0 @@
1
- "use strict";var T=Object.defineProperty,v=(a,e,c)=>e in a?T(a,e,{enumerable:!0,configurable:!0,writable:!0,value:c}):a[e]=c,n=(a,e,c)=>v(a,typeof e!="symbol"?e+"":e,c);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("cesium");function m(a){return typeof a=="function"}function i(a,e){return a===e||m(a?.equals)&&a.equals(e)||m(e?.equals)&&e.equals(a)}function l(a){return!r.defined(a)||!!a.isConstant}function I(a){return r.Material._materialCache.getMaterial(a)}function y(a,e){return r.Material._materialCache.addMaterial(a,e)}function S(a){return a&&m(a.getValue)}function s(a,e){return S(a)?a.getValue(e):a}function W(a,e=!1){return S(a)?a:m(a)?new r.CallbackProperty(a,e):new r.ConstantProperty(a)}function o(a,e,c,t){let u;const R=d=>{var f;u?.(),r.defined(d?.definitionChanged)&&(u=(f=d?.definitionChanged)==null?void 0:f.addEventListener(()=>{a.definitionChanged.raiseEvent(a,e,d,d)}))},p=`_${e}`,_=W(c);a[p]=_,R(_),Object.defineProperty(a,e,{get(){return a[p]},set(d){const f=a[p];a[p]!==d&&(a[p]=d,R(d),r.defined(a.definitionChanged)&&a.definitionChanged.raiseEvent(a,e,d,f))}})}const q=`uniform vec4 color;
2
- uniform float speed;
3
-
4
- #define PI 3.14159265359
5
-
6
- czm_material czm_getMaterial(czm_materialInput materialInput) {
7
- czm_material material = czm_getDefaultMaterial(materialInput);
8
- vec2 st = materialInput.st;
9
-
10
- float dis = distance(st, vec2(0.5, 0.5));
11
-
12
- vec2 scrPt = st * 2.0 - 1.0;
13
- float time = czm_frameNumber * speed / 1000.0;
14
- mat2 rot;
15
- float theta = -time * 1.0 * PI - 2.2;
16
- float cosTheta, sinTheta;
17
- cosTheta = cos(theta);
18
- sinTheta = sin(theta);
19
- rot[0][0] = cosTheta;
20
- rot[0][1] = -sinTheta;
21
- rot[1][0] = sinTheta;
22
- rot[1][1] = cosTheta;
23
- vec2 scrPtRot = rot * scrPt;
24
- float angle = 1.0 - (atan(scrPtRot.y, scrPtRot.x) / 6.2831 + 0.5);
25
- float falloff = length(scrPtRot);
26
- material.alpha = pow(angle, 2.0) * falloff;
27
- material.diffuse = color.rgb;
28
-
29
- if(dis > 0.47) {
30
- float perDis = 0.5 / 1.0;
31
- float disNum;
32
- float bl = .0;
33
- for(int i = 0; i <= 9; i++) {
34
- if(float(i) <= 1.0) {
35
- disNum = perDis * float(i) - dis;
36
- if(disNum > 0.0) {
37
- if(disNum < perDis) {
38
- bl = 1.0 - disNum / perDis;
39
- } else if(disNum - perDis < perDis) {
40
- bl = 1.0 - abs(1.0 - disNum / perDis);
41
- }
42
- float alpha = 1.0 - (0.5 - dis) / 0.03;
43
- if(material.alpha < alpha) {
44
- material.alpha = alpha;
45
- }
46
- }
47
- }
48
- }
49
- }
50
- return material;
51
- }
52
- `,h="EllipseRadarScan",g={color:r.Color.YELLOW,speed:10};y(h,{fabric:{type:h,source:q,uniforms:{...g}},translucent(a){const e=a.uniforms;return e.color.alpha<1||e.color.alpha<1}});class E{constructor(e={}){n(this,"color"),n(this,"speed"),n(this,"_definitionChanged",new r.Event),o(this,"color",e.color),o(this,"speed",e.speed)}get isConstant(){return l(this.color)&&l(this.speed)}getType(e){return h}get definitionChanged(){return this._definitionChanged}getValue(e,c){const t=g;return Object.assign(c??{},{color:s(this.color,e)??t.color,speed:s(this.speed,e)??t.speed})}equals(e){return i(this.color,e?.color)&&i(this.speed,e?.speed)}}const D=`uniform vec4 color;
53
- uniform float speed;
54
-
55
- #define PI 3.14159265359
56
-
57
-
58
-
59
-
60
- czm_material czm_getMaterial(czm_materialInput materialInput) {
61
- czm_material material = czm_getDefaultMaterial(materialInput);
62
- vec2 st = materialInput.st;
63
- vec2 scrPt = st * 2.0 - 1.0;
64
- float time = czm_frameNumber * speed / 1000.0;
65
- mat2 rot;
66
- float theta = -time * 1.0 * PI - 2.2;
67
- float cosTheta, sinTheta;
68
- cosTheta = cos(theta);
69
- sinTheta = sin(theta);
70
- rot[0][0] = cosTheta;
71
- rot[0][1] = -sinTheta;
72
- rot[1][0] = sinTheta;
73
- rot[1][1] = cosTheta;
74
- vec2 scrPtRot = rot * scrPt;
75
- float angle = 1.0 - (atan(scrPtRot.y, scrPtRot.x) / 6.2831 + 0.5);
76
- float falloff = length(scrPtRot);
77
- material.alpha = pow(angle, 2.0) * falloff;
78
- material.diffuse = color.rgb;
79
- return material;
80
- }
81
- circular
82
- `,M="RadarScan",b={color:r.Color.YELLOW,speed:10};y(M,{fabric:{type:M,source:D,uniforms:{...b}},translucent(a){const e=a.uniforms;return e.color.alpha<1||e.color.alpha<1}});class F{constructor(e={}){n(this,"color"),n(this,"speed"),n(this,"_definitionChanged",new r.Event),o(this,"color",e.color),o(this,"speed",e.speed)}get isConstant(){return l(this.color)&&l(this.speed)}getType(e){return M}get definitionChanged(){return this._definitionChanged}getValue(e,c){const t=b;return Object.assign(c??{},{color:s(this.color,e)??t.color,speed:s(this.speed,e)??t.speed})}equals(e){return i(this.color,e?.color)&&i(this.speed,e?.speed)}}const C="WaterRipple",P={baseWaterColor:new r.Color(.2,.3,.6,1),blendColor:new r.Color(0,1,.699,1),specularMap:r.Material.DefaultImageId,normalMap:r.buildModuleUrl("Assets/Textures/waterNormals.jpg"),frequency:1e4,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},w=I("Water");y(C,{fabric:{type:C,source:w.fabric.source,uniforms:{...P}},translucent(a){const e=a.uniforms;return e.baseWaterColor.alpha<1||e.blendColor.alpha<1}});class z{constructor(e={}){n(this,"baseWaterColor"),n(this,"blendColor"),n(this,"specularMap"),n(this,"normalMap"),n(this,"frequency"),n(this,"animationSpeed"),n(this,"amplitude"),n(this,"specularIntensity"),n(this,"fadeFactor"),n(this,"_definitionChanged",new r.Event),o(this,"baseWaterColor",e.baseWaterColor),o(this,"blendColor",e.blendColor),o(this,"specularMap",e.specularMap),o(this,"normalMap",e.normalMap),o(this,"frequency",e.frequency),o(this,"animationSpeed",e.animationSpeed),o(this,"amplitude",e.amplitude),o(this,"specularIntensity",e.specularIntensity),o(this,"fadeFactor",e.fadeFactor)}get isConstant(){return l(this.baseWaterColor)&&l(this.blendColor)&&l(this.specularMap)&&l(this.normalMap)&&l(this.frequency)&&l(this.animationSpeed)&&l(this.amplitude)&&l(this.specularIntensity)&&l(this.fadeFactor)}getType(e){return C}get definitionChanged(){return this._definitionChanged}getValue(e,c){const t=P;return Object.assign(c??{},{baseWaterColor:s(this.baseWaterColor,e)??t.baseWaterColor,blendColor:s(this.blendColor,e)??t.blendColor,specularMap:s(this.specularMap,e)??t.specularMap,normalMap:s(this.normalMap,e)??t.normalMap,frequency:s(this.frequency,e)??t.frequency,animationSpeed:s(this.animationSpeed,e)??t.animationSpeed,amplitude:s(this.amplitude,e)??t.amplitude,specularIntensity:s(this.specularIntensity,e)??t.specularIntensity,fadeFactor:s(this.fadeFactor,e)??t.fadeFactor})}equals(e){return i(this.baseWaterColor,e?.baseWaterColor)&&i(this.blendColor,e?.blendColor)&&i(this.specularMap,e?.specularMap)&&i(this.normalMap,e?.normalMap)&&i(this.frequency,e?.frequency)&&i(this.animationSpeed,e?.animationSpeed)&&i(this.amplitude,e?.amplitude)&&i(this.specularIntensity,e?.specularIntensity)&&i(this.fadeFactor,e?.fadeFactor)}}exports.EllipseRadarScanMaterialDefaultUniforms=g,exports.EllipseRadarScanMaterialProperty=E,exports.EllipseRadarScanMaterialType=h,exports.RadarScanMaterialDefaultUniforms=b,exports.RadarScanMaterialProperty=F,exports.RadarScanMaterialType=M,exports.WaterRippleMaterialDefaultUniforms=P,exports.WaterRippleMaterialProperty=z,exports.WaterRippleMaterialType=C;
83
- //# sourceMappingURL=index.min.cjs.map
@@ -1,83 +1 @@
1
- var W=Object.defineProperty,q=(t,e,o)=>e in t?W(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,n=(t,e,o)=>q(t,typeof e!="symbol"?e+"":e,o);import{defined as b,Material as y,CallbackProperty as F,ConstantProperty as w,Color as f,Event as M,buildModuleUrl as D}from"cesium";function m(t){return typeof t=="function"}function r(t,e){return t===e||m(t?.equals)&&t.equals(e)||m(e?.equals)&&e.equals(t)}function i(t){return!b(t)||!!t.isConstant}function z(t){return y._materialCache.getMaterial(t)}function _(t,e){return y._materialCache.addMaterial(t,e)}function S(t){return t&&m(t.getValue)}function s(t,e){return S(t)?t.getValue(e):t}function E(t,e=!1){return S(t)?t:m(t)?new F(t,e):new w(t)}function l(t,e,o,a){let u;const T=c=>{var p;u?.(),b(c?.definitionChanged)&&(u=(p=c?.definitionChanged)==null?void 0:p.addEventListener(()=>{t.definitionChanged.raiseEvent(t,e,c,c)}))},d=`_${e}`,v=E(o);t[d]=v,T(v),Object.defineProperty(t,e,{get(){return t[d]},set(c){const p=t[d];t[d]!==c&&(t[d]=c,T(c),b(t.definitionChanged)&&t.definitionChanged.raiseEvent(t,e,c,p))}})}const N=`uniform vec4 color;
2
- uniform float speed;
3
-
4
- #define PI 3.14159265359
5
-
6
- czm_material czm_getMaterial(czm_materialInput materialInput) {
7
- czm_material material = czm_getDefaultMaterial(materialInput);
8
- vec2 st = materialInput.st;
9
-
10
- float dis = distance(st, vec2(0.5, 0.5));
11
-
12
- vec2 scrPt = st * 2.0 - 1.0;
13
- float time = czm_frameNumber * speed / 1000.0;
14
- mat2 rot;
15
- float theta = -time * 1.0 * PI - 2.2;
16
- float cosTheta, sinTheta;
17
- cosTheta = cos(theta);
18
- sinTheta = sin(theta);
19
- rot[0][0] = cosTheta;
20
- rot[0][1] = -sinTheta;
21
- rot[1][0] = sinTheta;
22
- rot[1][1] = cosTheta;
23
- vec2 scrPtRot = rot * scrPt;
24
- float angle = 1.0 - (atan(scrPtRot.y, scrPtRot.x) / 6.2831 + 0.5);
25
- float falloff = length(scrPtRot);
26
- material.alpha = pow(angle, 2.0) * falloff;
27
- material.diffuse = color.rgb;
28
-
29
- if(dis > 0.47) {
30
- float perDis = 0.5 / 1.0;
31
- float disNum;
32
- float bl = .0;
33
- for(int i = 0; i <= 9; i++) {
34
- if(float(i) <= 1.0) {
35
- disNum = perDis * float(i) - dis;
36
- if(disNum > 0.0) {
37
- if(disNum < perDis) {
38
- bl = 1.0 - disNum / perDis;
39
- } else if(disNum - perDis < perDis) {
40
- bl = 1.0 - abs(1.0 - disNum / perDis);
41
- }
42
- float alpha = 1.0 - (0.5 - dis) / 0.03;
43
- if(material.alpha < alpha) {
44
- material.alpha = alpha;
45
- }
46
- }
47
- }
48
- }
49
- }
50
- return material;
51
- }
52
- `,h="EllipseRadarScan",P={color:f.YELLOW,speed:10};_(h,{fabric:{type:h,source:N,uniforms:{...P}},translucent(t){const e=t.uniforms;return e.color.alpha<1||e.color.alpha<1}});class O{constructor(e={}){n(this,"color"),n(this,"speed"),n(this,"_definitionChanged",new M),l(this,"color",e.color),l(this,"speed",e.speed)}get isConstant(){return i(this.color)&&i(this.speed)}getType(e){return h}get definitionChanged(){return this._definitionChanged}getValue(e,o){const a=P;return Object.assign(o??{},{color:s(this.color,e)??a.color,speed:s(this.speed,e)??a.speed})}equals(e){return r(this.color,e?.color)&&r(this.speed,e?.speed)}}const L=`uniform vec4 color;
53
- uniform float speed;
54
-
55
- #define PI 3.14159265359
56
-
57
-
58
-
59
-
60
- czm_material czm_getMaterial(czm_materialInput materialInput) {
61
- czm_material material = czm_getDefaultMaterial(materialInput);
62
- vec2 st = materialInput.st;
63
- vec2 scrPt = st * 2.0 - 1.0;
64
- float time = czm_frameNumber * speed / 1000.0;
65
- mat2 rot;
66
- float theta = -time * 1.0 * PI - 2.2;
67
- float cosTheta, sinTheta;
68
- cosTheta = cos(theta);
69
- sinTheta = sin(theta);
70
- rot[0][0] = cosTheta;
71
- rot[0][1] = -sinTheta;
72
- rot[1][0] = sinTheta;
73
- rot[1][1] = cosTheta;
74
- vec2 scrPtRot = rot * scrPt;
75
- float angle = 1.0 - (atan(scrPtRot.y, scrPtRot.x) / 6.2831 + 0.5);
76
- float falloff = length(scrPtRot);
77
- material.alpha = pow(angle, 2.0) * falloff;
78
- material.diffuse = color.rgb;
79
- return material;
80
- }
81
- circular
82
- `,C="RadarScan",I={color:f.YELLOW,speed:10};_(C,{fabric:{type:C,source:L,uniforms:{...I}},translucent(t){const e=t.uniforms;return e.color.alpha<1||e.color.alpha<1}});class V{constructor(e={}){n(this,"color"),n(this,"speed"),n(this,"_definitionChanged",new M),l(this,"color",e.color),l(this,"speed",e.speed)}get isConstant(){return i(this.color)&&i(this.speed)}getType(e){return C}get definitionChanged(){return this._definitionChanged}getValue(e,o){const a=I;return Object.assign(o??{},{color:s(this.color,e)??a.color,speed:s(this.speed,e)??a.speed})}equals(e){return r(this.color,e?.color)&&r(this.speed,e?.speed)}}const g="WaterRipple",R={baseWaterColor:new f(.2,.3,.6,1),blendColor:new f(0,1,.699,1),specularMap:y.DefaultImageId,normalMap:D("Assets/Textures/waterNormals.jpg"),frequency:1e4,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},j=z("Water");_(g,{fabric:{type:g,source:j.fabric.source,uniforms:{...R}},translucent(t){const e=t.uniforms;return e.baseWaterColor.alpha<1||e.blendColor.alpha<1}});class x{constructor(e={}){n(this,"baseWaterColor"),n(this,"blendColor"),n(this,"specularMap"),n(this,"normalMap"),n(this,"frequency"),n(this,"animationSpeed"),n(this,"amplitude"),n(this,"specularIntensity"),n(this,"fadeFactor"),n(this,"_definitionChanged",new M),l(this,"baseWaterColor",e.baseWaterColor),l(this,"blendColor",e.blendColor),l(this,"specularMap",e.specularMap),l(this,"normalMap",e.normalMap),l(this,"frequency",e.frequency),l(this,"animationSpeed",e.animationSpeed),l(this,"amplitude",e.amplitude),l(this,"specularIntensity",e.specularIntensity),l(this,"fadeFactor",e.fadeFactor)}get isConstant(){return i(this.baseWaterColor)&&i(this.blendColor)&&i(this.specularMap)&&i(this.normalMap)&&i(this.frequency)&&i(this.animationSpeed)&&i(this.amplitude)&&i(this.specularIntensity)&&i(this.fadeFactor)}getType(e){return g}get definitionChanged(){return this._definitionChanged}getValue(e,o){const a=R;return Object.assign(o??{},{baseWaterColor:s(this.baseWaterColor,e)??a.baseWaterColor,blendColor:s(this.blendColor,e)??a.blendColor,specularMap:s(this.specularMap,e)??a.specularMap,normalMap:s(this.normalMap,e)??a.normalMap,frequency:s(this.frequency,e)??a.frequency,animationSpeed:s(this.animationSpeed,e)??a.animationSpeed,amplitude:s(this.amplitude,e)??a.amplitude,specularIntensity:s(this.specularIntensity,e)??a.specularIntensity,fadeFactor:s(this.fadeFactor,e)??a.fadeFactor})}equals(e){return r(this.baseWaterColor,e?.baseWaterColor)&&r(this.blendColor,e?.blendColor)&&r(this.specularMap,e?.specularMap)&&r(this.normalMap,e?.normalMap)&&r(this.frequency,e?.frequency)&&r(this.animationSpeed,e?.animationSpeed)&&r(this.amplitude,e?.amplitude)&&r(this.specularIntensity,e?.specularIntensity)&&r(this.fadeFactor,e?.fadeFactor)}}export{P as EllipseRadarScanMaterialDefaultUniforms,O as EllipseRadarScanMaterialProperty,h as EllipseRadarScanMaterialType,I as RadarScanMaterialDefaultUniforms,V as RadarScanMaterialProperty,C as RadarScanMaterialType,R as WaterRippleMaterialDefaultUniforms,x as WaterRippleMaterialProperty,g as WaterRippleMaterialType};
83
- //# sourceMappingURL=index.min.mjs.map
1
+ export{};
package/dist/index.mjs CHANGED
@@ -1,248 +1 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { defined, Material, CallbackProperty, ConstantProperty, Color, Event, buildModuleUrl } from "cesium";
5
- function isFunction(val) {
6
- return typeof val === "function";
7
- }
8
- function cesiumEquals(left, right) {
9
- return left === right || isFunction(left == null ? void 0 : left.equals) && left.equals(right) || isFunction(right == null ? void 0 : right.equals) && right.equals(left);
10
- }
11
- function isCesiumConstant(value) {
12
- return !defined(value) || !!value.isConstant;
13
- }
14
- function getMaterialCache(type) {
15
- return Material._materialCache.getMaterial(type);
16
- }
17
- function addMaterialCache(type, material) {
18
- return Material._materialCache.addMaterial(type, material);
19
- }
20
- function isProperty(value) {
21
- return value && isFunction(value.getValue);
22
- }
23
- function toPropertyValue(value, time) {
24
- return isProperty(value) ? value.getValue(time) : value;
25
- }
26
- function toProperty(value, isConstant = false) {
27
- return isProperty(value) ? value : isFunction(value) ? new CallbackProperty(value, isConstant) : new ConstantProperty(value);
28
- }
29
- function createPropertyField(scope, field, maybeProperty, readonly) {
30
- let removeOwnerListener;
31
- const ownerBinding = (value) => {
32
- var _a;
33
- removeOwnerListener == null ? void 0 : removeOwnerListener();
34
- if (defined(value == null ? void 0 : value.definitionChanged)) {
35
- removeOwnerListener = (_a = value == null ? void 0 : value.definitionChanged) == null ? void 0 : _a.addEventListener(() => {
36
- scope.definitionChanged.raiseEvent(scope, field, value, value);
37
- });
38
- }
39
- };
40
- const privateField = `_${field}`;
41
- const property = toProperty(maybeProperty);
42
- scope[privateField] = property;
43
- ownerBinding(property);
44
- {
45
- Object.defineProperty(scope, field, {
46
- get() {
47
- return scope[privateField];
48
- },
49
- set(value) {
50
- const previous = scope[privateField];
51
- if (scope[privateField] !== value) {
52
- scope[privateField] = value;
53
- ownerBinding(value);
54
- if (defined(scope.definitionChanged)) {
55
- scope.definitionChanged.raiseEvent(scope, field, value, previous);
56
- }
57
- }
58
- }
59
- });
60
- }
61
- }
62
- const EllipseRadarScanMaterialSource = "uniform vec4 color;\nuniform float speed;\n\n#define PI 3.14159265359\n\nczm_material czm_getMaterial(czm_materialInput materialInput) {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n\n float dis = distance(st, vec2(0.5, 0.5));\n\n vec2 scrPt = st * 2.0 - 1.0;\n float time = czm_frameNumber * speed / 1000.0;\n mat2 rot;\n float theta = -time * 1.0 * PI - 2.2;\n float cosTheta, sinTheta;\n cosTheta = cos(theta);\n sinTheta = sin(theta);\n rot[0][0] = cosTheta;\n rot[0][1] = -sinTheta;\n rot[1][0] = sinTheta;\n rot[1][1] = cosTheta;\n vec2 scrPtRot = rot * scrPt;\n float angle = 1.0 - (atan(scrPtRot.y, scrPtRot.x) / 6.2831 + 0.5);\n float falloff = length(scrPtRot);\n material.alpha = pow(angle, 2.0) * falloff;\n material.diffuse = color.rgb;\n\n if(dis > 0.47) {\n float perDis = 0.5 / 1.0;\n float disNum;\n float bl = .0;\n for(int i = 0; i <= 9; i++) {\n if(float(i) <= 1.0) {\n disNum = perDis * float(i) - dis;\n if(disNum > 0.0) {\n if(disNum < perDis) {\n bl = 1.0 - disNum / perDis;\n } else if(disNum - perDis < perDis) {\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n float alpha = 1.0 - (0.5 - dis) / 0.03;\n if(material.alpha < alpha) {\n material.alpha = alpha;\n }\n }\n }\n }\n }\n return material;\n}\n";
63
- const EllipseRadarScanMaterialType = "EllipseRadarScan";
64
- const EllipseRadarScanMaterialDefaultUniforms = {
65
- color: Color.YELLOW,
66
- speed: 10
67
- };
68
- addMaterialCache(EllipseRadarScanMaterialType, {
69
- fabric: {
70
- type: EllipseRadarScanMaterialType,
71
- source: EllipseRadarScanMaterialSource,
72
- uniforms: { ...EllipseRadarScanMaterialDefaultUniforms }
73
- },
74
- translucent(material) {
75
- const uniforms = material.uniforms;
76
- return uniforms.color.alpha < 1 || uniforms.color.alpha < 1;
77
- }
78
- });
79
- class EllipseRadarScanMaterialProperty {
80
- constructor(options = {}) {
81
- __publicField(this, "color");
82
- __publicField(this, "speed");
83
- /**
84
- * @internal
85
- */
86
- __publicField(this, "_definitionChanged", new Event());
87
- createPropertyField(this, "color", options.color);
88
- createPropertyField(this, "speed", options.speed);
89
- }
90
- get isConstant() {
91
- return isCesiumConstant(this.color) && isCesiumConstant(this.speed);
92
- }
93
- getType(_time) {
94
- return EllipseRadarScanMaterialType;
95
- }
96
- get definitionChanged() {
97
- return this._definitionChanged;
98
- }
99
- getValue(time, result) {
100
- const uniforms = EllipseRadarScanMaterialDefaultUniforms;
101
- const data = Object.assign(result ?? {}, {
102
- color: toPropertyValue(this.color, time) ?? uniforms.color,
103
- speed: toPropertyValue(this.speed, time) ?? uniforms.speed
104
- });
105
- return data;
106
- }
107
- equals(other) {
108
- return cesiumEquals(this.color, other == null ? void 0 : other.color) && cesiumEquals(this.speed, other == null ? void 0 : other.speed);
109
- }
110
- }
111
- const RadarScanMaterialSource = "uniform vec4 color;\nuniform float speed;\n\n#define PI 3.14159265359\n\n\n\n\nczm_material czm_getMaterial(czm_materialInput materialInput) {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec2 scrPt = st * 2.0 - 1.0;\n float time = czm_frameNumber * speed / 1000.0;\n mat2 rot;\n float theta = -time * 1.0 * PI - 2.2;\n float cosTheta, sinTheta;\n cosTheta = cos(theta);\n sinTheta = sin(theta);\n rot[0][0] = cosTheta;\n rot[0][1] = -sinTheta;\n rot[1][0] = sinTheta;\n rot[1][1] = cosTheta;\n vec2 scrPtRot = rot * scrPt;\n float angle = 1.0 - (atan(scrPtRot.y, scrPtRot.x) / 6.2831 + 0.5);\n float falloff = length(scrPtRot);\n material.alpha = pow(angle, 2.0) * falloff;\n material.diffuse = color.rgb;\n return material;\n}\ncircular\n";
112
- const RadarScanMaterialType = "RadarScan";
113
- const RadarScanMaterialDefaultUniforms = {
114
- color: Color.YELLOW,
115
- speed: 10
116
- };
117
- addMaterialCache(RadarScanMaterialType, {
118
- fabric: {
119
- type: RadarScanMaterialType,
120
- source: RadarScanMaterialSource,
121
- uniforms: { ...RadarScanMaterialDefaultUniforms }
122
- },
123
- translucent(material) {
124
- const uniforms = material.uniforms;
125
- return uniforms.color.alpha < 1 || uniforms.color.alpha < 1;
126
- }
127
- });
128
- class RadarScanMaterialProperty {
129
- constructor(options = {}) {
130
- __publicField(this, "color");
131
- __publicField(this, "speed");
132
- /**
133
- * @internal
134
- */
135
- __publicField(this, "_definitionChanged", new Event());
136
- createPropertyField(this, "color", options.color);
137
- createPropertyField(this, "speed", options.speed);
138
- }
139
- get isConstant() {
140
- return isCesiumConstant(this.color) && isCesiumConstant(this.speed);
141
- }
142
- getType(_time) {
143
- return RadarScanMaterialType;
144
- }
145
- get definitionChanged() {
146
- return this._definitionChanged;
147
- }
148
- getValue(time, result) {
149
- const uniforms = RadarScanMaterialDefaultUniforms;
150
- const data = Object.assign(result ?? {}, {
151
- color: toPropertyValue(this.color, time) ?? uniforms.color,
152
- speed: toPropertyValue(this.speed, time) ?? uniforms.speed
153
- });
154
- return data;
155
- }
156
- equals(other) {
157
- return cesiumEquals(this.color, other == null ? void 0 : other.color) && cesiumEquals(this.speed, other == null ? void 0 : other.speed);
158
- }
159
- }
160
- const WaterRippleMaterialType = "WaterRipple";
161
- const WaterRippleMaterialDefaultUniforms = {
162
- baseWaterColor: new Color(0.2, 0.3, 0.6, 1),
163
- blendColor: new Color(0, 1, 0.699, 1),
164
- specularMap: Material.DefaultImageId,
165
- normalMap: buildModuleUrl("Assets/Textures/waterNormals.jpg"),
166
- frequency: 1e4,
167
- animationSpeed: 0.01,
168
- amplitude: 1,
169
- specularIntensity: 0.5,
170
- fadeFactor: 1
171
- };
172
- const WaterRippleMaterial = getMaterialCache("Water");
173
- addMaterialCache(WaterRippleMaterialType, {
174
- fabric: {
175
- type: WaterRippleMaterialType,
176
- source: WaterRippleMaterial.fabric.source,
177
- uniforms: { ...WaterRippleMaterialDefaultUniforms }
178
- },
179
- translucent(material) {
180
- const uniforms = material.uniforms;
181
- return uniforms.baseWaterColor.alpha < 1 || uniforms.blendColor.alpha < 1;
182
- }
183
- });
184
- class WaterRippleMaterialProperty {
185
- constructor(options = {}) {
186
- __publicField(this, "baseWaterColor");
187
- __publicField(this, "blendColor");
188
- __publicField(this, "specularMap");
189
- __publicField(this, "normalMap");
190
- __publicField(this, "frequency");
191
- __publicField(this, "animationSpeed");
192
- __publicField(this, "amplitude");
193
- __publicField(this, "specularIntensity");
194
- __publicField(this, "fadeFactor");
195
- /**
196
- * @internal
197
- */
198
- __publicField(this, "_definitionChanged", new Event());
199
- createPropertyField(this, "baseWaterColor", options.baseWaterColor);
200
- createPropertyField(this, "blendColor", options.blendColor);
201
- createPropertyField(this, "specularMap", options.specularMap);
202
- createPropertyField(this, "normalMap", options.normalMap);
203
- createPropertyField(this, "frequency", options.frequency);
204
- createPropertyField(this, "animationSpeed", options.animationSpeed);
205
- createPropertyField(this, "amplitude", options.amplitude);
206
- createPropertyField(this, "specularIntensity", options.specularIntensity);
207
- createPropertyField(this, "fadeFactor", options.fadeFactor);
208
- }
209
- get isConstant() {
210
- return isCesiumConstant(this.baseWaterColor) && isCesiumConstant(this.blendColor) && isCesiumConstant(this.specularMap) && isCesiumConstant(this.normalMap) && isCesiumConstant(this.frequency) && isCesiumConstant(this.animationSpeed) && isCesiumConstant(this.amplitude) && isCesiumConstant(this.specularIntensity) && isCesiumConstant(this.fadeFactor);
211
- }
212
- getType(_time) {
213
- return WaterRippleMaterialType;
214
- }
215
- get definitionChanged() {
216
- return this._definitionChanged;
217
- }
218
- getValue(time, result) {
219
- const uniforms = WaterRippleMaterialDefaultUniforms;
220
- const data = Object.assign(result ?? {}, {
221
- baseWaterColor: toPropertyValue(this.baseWaterColor, time) ?? uniforms.baseWaterColor,
222
- blendColor: toPropertyValue(this.blendColor, time) ?? uniforms.blendColor,
223
- specularMap: toPropertyValue(this.specularMap, time) ?? uniforms.specularMap,
224
- normalMap: toPropertyValue(this.normalMap, time) ?? uniforms.normalMap,
225
- frequency: toPropertyValue(this.frequency, time) ?? uniforms.frequency,
226
- animationSpeed: toPropertyValue(this.animationSpeed, time) ?? uniforms.animationSpeed,
227
- amplitude: toPropertyValue(this.amplitude, time) ?? uniforms.amplitude,
228
- specularIntensity: toPropertyValue(this.specularIntensity, time) ?? uniforms.specularIntensity,
229
- fadeFactor: toPropertyValue(this.fadeFactor, time) ?? uniforms.fadeFactor
230
- });
231
- return data;
232
- }
233
- equals(other) {
234
- return cesiumEquals(this.baseWaterColor, other == null ? void 0 : other.baseWaterColor) && cesiumEquals(this.blendColor, other == null ? void 0 : other.blendColor) && cesiumEquals(this.specularMap, other == null ? void 0 : other.specularMap) && cesiumEquals(this.normalMap, other == null ? void 0 : other.normalMap) && cesiumEquals(this.frequency, other == null ? void 0 : other.frequency) && cesiumEquals(this.animationSpeed, other == null ? void 0 : other.animationSpeed) && cesiumEquals(this.amplitude, other == null ? void 0 : other.amplitude) && cesiumEquals(this.specularIntensity, other == null ? void 0 : other.specularIntensity) && cesiumEquals(this.fadeFactor, other == null ? void 0 : other.fadeFactor);
235
- }
236
- }
237
- export {
238
- EllipseRadarScanMaterialDefaultUniforms,
239
- EllipseRadarScanMaterialProperty,
240
- EllipseRadarScanMaterialType,
241
- RadarScanMaterialDefaultUniforms,
242
- RadarScanMaterialProperty,
243
- RadarScanMaterialType,
244
- WaterRippleMaterialDefaultUniforms,
245
- WaterRippleMaterialProperty,
246
- WaterRippleMaterialType
247
- };
248
- //# sourceMappingURL=index.mjs.map
1
+ export { };
package/package.json CHANGED
@@ -1,19 +1,15 @@
1
1
  {
2
2
  "name": "@vesium/special",
3
3
  "type": "module",
4
- "version": "1.0.1-beta.27",
5
- "buildInfo": {
6
- "name": "VesiumSpecial",
7
- "bundle": true
8
- },
4
+ "version": "1.0.1-beta.54",
9
5
  "description": "Vue component and composition-api library for Cesium.",
10
6
  "license": "MIT",
11
- "homepage": "https://github.com/GeoVueJS/vesium",
7
+ "homepage": "https://github.com/vesiumjs/vesium",
12
8
  "repository": {
13
- "url": "https://github.com/GeoVueJS/vesium"
9
+ "url": "https://github.com/vesiumjs/vesium"
14
10
  },
15
11
  "bugs": {
16
- "url": "https://github.com/GeoVueJS/vesium/issues"
12
+ "url": "https://github.com/vesiumjs/vesium/issues"
17
13
  },
18
14
  "keywords": [
19
15
  "vue",
@@ -22,21 +18,22 @@
22
18
  "hooks",
23
19
  "composition-api"
24
20
  ],
25
- "main": "./dist/index.cjs",
26
- "module": "./dist/index.mjs",
21
+ "exports": {
22
+ ".": {
23
+ "import": "./dist/index.mjs",
24
+ "require": "./dist/index.cjs"
25
+ },
26
+ "./package.json": "./package.json"
27
+ },
28
+ "unpkg": "./dist/index.iife.min.js",
29
+ "jsdelivr": "./dist/index.iife.min.js",
27
30
  "files": [
28
31
  "LICENSE",
29
32
  "README.md",
30
33
  "dist/*"
31
34
  ],
32
- "publishConfig": {
33
- "jsdelivr": "./dist/index.iife.min.js"
34
- },
35
- "dependencies": {
36
- "@vueuse/shared": "^12.7.0",
37
- "cesium": "^1.126.0",
38
- "vue": "^3.5.13"
39
- },
40
- "types": "./dist/index.d.ts",
41
- "unpkg": "./dist/index.iife.min.js"
35
+ "dependencies": {},
36
+ "main": "./dist/index.cjs",
37
+ "module": "./dist/index.mjs",
38
+ "types": "./dist/index.d.mts"
42
39
  }