Aviatrix3D
2.1.0

org.j3d.renderer.aviatrix3d.geom.particle
Class QuadParticleSystem

java.lang.Object
  extended by org.j3d.geom.particle.ParticleSystem
      extended by org.j3d.renderer.aviatrix3d.geom.particle.AVParticleSystem
          extended by org.j3d.renderer.aviatrix3d.geom.particle.QuadParticleSystem
All Implemented Interfaces:
NodeUpdateListener, org.j3d.geom.particle.ParticleFactory

public class QuadParticleSystem
extends AVParticleSystem

A ParticleSystem implementation that uses quads for representing each particle.

Particles are defined in the following coordinate order:

  <- width*2 ->
  3 --------- 2    / \
   |          |     |
   |          |     |
   |     +    |   height*2
   |          |     |
   |          |     |
  4 --------- 1    \ /

 
Quad 1: 1,2,3,4

Individual quads are not screen aligned.

Version:
$Revision: 2.0 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.renderer.aviatrix3d.geom.particle.AVParticleSystem
colors, normals, particleGeometry, sendNewArrays, texCoords, vertices
 
Fields inherited from class org.j3d.geom.particle.ParticleSystem
errorReporter, frameTime, genTexCoords, maxParticleCount, particleCount, particleList, texCoordInterp, timeNow
 
Constructor Summary
QuadParticleSystem(java.lang.String name, int particleCount, int numColors)
          Create a new particle system using the given particle count, initialiser and environment settings.
 
Method Summary
 int coordinatesPerParticle()
          Request the number of coordinates each particle will use.
 org.j3d.geom.particle.Particle createParticle()
          Create a new particle instance.
 PolygonAttributes getRecommendedPolygonAttributes()
          Get the attributes that the particle system implementation would prefer to have.
 TextureAttributes getRecommendedTextureAttributes()
          Get the attributes that the particle system implementation would prefer to have.
 int numColorComponents()
          Request the number of color components this particle uses.
 int numTexCoordComponents()
          Request the number of texture coordinate components this particle uses.
 void onRemove()
          Notification that this particle system has been removed from the scene graph and it cleanup anything needed right now.
 void setParticleSize(float width, float height)
          Set the size that particles should take in each dimension.
 void updateNodeBoundsChanges(java.lang.Object src)
          Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.
 void updateNodeDataChanges(java.lang.Object src)
          Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.
 
Methods inherited from class org.j3d.renderer.aviatrix3d.geom.particle.AVParticleSystem
getNode, initializeArrays, setMaxParticleCount, updateGeometry
 
Methods inherited from class org.j3d.geom.particle.ParticleSystem
addParticleFunction, enableParticleCreation, enableTextureCoordinates, getMaxParticleCount, getParticleInitializer, getSystemName, initialize, insertParticleFunction, isParticleCreationEnabled, isTextureCoordinateEnabled, removeParticleFunction, setErrorReporter, setParticleInitializer, setSystemName, setTexCoordFunction, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuadParticleSystem

public QuadParticleSystem(java.lang.String name,
                          int particleCount,
                          int numColors)
Create a new particle system using the given particle count, initialiser and environment settings. Width and height default to 0.02m.

Parameters:
name - A name to register with this system. May be null.
particleCount - The maximum number of particles to create
numColors - The number of colour components to accept: 0, 3 or 4.
Method Detail

coordinatesPerParticle

public final int coordinatesPerParticle()
Request the number of coordinates each particle will use. Used so that the manager can allocate the correct length array.

Returns:
The number of coordinates this particle uses

numColorComponents

public final int numColorComponents()
Request the number of color components this particle uses. Should be a value of 4 or 3 to indicate use or not of alpha channel.

Returns:
The number of color components in use

numTexCoordComponents

public final int numTexCoordComponents()
Request the number of texture coordinate components this particle uses. Should be a value of 2 or 3 to indicate use or not of 2D or 3D textures.

Returns:
The number of color components in use

createParticle

public org.j3d.geom.particle.Particle createParticle()
Create a new particle instance.

Returns:
The new instance created

onRemove

public void onRemove()
Notification that this particle system has been removed from the scene graph and it cleanup anything needed right now. Does nothing.

Specified by:
onRemove in class org.j3d.geom.particle.ParticleSystem

updateNodeBoundsChanges

public void updateNodeBoundsChanges(java.lang.Object src)
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.

Parameters:
src - The node or Node Component that is to be updated.

updateNodeDataChanges

public void updateNodeDataChanges(java.lang.Object src)
Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.

Parameters:
src - The node or Node Component that is to be updated.

getRecommendedTextureAttributes

public TextureAttributes getRecommendedTextureAttributes()
Get the attributes that the particle system implementation would prefer to have. It is not required that the application use these, but it is recommended.


getRecommendedPolygonAttributes

public PolygonAttributes getRecommendedPolygonAttributes()
Get the attributes that the particle system implementation would prefer to have. It is not required that the application use these, but it is recommended.


setParticleSize

public void setParticleSize(float width,
                            float height)
Set the size that particles should take in each dimension. This will only effect particles created after this call.

Parameters:
width - The width of the particle in meters
height - The height of the particle in meters

Aviatrix3D
2.1.0

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2009 j3d.org