|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjme.locale.external.feature.SkyBox
SkyBox
defines a implementation of the sky interface
where the sky is defined by a cube with a texture on each of
the six faces. The cube is centered at the position of the player. The
depth buffer for the skybox is turn off so it will always appear behind
any object/locale rendered. The skybox moves with the connected entity.
Field Summary | |
static int |
BACK
Defines the index to the back texture of the skybox |
static int |
BOTTOM
Defines the index to the bottom texture of the skybox |
static int |
FRONT
Defines the index to the front texture of the skybox |
static int |
LEFT
Defines the index to the left texture of the skybox |
static int |
RIGHT
Defines the index to the right texture of the skybox |
static int |
TOP
Defines the index to the top texture of the skybox |
Constructor Summary | |
SkyBox(float size)
Constructor creates a new SkyBox object. |
Method Summary | |
float |
getSize()
getSize returns the size of the sky box. |
void |
render()
render displays the skybox to the viewport. |
void |
setColor(Vector color)
setColor sets the color tint of the skybox. |
void |
setTexture(int side,
java.lang.String filename)
setTexture sets a specified side texture to
a given image texture. |
void |
setTextures(java.lang.String[] textures)
setTextures takes an array of image file names. |
void |
update(float time)
update does nothing, as the skybox is a static display. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TOP
public static final int BOTTOM
public static final int LEFT
public static final int RIGHT
public static final int FRONT
public static final int BACK
Constructor Detail |
public SkyBox(float size)
SkyBox
object. The size of
the box is given by the size parameter where the box is centered
at (size/2, size/2, size/2).
size
- the size of each side of the box.Method Detail |
public void setTexture(int side, java.lang.String filename)
setTexture
sets a specified side texture to
a given image texture. The image will be loaded as a
texture and assigned to the proper side.
side
- what side to set teh texture to.filename
- the image file to use as the texture.
MonkeyRuntimeException
- if the side is invalid.public void setTextures(java.lang.String[] textures)
setTextures
takes an array of image file names. Each
texture is then loaded from the file and set as the corresponding
side's texture.
textures
- array of texture file names.
MonkeyRuntimeException
- if the textures array is null or
not of size 6.public float getSize()
getSize
returns the size of the sky box.
getSize
in interface Sky
public void setColor(Vector color)
setColor
sets the color tint of the skybox.
color
- the tint of the box.public void update(float time)
update
does nothing, as the skybox is a static display.
update
in interface Sky
time
- the time value for frame independant timing.public void render()
render
displays the skybox to the viewport. Each
side is rendered as a triangle fan with it's normal facing
inward.
render
in interface Sky
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |