I have posted another thread, but this time im posting again with a video, hope this will clarify the problem.
I have a particle system, which is the following method,
public void throwFireball()
pe_fire = new ParticleEmitter(“Emitter”, Type.Triangle, 100);
Material mat_red = new Material(assetManager, “Common/MatDefs/Misc/Particle.j3md”);
pe_fire.setImagesX(2); pe_fire.setImagesY(2); // 2x2 texture animation
pe_fire.setEndColor( new ColorRGBA(1f, 0f, 0f, 1f)); // red
pe_fire.setStartColor(new ColorRGBA(1f, 1f, 0f, 0.5f)); // yellow
pe_fire.setInitialVelocity(new Vector3f(0, 7, 0));
SphereCollisionShape cs_fire = new SphereCollisionShape(3);
pn_fire = new PhysicsNode(pe_fire, cs_fire, 1);
which is triggered by
fireTime = 0;
this code is in the simpleUpdate
This code is called after every 10 sec, and a ‘fireball physicsNode’(pn_fire) is thrown towards the player with a particle emitter(pe_fire) attached.
- Before diving into the issue, i wanna point out another thing, is that, even before calling explosion.emitAllParticles(), whenever i attach it(emitter) to the root node, is automatically emits.The fire particle example in the doc does this thing.What if i dont want it to happen?
The problem, I will only see the incoming fireball when the particle emitter is in my view frustum.
Two weird thing
- Why the particle emitter is at 0,0,0 position.(Yes, in the video, that is Vector3f.ZERO)When I havnt specified any location is the code about it.
- Why I need to have the particle emitter in the view frustum to see the flying fireball_physicsNode.
In the video, you will see, the emitter appears at the same time, when the fireball appears. The fireball doesn’t appear when the emitter is out of my view(when I walk forward a little).When i walk back and bring the particle emitter again in the view frustum, i see the fireball again. It is like, optimizing, the scene, I cannt see the fireball when the particle emitter is out of my view, because, the actual position of the particle emitter is at 0,0,0