|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--yaarq.sys.yrqVisual
|
+--yaarq.sys.yrqParticleVisual
This class provides support for particle systems. It encapsules a pool of particles implemented as one geometry and appearance, with the individual particles being manually updated to save on state changes in the rendering pipeline.
A particle visual is initialised with a number of particles. This number denotes the maximum number of particles existing in the visual. If at particle creation the visual runs out of particles, it simply reuses the oldest particles. Applications using the class have to take care always to reserve enough space in a particle visual.
Particle visuals share a texture for all their particles. However, they do not share an alpha value, this value is done per-vertex for individual particles. So, applications can manipulate texturing attribute for all particles at once, while still changing individual particle properties.
Particle creation, modification and removal is done by a particlemanager class. Every particle visual automatically gets a particle mangager assigned. Set the desired particle system properties to the particle manager to cause the visual to produce the wanted effect. Do not modify the particles individually. A particle visual is always added to the root frame internally. To allow for particles to be generated at a position synchronized with a yrqFrame instance, the setSourceFrame method is provided.
TODO: Nothing
| Field Summary |
| Fields inherited from class yaarq.sys.yrqVisual |
COLOR_AMBIENT, COLOR_DIFFUSE, COLOR_EMISSIVE, COLOR_SPECULAR, m_parent, MODE_ADD, MODE_BLEND, MODE_NONE, TEXTURE_DOT3BUMP, TEXTURE_LIGHTMAP, TEXTURE_MATERIAL, TEXTURE_REFLECT |
| Constructor Summary | |
yrqParticleVisual(javax.media.j3d.Texture2D a_texture,
yrqFrame a_source,
int a_size,
int a_mode)
... |
|
| Method Summary | |
void |
addParticle(javax.vecmath.Point3d a_coord,
javax.vecmath.Vector3d a_heading,
double a_alpha,
double a_size)
This method adds a particle. |
yrqParticleManager |
getManager()
... |
yrqParticle |
getParticle(int a_idx)
This function returns a given particle. |
int |
getSize()
... |
yrqFrame |
getSourceFrame()
This method sets the source frame for the visual. |
javax.media.j3d.Texture2D |
getTexture()
This function returns the texture used by all particles |
int |
getTransparencyMode()
Returns the transparency mode of the visual. |
void |
removeParticle(yrqParticle a_particle)
This function removes a given particle. |
void |
setSourceFrame(yrqFrame a_frame)
This method sets the source frame for the visual. |
void |
setTexture(javax.media.j3d.Texture2D a_texture)
This method sets the texture to use for all particles |
void |
setTransparencyMode(int a_mode)
Sets the transparency mode for the visual. |
void |
update(yrqEngine a_engine)
This method updates the particle set by calling a geometry update for the geometry keeping the particles internally. |
void |
updateData(javax.media.j3d.Geometry a_geo)
This method implements the geometryupdater interface to allow for the class to update the particle geometry used. |
| Methods inherited from class yaarq.sys.yrqVisual |
attach, detach, getBaseShape3D, getBumpShape3D, getGeometry, getParent, getTexture, getTransparencyValue, setBrightness, setColor, setGeometry, setShininess, setTexture, setTextureAnimation, setTextureAnimation, setTransparency |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public yrqParticleVisual(javax.media.j3d.Texture2D a_texture,
yrqFrame a_source,
int a_size,
int a_mode)
a_texture - The texture to use for all particles in this seta_source - The source frame at which to create new particlesa_size - The maximum number of particles in this seta_mode - The blending mode for particles in this set, one of the MODE_xxx constants| Method Detail |
public void addParticle(javax.vecmath.Point3d a_coord,
javax.vecmath.Vector3d a_heading,
double a_alpha,
double a_size)
a_coord - The coordinates at which the new particle should appeara_heading - The direction into which the new particle should flya_alpha - The initial alpha value of the new particlea_size - The initial size of the new particlepublic yrqParticleManager getManager()
public yrqParticle getParticle(int a_idx)
a_idx - The index of the desired particle
public int getSize()
public yrqFrame getSourceFrame()
public javax.media.j3d.Texture2D getTexture()
public int getTransparencyMode()
getTransparencyMode in class yrqVisualpublic void removeParticle(yrqParticle a_particle)
a_particle - The particle to be removedpublic void setSourceFrame(yrqFrame a_frame)
a_frame - The frame which is the source for particle creationpublic void setTexture(javax.media.j3d.Texture2D a_texture)
a_texture - The texture to use for the overlaypublic void setTransparencyMode(int a_mode)
a_mode - Transparency mode for this visualpublic void update(yrqEngine a_engine)
public void updateData(javax.media.j3d.Geometry a_geo)
updateData in interface javax.media.j3d.GeometryUpdatera_geo - The geometry to update, as passed by J3D according to the call to updateGeometry
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||