-
Notifications
You must be signed in to change notification settings - Fork 118
Open
Description
The sparkles on the keys in this pic get stuck after emitter.remove() is called:
The following is executed when the page loads:
this.sparkleParticles = new SPE.Group({
texture: {
value: this.textureLoader.load('./media/sparkle.png')
},
blending : THREE.AdditiveBlending,
maxParticleCount:10000
});
this.scene.add(this.sparkleParticles.mesh);
And the following when a key is pressed:
// Spawn particles
const sparkles = new SPE.Emitter({
maxAge: {
value: 0.3
},
rotation : {
//angleSpread : 0.3,
//axisSpread : Math.PI*2
},
opacity : {
value : [1]
},
position: {
value: new THREE.Vector3(raycastObj.point.x, raycastObj.point.y, raycastObj.point.z+0.1),
spread: new THREE.Vector3( 0.1, 0.1, 0 ),
randomise : true,
radius : 1
},
acceleration: {
value: new THREE.Vector3(0, 0, -0.1),
spread: new THREE.Vector3( 0, 0, 0 ),
randomise : true,
},
velocity: {
value: new THREE.Vector3(1, 1, 1),
spread: new THREE.Vector3(2, 2, 0),
randomise : true,
distribution: SPE.distributions.SPHERE,
},
angle : {
spread : Math.PI*2,
randomise : true,
},
color: {
value: [ new THREE.Color(1.0,1.0,0.0), new THREE.Color(0xFFFFFF) ]
},
size: {
value: [0.3,0.1]
},
particleCount: 100
});
this.sparkleParticles.addEmitter(sparkles);
setTimeout(() => {
sparkles.remove();
}, 1000);
setTimeout(() => {
sparkles.disable();
}, 100);
console.log(this.sparkleParticles.emitters);
For now I can make a pool of emitters when the page loads and use those. But being able to add and remove emitters ad-hoc would be neat!
Metadata
Metadata
Assignees
Labels
No labels
