|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--yaarq.sys.yrqTerrain
The terrain class encapsules a textured terrain geometry placed in the center of the x-z plane. It provides utility functions and objects for applying lightmaps to the terrain and supports heightmap for fast determination of terrain height at a given location and for intersection calculations. An instance of this class can be set to the engine to enable terrain support. If no class instance is set to the engine, terrain support is disabled and the engine ignores updating of the terrain.
TODO: Implement height map
| Constructor Summary | |
yrqTerrain(yrqEngine a_engine)
Constructs an instance of the terrain class. |
|
| Method Summary | |
void |
addShader(java.lang.String a_name,
yrqShader a_shader)
This method adds a shader to the terrain shading system. |
javax.media.j3d.BoundingBox |
getBounds()
This function returns the current bounds of the terrain geometry. |
yrqShader |
getShader(java.lang.String a_name)
This method retrieves one of the shaders by its name. |
void |
removeShader(java.lang.String a_name)
This method removes one of the shaders by its name. |
void |
removeShader(yrqShader a_shader)
This method removes one of the shaders by its reference. |
void |
setGeometry(javax.media.j3d.Geometry a_geometry)
This method sets the geometry to be used for the terrain. |
void |
setHeightmap(javax.media.j3d.Texture2D a_texture)
This method sets the heightmap to use for determination of altitude and colission with the terrain. |
void |
setTexture(javax.media.j3d.Texture2D a_texture)
This method sets the texture to use for the terrain. |
void |
update()
This function is called by the engine before rendering a frame to update the shademap used for terrain shading. |
void |
updateData(javax.media.j3d.ImageComponent2D a_component,
int a_x,
int a_y,
int a_width,
int a_height)
This implementation of the ImageUpdater interface renders the shademap |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public yrqTerrain(yrqEngine a_engine)
a_engine - The engine instance| Method Detail |
public void addShader(java.lang.String a_name,
yrqShader a_shader)
Shaders are no scenegraph objects, the can be added, removed and changed at any time after terrain instantiation.
a_name - The name of the shader to adda_shader - The shader to addpublic javax.media.j3d.BoundingBox getBounds()
public yrqShader getShader(java.lang.String a_name)
Shaders are no scenegraph objects, the can be added, removed and changed at any time after terrain instantiation.
a_name - The name of the shader to addpublic void removeShader(java.lang.String a_name)
Shaders are no scenegraph objects, the can be added, removed and changed at any time after terrain instantiation.
a_name - The name of the shader to removepublic void removeShader(yrqShader a_shader)
Shaders are no scenegraph objects, the can be added, removed and changed at any time after terrain instantiation.
public void setGeometry(javax.media.j3d.Geometry a_geometry)
a_geometry - The geometry for the terrainpublic void setHeightmap(javax.media.j3d.Texture2D a_texture)
a_texture - The texture to use as a heightmappublic void setTexture(javax.media.j3d.Texture2D a_texture)
public void update()
public void updateData(javax.media.j3d.ImageComponent2D a_component,
int a_x,
int a_y,
int a_width,
int a_height)
updateData in interface javax.media.j3d.ImageComponent2D.Updatera_component - The imagecomponent to updatea_x - The area to updatea_y - The area to updatea_width - The area to updatea_height - The area to update
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||