Class OGLParticleSystem
java.lang.Object
org.web3d.vrml.renderer.common.nodes.AbstractNode
org.web3d.vrml.renderer.common.nodes.particle.BaseParticleSystem
org.web3d.vrml.renderer.ogl.nodes.particle.OGLParticleSystem
- All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener
,VRMLNode
,FrameStateListener
,VRMLBoundedNodeType
,VRMLChildNodeType
,VRMLNodeType
,VRMLParticleSystemNodeType
,VRMLShapeNodeType
,VRMLWorldRootChildNodeType
,OGLVRMLNode
public class OGLParticleSystem
extends BaseParticleSystem
implements OGLVRMLNode, org.j3d.aviatrix3d.NodeUpdateListener
OpenGL implementation of a ParticleSystem.
- Version:
- $Revision: 1.6 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.renderer.common.nodes.particle.BaseParticleSystem
APPEARANCE_NODE_MSG, APPEARANCE_PROTO_MSG, COLOR_NODE_MSG, COLOR_PROTO_MSG, colorFunction, emitter, EMITTER_NODE_MSG, EMITTER_PROTO_MSG, FIELD_APPEARANCE, FIELD_BBOX_CENTER, FIELD_BBOX_DISPLAY, FIELD_BBOX_SIZE, FIELD_COLOR_KEY, FIELD_COLOR_RAMP, FIELD_CREATE_PARTICLES, FIELD_EMITTER, FIELD_ENABLED, FIELD_GEOMETRY, FIELD_GEOMETRY_TYPE, FIELD_IS_ACTIVE, FIELD_LIFETIME_VARIATION, FIELD_MAX_PARTICLES, FIELD_PARTICLE_LIFETIME, FIELD_PARTICLE_SIZE, FIELD_PHYSICS, FIELD_TEXCOORD_KEY, FIELD_TEXCOORD_RAMP, FIELD_VISIBLE, geometryType, LAST_PARTICLE_INDEX, NUM_FIELDS, numColorKey, numTexCoordKey, pAppearance, particleSystem, pColorRamp, pEmitter, PHYSICS_NODE_MSG, PHYSICS_PROTO_MSG, pTexCoordRamp, TEXCOORD_NODE_MSG, TEXCOORD_PROTO_MSG, timeFunction, TYPE_CUSTOM, TYPE_LINES, TYPE_POINTS, TYPE_QUADS, TYPE_SPRITES, TYPE_TRIS, vfAppearance, vfBboxCenter, vfBboxDisplay, vfBboxSize, vfColorKey, vfColorRamp, vfCreateParticles, vfEmitter, vfEnabled, vfGeometryType, vfIsActive, vfLifetimeVariation, vfMaxParticles, vfParticleLifetime, vfParticleSize, vfPhysics, vfTexCoordKey, vfTexCoordRamp, vfVisible
Fields inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
errorReporter, FIELD_METADATA, fieldLocalData, hasChanged, inSetup, isDEF, isStatic, LAST_NODE_INDEX, layerIds, nodeName, pMetadata, refCounts, removedLayerIds, stateManager, STATIC_SCENE_GRAPH, vfMetadata, vrmlMajorVersion, vrmlMinorVersion
-
Constructor Summary
ConstructorsConstructorDescriptionInitialise the time dependent node and it's fields that are held locally.Construct a new instance of this node based on the details from the given node. -
Method Summary
Modifier and TypeMethodDescriptionorg.j3d.aviatrix3d.SceneGraphObject
Get the OpenGL scene graph object representation of this node.void
setAppearance
(VRMLNodeType newAppearance) Set node content as replacement forappearance
.protected void
setParticleSize
(float[] value) Set the size of the particle to a new value.void
Notification that the construction phase of this node has finished.void
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.void
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.web3d.vrml.renderer.common.nodes.particle.BaseParticleSystem
getAppearance, getBboxCenter, getBboxDisplay, getBboxSize, getEnabled, getFieldDeclaration, getFieldIndex, getFieldValue, getGeometry, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getSystem, getVisible, isActive, isShared, sendRoute, setActive, setBboxCenter, setBboxDisplay, setBboxSize, setEnabled, setGeometry, setShared, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVisible
Methods inherited from class org.web3d.vrml.renderer.common.nodes.AbstractNode
addNodeListener, allEventsComplete, checkNodeType, checkSecondaryType, checkSecondaryType, clearRemovedLayerIds, fireFieldChanged, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, getUserData, getVRMLNodeName, hasFieldChanged, isDEF, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, setDEF, setErrorReporter, setFrameStateManager, setMetadataObject, setUserData, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setVersion, throwInitOnlyWriteException, throwInputOnlyWriteException, throwInvalidNodeException, throwInvalidProtoException, throwOutputOnlyWriteException, updateRefCount, updateRefs
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsComplete
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, clearRemovedLayerIds, getFieldValue, getLayerIds, getMetadataObject, getRefCount, getRemovedLayerIds, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
-
Constructor Details
-
OGLParticleSystem
public OGLParticleSystem()Initialise the time dependent node and it's fields that are held locally. -
OGLParticleSystem
Construct a new instance of this node based on the details from the given node. If the node is not the same type, an exception will be thrown.- Parameters:
node
- The node to copy- Throws:
IllegalArgumentException
- The node is not the same type
-
-
Method Details
-
updateNodeBoundsChanges
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.- Specified by:
updateNodeBoundsChanges
in interfaceorg.j3d.aviatrix3d.NodeUpdateListener
- Parameters:
src
- The node or Node Component that is to be updated.
-
updateNodeDataChanges
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.- Specified by:
updateNodeDataChanges
in interfaceorg.j3d.aviatrix3d.NodeUpdateListener
- Parameters:
src
- The node or Node Component that is to be updated.
-
getSceneGraphObject
public org.j3d.aviatrix3d.SceneGraphObject getSceneGraphObject()Get the OpenGL scene graph object representation of this node. This will need to be cast to the appropriate parent type when being used. Default implementation returns null.- Specified by:
getSceneGraphObject
in interfaceOGLVRMLNode
- Returns:
- The OpenGL representation.
-
setupFinished
public void setupFinished()Notification that the construction phase of this node has finished. If the node would like to do any internal processing, such as setting up geometry, then go for it now.- Specified by:
setupFinished
in interfaceVRMLNodeType
- Overrides:
setupFinished
in classBaseParticleSystem
-
setAppearance
Set node content as replacement forappearance
.- Specified by:
setAppearance
in interfaceVRMLShapeNodeType
- Overrides:
setAppearance
in classBaseParticleSystem
- Parameters:
newAppearance
- The new appearance. null will act like delete- Throws:
InvalidFieldValueException
- The node does not match the required type.
-
setParticleSize
Set the size of the particle to a new value. This should be overridden by renderer-specific classes for telling the particle system about it.- Overrides:
setParticleSize
in classBaseParticleSystem
- Parameters:
value
- The new 2D size to use- Throws:
InvalidFieldValueException
- The value is negative
-