* Javadocs for com.jme3.effect
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7586 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
6b96a6f282
commit
58626202f0
engine/src/core/com/jme3/effect
@ -35,15 +35,60 @@ package com.jme3.effect;
|
|||||||
import com.jme3.math.ColorRGBA;
|
import com.jme3.math.ColorRGBA;
|
||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a single particle in a {@link ParticleEmitter}.
|
||||||
|
*
|
||||||
|
* @author Kirill Vainer
|
||||||
|
*/
|
||||||
public class Particle {
|
public class Particle {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Particle velocity.
|
||||||
|
*/
|
||||||
public final Vector3f velocity = new Vector3f();
|
public final Vector3f velocity = new Vector3f();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Current particle position
|
||||||
|
*/
|
||||||
public final Vector3f position = new Vector3f();
|
public final Vector3f position = new Vector3f();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Particle color
|
||||||
|
*/
|
||||||
public final ColorRGBA color = new ColorRGBA(0,0,0,0);
|
public final ColorRGBA color = new ColorRGBA(0,0,0,0);
|
||||||
public float size = 0f;
|
|
||||||
|
/**
|
||||||
|
* Particle size or radius.
|
||||||
|
*/
|
||||||
|
public float size;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Particle remaining life, in seconds.
|
||||||
|
*/
|
||||||
public float life;
|
public float life;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The initial particle life
|
||||||
|
*/
|
||||||
public float startlife;
|
public float startlife;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Particle rotation angle (in radians).
|
||||||
|
*/
|
||||||
public float angle;
|
public float angle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Particle rotation angle speed (in radians).
|
||||||
|
*/
|
||||||
public float rotateSpeed;
|
public float rotateSpeed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Particle image index.
|
||||||
|
*/
|
||||||
public int imageIndex = 0;
|
public int imageIndex = 0;
|
||||||
public float distToCam;
|
|
||||||
|
/**
|
||||||
|
* Distance to camera. Only used for sorted particles.
|
||||||
|
*/
|
||||||
|
//public float distToCam;
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ package com.jme3.effect;
|
|||||||
import com.jme3.renderer.Camera;
|
import com.jme3.renderer.Camera;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
class ParticleComparator implements Comparator<Particle> {
|
class ParticleComparator implements Comparator<Particle> {
|
||||||
|
|
||||||
private Camera cam;
|
private Camera cam;
|
||||||
@ -44,6 +45,8 @@ class ParticleComparator implements Comparator<Particle> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int compare(Particle p1, Particle p2) {
|
public int compare(Particle p1, Particle p2) {
|
||||||
|
return 0; // unused
|
||||||
|
/*
|
||||||
if (p1.life <= 0 || p2.life <= 0)
|
if (p1.life <= 0 || p2.life <= 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -69,5 +72,6 @@ class ParticleComparator implements Comparator<Particle> {
|
|||||||
return -1;
|
return -1;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load Diff
@ -32,19 +32,55 @@
|
|||||||
|
|
||||||
package com.jme3.effect;
|
package com.jme3.effect;
|
||||||
|
|
||||||
|
import com.jme3.material.RenderState;
|
||||||
import com.jme3.math.Matrix3f;
|
import com.jme3.math.Matrix3f;
|
||||||
import com.jme3.renderer.Camera;
|
import com.jme3.renderer.Camera;
|
||||||
import com.jme3.scene.Mesh;
|
import com.jme3.scene.Mesh;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The <code>ParticleMesh</code> is the underlying visual implementation of a
|
||||||
|
* {@link ParticleEmitter particle emitter}.
|
||||||
|
*
|
||||||
|
* @author Kirill Vainer
|
||||||
|
*/
|
||||||
public abstract class ParticleMesh extends Mesh {
|
public abstract class ParticleMesh extends Mesh {
|
||||||
|
|
||||||
public static enum Type {
|
/**
|
||||||
|
* Type of particle mesh
|
||||||
|
*/
|
||||||
|
public enum Type {
|
||||||
|
/**
|
||||||
|
* The particle mesh is composed of points. Each particle is a point.
|
||||||
|
* This can be used in conjuction with {@link RenderState#setPointSprite(boolean) point sprites}
|
||||||
|
* to render particles the usual way.
|
||||||
|
*/
|
||||||
Point,
|
Point,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The particle mesh is composed of triangles. Each particle is
|
||||||
|
* two triangles making a single quad.
|
||||||
|
*/
|
||||||
Triangle;
|
Triangle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize mesh data.
|
||||||
|
*
|
||||||
|
* @param emitter The emitter which will use this <code>ParticleMesh</code>.
|
||||||
|
* @param numParticles The maxmimum number of particles to simulate
|
||||||
|
*/
|
||||||
public abstract void initParticleData(ParticleEmitter emitter, int numParticles);
|
public abstract void initParticleData(ParticleEmitter emitter, int numParticles);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the images on the X and Y coordinates
|
||||||
|
* @param imagesX Images on the X coordinate
|
||||||
|
* @param imagesY Images on the Y coordinate
|
||||||
|
*/
|
||||||
public abstract void setImagesXY(int imagesX, int imagesY);
|
public abstract void setImagesXY(int imagesX, int imagesY);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the particle visual data. Typically called every frame.
|
||||||
|
*/
|
||||||
public abstract void updateParticleData(Particle[] particles, Camera cam, Matrix3f inverseRotation);
|
public abstract void updateParticleData(Particle[] particles, Camera cam, Matrix3f inverseRotation);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user