Aviatrix3D
2.1.0

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

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

public abstract class AVParticleSystem
extends org.j3d.geom.particle.ParticleSystem
implements NodeUpdateListener

Base particle system implementation for geometry implemented over Aviatrix3D scene graphs.

The node updater is registered for bounds changing events every frame. However, data changed listeners are not registered, unless per-vertex colours are being generated. If a derived class wishes to update other aspects, such as normals, texture coordinates or vertex attributes, then they will need to make their own arrangements to request the updates.

Per-vertex colours can be turned on or off by the derived class simply by changing the return value from numColorComponents() to be zero.

Version:
$Revision: 2.0 $
Author:
Justin Couch

Field Summary
protected  float[] colors
          Array containing the current color values
protected  float[] normals
          Array containing the current normals
protected  Geometry particleGeometry
          The shape containing the geometry
protected  boolean sendNewArrays
          Flag indicating we also need to force-feed new arrays to the particles because the user upped the particle count last frame.
protected  float[][] texCoords
          Array containing the current texture coordinates.
protected  float[] vertices
          Array containing the current position coordinates
 
Fields inherited from class org.j3d.geom.particle.ParticleSystem
errorReporter, frameTime, genTexCoords, maxParticleCount, particleCount, particleList, texCoordInterp, timeNow
 
Constructor Summary
AVParticleSystem(java.lang.String systemType, int particleCount)
          Create a new particle system that represents the given type.
 
Method Summary
 Geometry getNode()
          Get the scene graph object that represents this particle system and can be inserted into the scene graph.
protected  void initializeArrays()
          Set up the arrays used internally now.
 void setMaxParticleCount(int maxCount)
          Change the maximum number of particles that can be generated.
protected  void updateGeometry()
          Update the arrays for the geometry object.
 
Methods inherited from class org.j3d.geom.particle.ParticleSystem
addParticleFunction, enableParticleCreation, enableTextureCoordinates, getMaxParticleCount, getParticleInitializer, getSystemName, initialize, insertParticleFunction, isParticleCreationEnabled, isTextureCoordinateEnabled, onRemove, removeParticleFunction, setErrorReporter, setParticleInitializer, setSystemName, setTexCoordFunction, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.j3d.aviatrix3d.NodeUpdateListener
updateNodeBoundsChanges, updateNodeDataChanges
 
Methods inherited from interface org.j3d.geom.particle.ParticleFactory
coordinatesPerParticle, createParticle, numColorComponents, numTexCoordComponents
 

Field Detail

vertices

protected float[] vertices
Array containing the current position coordinates


texCoords

protected float[][] texCoords
Array containing the current texture coordinates. Single tex coord set only is initialised by default.


colors

protected float[] colors
Array containing the current color values


normals

protected float[] normals
Array containing the current normals


particleGeometry

protected Geometry particleGeometry
The shape containing the geometry


sendNewArrays

protected boolean sendNewArrays
Flag indicating we also need to force-feed new arrays to the particles because the user upped the particle count last frame.

Constructor Detail

AVParticleSystem

public AVParticleSystem(java.lang.String systemType,
                        int particleCount)
Create a new particle system that represents the given type.

Parameters:
systemType - An identifier describing the current system type
particleCount - The max nuumber of particles to create
Method Detail

updateGeometry

protected void updateGeometry()
Update the arrays for the geometry object. Calls the bounds and data change notifcation methods. Derived classes need to handle the methods defined by NodeUpdateListener.

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

getNode

public Geometry getNode()
Get the scene graph object that represents this particle system and can be inserted into the scene graph.


initializeArrays

protected void initializeArrays()
Set up the arrays used internally now. This must be called by the derived class during it's constructor.


setMaxParticleCount

public void setMaxParticleCount(int maxCount)
Change the maximum number of particles that can be generated. If the number is greater than the currently set value, it will permit more to be made according to the normal creation speed. If the number is less than the current amount, then no new particles will be created until the current total has died down below the new maximum value.

Overrides:
setMaxParticleCount in class org.j3d.geom.particle.ParticleSystem
Parameters:
maxCount - The new maximum particle count to use
Throws:
java.lang.IllegalArgumentException - The particle count was negative

Aviatrix3D
2.1.0

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