Skip to content

Commit

Permalink
fix: changed mousemove listener
Browse files Browse the repository at this point in the history
  • Loading branch information
hongfaqiu committed Oct 20, 2021
1 parent 40281db commit e88d553
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cesium-particle",
"version": "0.5.5",
"version": "0.5.6",
"description": "cesium particle system module",
"main": "src/index.js",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions src/modules/generateData.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export default class Vortex {
}

generateDimensionData(num, start, step) {
if (start < 0) {
// ensure the longitude is in [0, 360]
start = 360 + start;
}
start *= 100;
step *= 100;
let arr = [], i = 0;
Expand Down
28 changes: 16 additions & 12 deletions src/modules/particle3D.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,38 @@ export default class Particle3D {
var resized = false;

this.moveStartFun = function () {
that.scene.primitives.show = false;
if (that.primitives) {
that.primitives.forEach(primitive => {
primitive.show = false;
})
}
}

this.moveEndFun = function () {
that.updateViewerParameters();
that.particleSystem.applyViewerParameters(that.viewerParameters);
that.scene.primitives.show = true;
if (that.primitives) {
that.primitives.forEach(primitive => {
primitive.show = true;
})
}
}

this.resizeFun = function () {
resized = true;
that.scene.primitives.show = false;
that.scene.primitives.removeAll();
that.remove();
}

this.preRenderFun = function () {
if (resized) {
that.particleSystem.canvasResize(that.scene.context);
resized = false;
that.addPrimitives();
that.scene.primitives.show = true;
if (that.primitives) {
that.primitives.forEach(primitive => {
primitive.show = true;
})
}
}
}

Expand Down Expand Up @@ -91,13 +102,6 @@ export default class Particle3D {
for (let primitive of this.primitives) {
this.scene.primitives.add(primitive);
}
/* this.scene.primitives.add(this.particleSystem.particlesComputing.primitives.calculateSpeed);
this.scene.primitives.add(this.particleSystem.particlesComputing.primitives.updatePosition);
this.scene.primitives.add(this.particleSystem.particlesComputing.primitives.postProcessingPosition);
this.scene.primitives.add(this.particleSystem.particlesRendering.primitives.segments);
this.scene.primitives.add(this.particleSystem.particlesRendering.primitives.trails);
this.scene.primitives.add(this.particleSystem.particlesRendering.primitives.screen); */
}

updateViewerParameters() {
Expand Down

0 comments on commit e88d553

Please sign in to comment.