espresso3d.engine.world.sector.particle
Class E3DBillboardSprite

java.lang.Object
  extended byespresso3d.engine.base.E3DEngineItem
      extended byespresso3d.engine.renderer.base.E3DRenderable
          extended byespresso3d.engine.renderer.base.E3DBlendedRenderable
              extended byespresso3d.engine.renderer.base.E3DBlendedAnimatedTextureRenderable
                  extended byespresso3d.engine.world.sector.base.E3DPortalEnabledBlendedAnimatedTextureRenderable
                      extended byespresso3d.engine.world.sector.particle.E3DSprite
                          extended byespresso3d.engine.world.sector.particle.E3DBillboardSprite
All Implemented Interfaces:
E3DCollisionDetectableObject, E3DPortalEnabledItem
Direct Known Subclasses:
E3DParticle

public abstract class E3DBillboardSprite
extends E3DSprite

Author:
Curt A billboarding sprite is a sprite that will stay facing a given actor no matter what position that actor is at. The sprite can be locked on axis' so it won't change along that axis if needed. Collision detection for particles is based on its bounding quad.

Field Summary
 
Fields inherited from class espresso3d.engine.renderer.base.E3DBlendedRenderable
BLENDMODE_BLEND, BLENDMODE_SOLID
 
Fields inherited from class espresso3d.engine.renderer.base.E3DRenderable
RENDERMODE_SOLID, RENDERMODE_TEXTURED, RENDERMODE_WIREFRAME
 
Constructor Summary
E3DBillboardSprite(E3DEngine engine, E3DVector3F position, double size, E3DAnimatedTextureFrame[] animationFrames, int animationLoops)
           
E3DBillboardSprite(E3DEngine engine, E3DVector3F position, double size, E3DAnimatedTextureFrame[] animationFrames, int animationLoops, int blendMode)
           
E3DBillboardSprite(E3DEngine engine, E3DVector3F position, double size, java.lang.String textureName)
           
E3DBillboardSprite(E3DEngine engine, E3DVector3F position, double size, java.lang.String textureName, int blendMode)
           
E3DBillboardSprite(E3DEngine engine, E3DVector3F position, E3DVector3F forward, E3DVector3F up, double size, E3DAnimatedTextureFrame[] animationFrames, int animationLoops)
           
E3DBillboardSprite(E3DEngine engine, E3DVector3F position, E3DVector3F forward, E3DVector3F up, double size, E3DAnimatedTextureFrame[] animationFrames, int animationLoops, int blendMode)
           
E3DBillboardSprite(E3DEngine engine, E3DVector3F position, E3DVector3F forward, E3DVector3F up, double size, java.lang.String textureName)
           
E3DBillboardSprite(E3DEngine engine, E3DVector3F position, E3DVector3F forward, E3DVector3F up, double size, java.lang.String textureName, int blendMode)
           
 
Method Summary
 boolean isLockX()
          True if the sprite is locked in the X axis (the forward vec won't move in this direction if locked)
 boolean isLockY()
          True if the sprite is locked in the Y axis (the forward vec won't move in this direction if locked)
 boolean isLockZ()
          True if the sprite is locked in the Z axis (the forward vec won't move in this direction if locked)
abstract  void onCollisionActor(E3DCollision collision)
          This is called when another actor collides with this object
abstract  void onCollisionSprite(E3DCollision collision)
          This is called when a sprite collides with this object
 void setLockX(boolean lockX)
          Set if the sprite should be locked on the X axis (the forward vec won't move in this direction if locked)
 void setLockY(boolean lockY)
          Set if the sprite should be locked on the Y axis (the forward vec won't move in this direction if locked)
 void setLockZ(boolean lockZ)
          Set if the sprite should be locked on the Z axis (the forward vec won't move in this direction if locked)
 boolean update(E3DActor lookAtActor, double lastFrameTimeSeconds)
          Calling this makes the billboarding sprite face lookAtActor
 
Methods inherited from class espresso3d.engine.world.sector.particle.E3DSprite
getBoundingObject, getForward, getPosition, getQuad, getSize, getTriangleList, getUniqueVertexList, getUp, renderAtPosition, rotate, scale, setPosition, setQuad, setRenderMode, translate
 
Methods inherited from class espresso3d.engine.world.sector.base.E3DPortalEnabledBlendedAnimatedTextureRenderable
checkSectorChangeDuringMovement, getSector, setSector
 
Methods inherited from class espresso3d.engine.renderer.base.E3DBlendedAnimatedTextureRenderable
getAnimatedTexture, getRenderableOptionsKey, setAnimatedTexture
 
Methods inherited from class espresso3d.engine.renderer.base.E3DBlendedRenderable
getBlendMode, initCorrectGeometryRenderer, setBlendMode
 
Methods inherited from class espresso3d.engine.renderer.base.E3DRenderable
getRenderMode, render
 
Methods inherited from class espresso3d.engine.base.E3DEngineItem
getEngine, setEngine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface espresso3d.engine.collision.base.E3DCollisionDetectableObject
getEngine, getSector, isCollideable
 

Constructor Detail

E3DBillboardSprite

public E3DBillboardSprite(E3DEngine engine,
                          E3DVector3F position,
                          E3DVector3F forward,
                          E3DVector3F up,
                          double size,
                          java.lang.String textureName)

E3DBillboardSprite

public E3DBillboardSprite(E3DEngine engine,
                          E3DVector3F position,
                          E3DVector3F forward,
                          E3DVector3F up,
                          double size,
                          E3DAnimatedTextureFrame[] animationFrames,
                          int animationLoops)

E3DBillboardSprite

public E3DBillboardSprite(E3DEngine engine,
                          E3DVector3F position,
                          E3DVector3F forward,
                          E3DVector3F up,
                          double size,
                          java.lang.String textureName,
                          int blendMode)

E3DBillboardSprite

public E3DBillboardSprite(E3DEngine engine,
                          E3DVector3F position,
                          E3DVector3F forward,
                          E3DVector3F up,
                          double size,
                          E3DAnimatedTextureFrame[] animationFrames,
                          int animationLoops,
                          int blendMode)

E3DBillboardSprite

public E3DBillboardSprite(E3DEngine engine,
                          E3DVector3F position,
                          double size,
                          java.lang.String textureName)

E3DBillboardSprite

public E3DBillboardSprite(E3DEngine engine,
                          E3DVector3F position,
                          double size,
                          E3DAnimatedTextureFrame[] animationFrames,
                          int animationLoops)

E3DBillboardSprite

public E3DBillboardSprite(E3DEngine engine,
                          E3DVector3F position,
                          double size,
                          java.lang.String textureName,
                          int blendMode)

E3DBillboardSprite

public E3DBillboardSprite(E3DEngine engine,
                          E3DVector3F position,
                          double size,
                          E3DAnimatedTextureFrame[] animationFrames,
                          int animationLoops,
                          int blendMode)
Method Detail

update

public boolean update(E3DActor lookAtActor,
                      double lastFrameTimeSeconds)
Calling this makes the billboarding sprite face lookAtActor

Overrides:
update in class E3DSprite
Parameters:
lookAtActor - The actor the billboard will turn to face
lastFrameTimeSeconds - The length of time the last frame took to render (for updating the animation if necessary)
Returns:
Returns false if the sprite should be removed from the engine lookAtActor is ignored and only used for classes that extend this

isLockX

public boolean isLockX()
True if the sprite is locked in the X axis (the forward vec won't move in this direction if locked)

Returns:

setLockX

public void setLockX(boolean lockX)
Set if the sprite should be locked on the X axis (the forward vec won't move in this direction if locked)

Parameters:
lockX -

isLockY

public boolean isLockY()
True if the sprite is locked in the Y axis (the forward vec won't move in this direction if locked)

Returns:

setLockY

public void setLockY(boolean lockY)
Set if the sprite should be locked on the Y axis (the forward vec won't move in this direction if locked)

Parameters:
lockY -

isLockZ

public boolean isLockZ()
True if the sprite is locked in the Z axis (the forward vec won't move in this direction if locked)

Returns:

setLockZ

public void setLockZ(boolean lockZ)
Set if the sprite should be locked on the Z axis (the forward vec won't move in this direction if locked)

Parameters:
lockZ -

onCollisionActor

public abstract void onCollisionActor(E3DCollision collision)
Description copied from interface: E3DCollisionDetectableObject
This is called when another actor collides with this object

Specified by:
onCollisionActor in interface E3DCollisionDetectableObject
Specified by:
onCollisionActor in class E3DSprite

onCollisionSprite

public abstract void onCollisionSprite(E3DCollision collision)
Description copied from interface: E3DCollisionDetectableObject
This is called when a sprite collides with this object

Specified by:
onCollisionSprite in interface E3DCollisionDetectableObject
Specified by:
onCollisionSprite in class E3DSprite