particle fixes

This commit is contained in:
ZappoMan 2015-10-04 15:23:17 -07:00
parent 2720e6ddf4
commit 6f86b0f550
2 changed files with 6 additions and 6 deletions

View file

@ -11,7 +11,7 @@
gravity: { x: 0, y: 0, z: 0 }, gravity: { x: 0, y: 0, z: 0 },
visible: true, visible: true,
locked: false, locked: false,
lifetime: 6000 }); lifetime: 6000});
var self = this; var self = this;
this.timer = Script.setInterval(function () { this.timer = Script.setInterval(function () {
var colorProp = { color: { red: Math.random() * 255, var colorProp = { color: { red: Math.random() * 255,
@ -36,7 +36,8 @@
isEmitting: true, isEmitting: true,
position: spawnPoint, position: spawnPoint,
dimensions: {x: 2, y: 2, z: 2}, dimensions: {x: 2, y: 2, z: 2},
emitSpeed: 5, emitSpeed: 0.05,
maxParticles: 2,
speedSpread: 2, speedSpread: 2,
polarFinish: 30 * DEG_TO_RAD, polarFinish: 30 * DEG_TO_RAD,
emitAcceleration: {x: 0, y: -9.8, z: 0}, emitAcceleration: {x: 0, y: -9.8, z: 0},
@ -52,8 +53,8 @@
this.timer = Script.setInterval(function () { this.timer = Script.setInterval(function () {
// flip is playing state // flip is playing state
self.isPlaying = !self.isPlaying; self.isPlaying = !self.isPlaying;
var animProp = { animationIsPlaying: self.isPlaying }; var emittingProp = { isEmitting: self.isPlaying };
Entities.editEntity(self.entity, animProp); Entities.editEntity(self.entity, emittingProp);
}, (1 / blinkRate) * 1000); }, (1 / blinkRate) * 1000);
} }

View file

@ -403,8 +403,7 @@ void ParticleEffectEntityItem::appendSubclassData(OctreePacketData* packetData,
bool ParticleEffectEntityItem::isEmittingParticles() const { bool ParticleEffectEntityItem::isEmittingParticles() const {
// keep emitting if there are particles still alive. // keep emitting if there are particles still alive.
//return (getAnimationIsPlaying() || getLivingParticleCount() > 0) && getAnimationFPS() != 0.0f; return (getIsEmitting() || getLivingParticleCount() > 0);
return (getLivingParticleCount() > 0);
} }
bool ParticleEffectEntityItem::needsToCallUpdate() const { bool ParticleEffectEntityItem::needsToCallUpdate() const {