espresso3d.engine.world.sky
Class E3DSkyObject

java.lang.Object
  extended byespresso3d.engine.base.E3DEngineItem
      extended byespresso3d.engine.renderer.base.E3DRenderable
          extended byespresso3d.engine.world.sky.E3DSkyObject
Direct Known Subclasses:
E3DSkyBox

public abstract class E3DSkyObject
extends E3DRenderable

Author:
Curt The base class for SkyObjects in the world. A sky object always stays centered around a viewports camera actor as it moves. This gives the appearance that the sky object is far away (like far away mountains or sky) and simulates parallax as the camera moves (tricks the eye). Extending this class allows creation of your own sky objects. The engine currently implements an E3DSkyBox object.

Constructor Summary
E3DSkyObject(E3DEngine engine)
           
 
Method Summary
 E3DVector3F getPosition()
          Get the position the skyobject is currently at
 double getScale()
          Get the current scale of the sky object
 E3DWorld getWorld()
          Get the world the skyobject is in
abstract  void scale(double scaleAmt)
          Scale the object geometry by scaleAmt.
abstract  void setPosition(E3DVector3F position)
          Set the position of the sky object and its geometry.
 void setScale(double scaleAmt)
          Set the scale to a given scaleAmt.
 void setWorld(E3DWorld world)
          Set the world the skyobject is in.
abstract  void translate(E3DVector3F translationAmt)
          Translate the position and geometry by translationAmt
 void update(E3DVector3F position, double scale)
          Called whenever the position of the camera moves or the viewport size changes.
 
Methods inherited from class espresso3d.engine.renderer.base.E3DRenderable
getBlendMode, getKey, getRenderMode, initCorrectGeometryRenderer, isKeyChanged, render, setBlendMode, setKeyChanged, setRenderMode
 
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
 

Constructor Detail

E3DSkyObject

public E3DSkyObject(E3DEngine engine)
Method Detail

setPosition

public abstract void setPosition(E3DVector3F position)
Set the position of the sky object and its geometry.

Parameters:
position -

translate

public abstract void translate(E3DVector3F translationAmt)
Translate the position and geometry by translationAmt

Parameters:
translationAmt -

scale

public abstract void scale(double scaleAmt)
Scale the object geometry by scaleAmt. This should scale the current by this (so the current scale WOULD be multiplied by this scale)

Parameters:
scaleAmt -

getWorld

public E3DWorld getWorld()
Get the world the skyobject is in

Returns:

setWorld

public void setWorld(E3DWorld world)
Set the world the skyobject is in. This will be handled automatically when the skyobject is added to a world

Parameters:
world -

update

public void update(E3DVector3F position,
                   double scale)
Called whenever the position of the camera moves or the viewport size changes. A sky object should always center itself around the position and set its size to just under the far clipping plane.

Parameters:
position -
scale -

getPosition

public E3DVector3F getPosition()
Get the position the skyobject is currently at

Returns:

setScale

public void setScale(double scaleAmt)
Set the scale to a given scaleAmt. This reduces the scale of the object to 1 before applying this (it doesn't multiply the current scale by this scale)

Parameters:
scaleAmt -

getScale

public double getScale()
Get the current scale of the sky object

Returns: