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.E3DTexturedRenderable
              extended byespresso3d.engine.world.sector.base.E3DPortalEnabledTexturedRenderableItem
                  extended byespresso3d.engine.world.sector.particle.E3DSprite
                      extended byespresso3d.engine.world.sector.particle.E3DBillboardSprite
All Implemented Interfaces:
E3DCollisionDetectableObject
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. TODO: Alpha blending & masking is currently not supported, but will be. Collision detection for particles is based on its bounding quad.

Constructor Summary
E3DBillboardSprite(E3DEngine engine, E3DVector3F position, double size, int glTextureID)
           
E3DBillboardSprite(E3DEngine engine, E3DVector3F position, E3DVector3F forward, E3DVector3F up, double size, int glTextureID)
           
 
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)
 void update(E3DActor lookAtActor)
          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, translate
 
Methods inherited from class espresso3d.engine.world.sector.base.E3DPortalEnabledTexturedRenderableItem
checkSectorChangeDuringMovement, getSector, setSector
 
Methods inherited from class espresso3d.engine.renderer.base.E3DTexturedRenderable
getGlTextureID, getTextureName, setGlTextureID, setTextureName
 
Methods inherited from class espresso3d.engine.renderer.base.E3DRenderable
render
 
Methods inherited from class espresso3d.engine.base.E3DEngineItem
getEngine, setEngine
 
Methods inherited from class java.lang.Object
equals, 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,
                          int glTextureID)

E3DBillboardSprite

public E3DBillboardSprite(E3DEngine engine,
                          E3DVector3F position,
                          double size,
                          int glTextureID)
Method Detail

update

public void update(E3DActor lookAtActor)
Calling this makes the billboarding sprite face lookAtActor

Parameters:
lookAtActor - The actor the billboard will turn to face

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