public abstract class Landscape extends Object implements HeightMapGeometry
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(Point3d, Vector3d) 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
| Modifier and Type | Field and Description |
|---|---|
protected org.j3d.util.frustum.ViewFrustum |
landscapeView
The current viewing frustum that is seeing the landscape
|
protected TerrainData |
terrainData
Raw terrain information to be rendered
|
| Constructor and Description |
|---|
Landscape(org.j3d.util.frustum.ViewFrustum view,
TerrainData data)
Create a new Landscape with the set view and data.
|
| Modifier and Type | Method and Description |
|---|---|
float |
getHeight(float x,
float z)
Get the height at the given X,Z coordinate in the local coordinate
system.
|
abstract void |
initialize(org.j3d.maths.vector.Point3d position,
org.j3d.maths.vector.Vector3d direction)
Initialise the landscape ready for viewing.
|
abstract void |
setView(org.j3d.maths.vector.Point3d position,
org.j3d.maths.vector.Vector3d direction)
Set the current viewing direction for the user.
|
protected org.j3d.util.frustum.ViewFrustum landscapeView
protected TerrainData terrainData
public Landscape(org.j3d.util.frustum.ViewFrustum view,
TerrainData data)
view - The viewing frustum to see the data withdata - The raw data to viewIllegalArgumentException - either parameter is nullpublic float getHeight(float x,
float z)
getHeight in interface HeightDataSourcex - The x coordinate for the height samplingz - The z coordinate for the height samplingpublic abstract void initialize(org.j3d.maths.vector.Point3d position,
org.j3d.maths.vector.Vector3d direction)
position - The position the user is in the virtual worlddirection - The orientation of the user's gazepublic abstract void setView(org.j3d.maths.vector.Point3d position,
org.j3d.maths.vector.Vector3d direction)
position - The position the user is in the virtual worlddirection - The orientation of the user's gaze
Copyright © 2001 - 2015 j3d.org