i'm totally confused. this code creates a simple explosion:
protected AbstractEntity initEffect() {
AbstractEntity l_entity = createEffect();
l_entity.getLocalTranslation().set(getOwner().getWorldCenter());
if (m_mesh == null) {
ParticleType l_type = Utils.findEnum(ParticleType.values(), m_props.getProperty("spell.particletype"));
m_mesh = l_type.create(this);
}
l_entity.attachChild(m_mesh.get0());
l_entity.attachChild(m_emitter);
m_emitter.setLocalTranslation(m_mesh.get0().getLocalTranslation());
l_entity.afterCreation();
updateEffectBounds(l_entity);
return l_entity;
}
protected AbstractEntity createEffect() {
return new AbstractEntity(getEngine());
}
protected final Geometry m_emitter = new Sphere("Particle emitter", 6, 6, 1.5F);
//protected final Geometry m_emitter = new Box("Particle emitter", new Vector3f(), 10.0F, 10.0F, 10.0F);
{
m_emitter.setCullMode(CULL_NEVER);
m_emitter.setIsCollidable(false);
}
consider abstractentity as being a node, there's no difference in this case. everything seems fine until i added a collision check. when rendering the bounds, i see the bounds of one invisible sphere flying straight up. it is m_emitter ( i can see the sphere or box when i turn culling off).
i wouldn't care about all this if this sphere didn't mess up the bounds of my abstractentity - it tries to surround the explosion itself and the additional moving node. why is it moving?
if i don't add the particle mesh to my abstract entity, the emitter sphere or box stays where it is meant to be.