feud.testgame.view
Class Particle

java.lang.Object
  extended bycom.threed.jpct.Object3D
      extended byfeud.testgame.view.Particle
All Implemented Interfaces:
java.io.Serializable

public class Particle
extends com.threed.jpct.Object3D

A particle is a client only object for doing special effects like impacts, trails...

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.threed.jpct.Object3D
BILLBOARDING_DISABLED, BILLBOARDING_ENABLED, BLENDING_DISABLED, BLENDING_ENABLED, BUMPMAPPING_DISABLED, BUMPMAPPING_ENABLED, COLLISION_CHECK_NONE, COLLISION_CHECK_OTHERS, COLLISION_CHECK_SELF, COLLISION_DETECTION_NOT_OPTIMIZED, COLLISION_DETECTION_OPTIMIZED, COLLISION_NONE, CULLING_DISABLED, CULLING_ENABLED, ELLIPSOID_ALIGNED, ELLIPSOID_TRANSFORMED, ENVMAP_CAMERASPACE, ENVMAP_DISABLED, ENVMAP_ENABLED, ENVMAP_WORLDSPACE, ENVMAP_XY, ENVMAP_XZ, ENVMAP_YZ, FILTERING_DISABLED, FILTERING_ENABLED, FINALIZE_DEFAULT, FINALIZE_PRESORTX, FINALIZE_PRESORTY, FINALIZE_PRESORTZ, LIGHTING_ALL_ENABLED, LIGHTING_NO_LIGHTS, MOUSE_SELECTABLE, MOUSE_UNSELECTABLE, NO_OBJECT, OBJ_INVISIBLE, OBJ_VISIBLE, RAY_MISSES_BOX, SECTOR_AUTODETECT, SECTOR_PRECALCULATED, SHADING_FAKED_FLAT, SHADING_GOURAUD, SPECULAR_DISABLED, SPECULAR_ENABLED, TRANSPARENCY_MODE_ADD, TRANSPARENCY_MODE_DEFAULT, UNKNOWN_OBJECTSIZE
 
Constructor Summary
Particle()
          Creates a new particle.
 
Method Summary
 boolean isOld()
          Determines is the particle is "old".
 void move(long ticks)
          Move the particle according to it's velocity and such.
 void reset()
          Resets the particle.
 void setLifeTime(long time)
          Sets the time in ms this particle should live.
 void setTexture(java.lang.String texture)
          Sets the texture.
 void setVelocity(com.threed.jpct.SimpleVector vel)
          Sets the velocity for the particle.
 void setYLimit(float limit)
          Sets the y-limit, i.e. how deep the particle may fall before being discarded.
 
Methods inherited from class com.threed.jpct.Object3D
addChild, addCollisionListener, addParent, addTriangle, addTriangle, addTriangle, addTriangle, addTriangle, addTriangle, align, align, animate, animate, build, calcBoundingBox, calcCenter, calcMinDistance, calcMinDistance, calcNormals, calcTextureWrap, calcTextureWrapSpherical, checkForCollision, checkForCollisionEllipsoid, checkForCollisionSpherical, clearAdditionalColor, clearAnimation, clearObject, cloneObject, createDummyObj, createTriangleStrips, createTriangleStrips, decoupleMesh, disableCollisionListeners, disableLazyTransformations, disableVertexSharing, ellipsoidIntersectsAABB, enableCollisionListeners, enableLazyTransformations, getAdditionalColor, getAnimationSequence, getCenter, getCollisionListeners, getEllipsoidMode, getEnvmapMode, getID, getLighting, getMesh, getName, getNextID, getOcTree, getOrigin, getOriginMatrix, getParents, getPolygonManager, getRotationMatrix, getRotationPivot, getScale, getTransformedCenter, getTranslation, getTranslationMatrix, getUserObject, getVisibility, getWorldTransformation, getXAxis, getYAxis, getZAxis, hasChild, hasParent, invert, isBumpmapped, isEnvmapped, isSelectable, mergeObjects, rayIntersectsAABB, rayIntersectsAABB, rebuild, recreateTextureCoords, removeChild, removeCollisionListener, removeMultiTexturing, removeParent, reorderSectors, resetCollisionStatus, resetNextID, rotateAxis, rotateMesh, rotateX, rotateY, rotateZ, scale, setAdditionalColor, setAllTextures, setAllTextures, setAnimationSequence, setAsMultiSectored, setBaseTexture, setBillboarding, setBlending, setBoundingBox, setBumpmapped, setBumpmapTexture, setCenter, setCollisionMode, setCollisionOptimization, setCulling, setEllipsoidMode, setEnvmapDirection, setEnvmapMode, setEnvmapped, setFiltering, setLighting, setMesh, setName, setNextID, setOcTree, setOrigin, setRotationMatrix, setRotationPivot, setScale, setSector, setSectorDetectionMode, setSelectable, setShadingMode, setSortOffset, setSpecularLighting, setTexture, setTranslationMatrix, setTransparency, setTransparencyMode, setUserObject, setVisibility, sphereIntersectsAABB, translate, translate, translateMesh, wasTargetOfLastCollision, wasVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Particle

public Particle()
Creates a new particle. The texture will be "particle" and to exists in the TextureManager.

Method Detail

setTexture

public void setTexture(java.lang.String texture)
Sets the texture. This overrides setTexture in Object3D to keep an internal reference to the texture's name.

Parameters:
texture - String the texture's name like the TextureManager knows it.

setLifeTime

public void setLifeTime(long time)
Sets the time in ms this particle should live.

Parameters:
time - long the time

setYLimit

public void setYLimit(float limit)
Sets the y-limit, i.e. how deep the particle may fall before being discarded.

Parameters:
limit - float the y-limit

setVelocity

public void setVelocity(com.threed.jpct.SimpleVector vel)
Sets the velocity for the particle.

Parameters:
vel - SimpleVector

reset

public void reset()
Resets the particle.


isOld

public boolean isOld()
Determines is the particle is "old". This has nothing to do with the life time. The time after that a particle is considered to be old is hard-wired to 20 sec. here.

Returns:
boolean is it old?

move

public void move(long ticks)
Move the particle according to it's velocity and such. If it exceed its life time or its y-limit, the particle will be set to invisible.

Parameters:
ticks - long the number of ticks passed since the last call