|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.terrain.Landscape
public abstract class Landscape
Representation of a piece of rendered terrain data.
The landscape is used to control what it rendered on screen as the user moves about the virtual environment. This instance does not need to maintain all the polygons on the screen at any one time, but may control them as needed.
This object is independent of the culling algorithm. It represents something
that can be placed in a scenegraph and have view information passed to it
without the need to know the specific algorithm in use. To implement a
specific algorithm (eg ROAM) you would extend this class and implement the
setView(Tuple3f, Vector3f)
method. Every time that the scene
changes, you will be notified by this method. That means you should perform
any culling/LOD and update the scene graph at this point. This will be
called at most once per frame.
If you are going to use this class with the navigation code, then you should also make the internal geometry not pickable, and make this item pickable. In this way, the navigation code will find this top-level terrain definition and use it directly to make the code much faster. None of these capabilities are set within this implementation, so it is up to the third-party code to make it so via calls to the appropriate methods.
The landscape provides an appearance generator for letting the end user application control appearance settings. If this is not set then particular implementation is free to do what it likes.
Internationalisation Resource Names
Field Summary | |
---|---|
protected ViewFrustum |
landscapeView
The current viewing frustum that is seeing the landscape |
protected TerrainData |
terrainData
Raw terrain information to be rendered |
Constructor Summary | |
---|---|
Landscape(ViewFrustum view,
TerrainData data)
Create a new Landscape with the set view and data. |
Method Summary | |
---|---|
float |
getHeight(float x,
float z)
Get the height at the given X,Z coordinate in the local coordinate system. |
abstract void |
initialize(javax.vecmath.Tuple3f position,
javax.vecmath.Vector3f direction)
Initialise the landscape ready for viewing. |
abstract void |
setView(javax.vecmath.Tuple3f position,
javax.vecmath.Vector3f direction)
Set the current viewing direction for the user. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ViewFrustum landscapeView
protected TerrainData terrainData
Constructor Detail |
---|
public Landscape(ViewFrustum view, TerrainData data)
view
- The viewing frustum to see the data withdata
- The raw data to view
java.lang.IllegalArgumentException
- either parameter is nullMethod Detail |
---|
public float getHeight(float x, float z)
getHeight
in interface HeightDataSource
x
- The x coordinate for the height samplingz
- The z coordinate for the height sampling
public abstract void initialize(javax.vecmath.Tuple3f position, javax.vecmath.Vector3f direction)
position
- The position the user is in the virtual worlddirection
- The orientation of the user's gazepublic abstract void setView(javax.vecmath.Tuple3f position, javax.vecmath.Vector3f direction)
position
- The position the user is in the virtual worlddirection
- The orientation of the user's gaze
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |