|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HeightDataSource
A marker interface to indicate that a class can contain direct height information without needing to calculate intersection points.
This interface is used to mark any type of class as being able to provide
height information that is useful for terrain following. The typical
terrain code will store the data class in the userData section of a Java3D
node. When the terrain following code goes looking in the userData, it may
find an instance of this interface or the GeometryData
to help it speed up the process. In the case of this class, we can perform
special case operations that will return height in the local coordinate
system Y axis. With a simple height (which may have to be interpolated from
the underlying data source), calculations are much easier.
An important caveat must be made here - this class is only applicable for single-sided surfaces, such as terrain. To fetch the height of a sphere using this class is totally meaningless as there are two possible answers and the code does no know which "side" of the sphere to give the height for.
Method Summary | |
---|---|
float |
getHeight(float x,
float z)
Get the height at the given X,Z coordinate in the local coordinate system. |
Method Detail |
---|
float getHeight(float x, float z)
x
- The x coordinate for the height samplingz
- The z coordinate for the height sampling
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |