In my old engine I made explosions using an animated, billboarded and blended Quad, where I would move through a texture contaning different steps of the animation.
Does Jme engine have something like it?
ps I know that particle system does explosions too but I want to use both
No, it has all but the animated texture built in, but for that you’d only need to write a control of some type to update the TextureState with a preloaded Texture.
Actually I just need to change texture coordinates
I do something like this in a controller:
final Vector2f[] textures = mesh.getTextures();
final Vector3f[] vertices = mesh.getVertices();
for ( int i = 0; i < textures.length; i++ )
{
Vector2f texture = textures[i];
Vector3f vertice = vertices[i];
texture.x = vertice.x / 80; //your x-formula here
texture.y = vertice.y / 80; //your y-formula here
}
mesh.updateTextureBuffer();
(Hope this is the appropriate way :) )