jme.locale.external.feature
Class SkyDome

java.lang.Object
  extended byjme.locale.external.feature.SkyDome
All Implemented Interfaces:
Sky

public class SkyDome
extends java.lang.Object
implements Sky

SkyDome defines an implementation of the sky interface where the sky is represented as a dome. The dome or half sphere is rendered over the camera and gives a smooth look and allow for transitions of the texture and color. This will allow for day/night effects and other natural phenomenon. For more information see this PDF file.

Version:
$Id: SkyDome.java,v 1.3 2003/09/03 16:20:51 mojomonkey Exp $
Author:
Mark Powell

Constructor Summary
SkyDome(float radius, float dLon, float dLat, float hTile, float vTile)
          Constructor instantiates a new SkyDome object.
 
Method Summary
 float getSize()
          getSize returns the size of the sky dome, which is represented by the diameter of the dome.
 void render()
          render draws the dome around the camera and applies the texture.
 void setDomeRotation(float rotationSpeed)
          setDomeRotation sets the speed at which the dome rotates around the camera.
 void setTexture(java.lang.String filename)
          setTexture assignes the texture that makes up the sky dome.
 void setTextureSpeed(float xSpeed, float ySpeed)
          setTextureSpeed sets the animation speed of the dome texture.
 void update(float time)
          update calculates the new position of the dome and the texture based on the speeds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SkyDome

public SkyDome(float radius,
               float dLon,
               float dLat,
               float hTile,
               float vTile)
Constructor instantiates a new SkyDome object. All attributes are stored and the dome is generated.

Parameters:
radius - the radius of the sphere.
dLon - the spacing between longitude lines in degrees.
dLat - the spacing between latitude lines in degrees.
hTile -
vTile -
Throws:
MonkeyGLException - if the OpenGL context is not created before creation.
Method Detail

setTexture

public void setTexture(java.lang.String filename)
setTexture assignes the texture that makes up the sky dome.

Parameters:
filename - the image file that represents the sky dome texture.

getSize

public float getSize()
getSize returns the size of the sky dome, which is represented by the diameter of the dome.

Specified by:
getSize in interface Sky
Returns:
the radius of the dome.

setTextureSpeed

public void setTextureSpeed(float xSpeed,
                            float ySpeed)
setTextureSpeed sets the animation speed of the dome texture.

Parameters:
xSpeed - the speed along the x axis.
ySpeed - the speed along the y axis.

setDomeRotation

public void setDomeRotation(float rotationSpeed)
setDomeRotation sets the speed at which the dome rotates around the camera.

Parameters:
rotationSpeed - the speed at which the dome rotates.

update

public void update(float time)
update calculates the new position of the dome and the texture based on the speeds.

Specified by:
update in interface Sky
Parameters:
time - the time value for frame independant timing.

render

public void render()
render draws the dome around the camera and applies the texture.

Specified by:
render in interface Sky