|
j3d.org Code | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.j3d.terrain.Landscape
org.j3d.renderer.java3d.terrain.J3DAbstractLandscape
Representation of a Java3D-specific additional interfaces to the basic Landscape interface.
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
Landscape.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.
For convenience, this class also implements FrameUpdateListener from
the org.j3d.ui.navigation package so that you can have fast, quick
navigation implementation in your code. If you wish to use your own custom
user input code, then there is no penalty for doing so. Simply call one of
the setView() methods directly with the transformation
information.
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.
| Field Summary | |
protected AppearanceGenerator |
appearanceGenerator
Generator for appearance information. |
protected javax.media.j3d.BranchGroup |
rootGroup
Geometry used to represent this terrain at the J3D level |
| Fields inherited from class org.j3d.terrain.Landscape |
landscapeView, terrainData |
| Constructor Summary | |
J3DAbstractLandscape(ViewFrustum view,
TerrainData data)
Create a new Landscape with the set view and data. |
|
J3DAbstractLandscape(ViewFrustum view,
TerrainData data,
AppearanceGenerator gen)
Provide a landscape with a specific appearance generator set. |
|
| Method Summary | |
AppearanceGenerator |
getAppearanceGenerator()
Get the currently set appearance generator. |
javax.media.j3d.BranchGroup |
getSceneGraphObject()
Get the geometry group that this terrain is being rendered to. |
void |
setAppearanceGenerator(AppearanceGenerator gen)
Set the appearance generator to create new appearanace items. |
void |
setView(javax.media.j3d.Transform3D t3d)
Set the current view location information based on a transform matrix. |
void |
transitionEnded(javax.media.j3d.Transform3D t3d)
The transition from one point to another is completed. |
void |
viewerPositionUpdated(javax.media.j3d.Transform3D t3d)
The frame has just been updated with the latest view information. |
| Methods inherited from class org.j3d.terrain.Landscape |
getHeight, initialize, setView |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected AppearanceGenerator appearanceGenerator
protected javax.media.j3d.BranchGroup rootGroup
| Constructor Detail |
public J3DAbstractLandscape(ViewFrustum view,
TerrainData data)
view - The viewing frustum to see the data withdata - The raw data to view
java.lang.IllegalArgumentException - either parameter is null
public J3DAbstractLandscape(ViewFrustum view,
TerrainData data,
AppearanceGenerator gen)
view - The viewing frustum to see the data withdata - The raw data to viewgen - The generator instance to use
java.lang.IllegalArgumentException - either parameter is null| Method Detail |
public void transitionEnded(javax.media.j3d.Transform3D t3d)
transitionEnded in interface FrameUpdateListenert3d - The position of the final viewpointpublic void viewerPositionUpdated(javax.media.j3d.Transform3D t3d)
viewerPositionUpdated in interface FrameUpdateListenert3d - The position of the viewpoint nowpublic void setView(javax.media.j3d.Transform3D t3d)
org.j3d.ui.navigation package.
setView in interface J3DLandscapet3d - The transform to use as the view positionpublic void setAppearanceGenerator(AppearanceGenerator gen)
setAppearanceGenerator in interface J3DLandscapegen - The new generator instance to usepublic AppearanceGenerator getAppearanceGenerator()
getAppearanceGenerator in interface J3DLandscapepublic javax.media.j3d.BranchGroup getSceneGraphObject()
getSceneGraphObject in interface J3DLandscape
|
j3d.org Code | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||