com.jme3.terrain.geomipmap
クラス TerrainQuad

java.lang.Object
  上位を拡張 com.jme3.scene.Spatial
      上位を拡張 com.jme3.scene.Node
          上位を拡張 com.jme3.terrain.geomipmap.TerrainQuad
すべての実装されたインタフェース:
Asset, Collidable, Savable, Terrain, java.lang.Cloneable
直系の既知のサブクラス:
TerrainGrid

public class TerrainQuad
extends Node
implements Terrain

A terrain quad is a node in the quad tree of the terrain system. The root terrain quad will be the only one that receives the update() call every frame and it will determine if there has been any LOD change. The leaves of the terrain quad tree are Terrain Patches. These have the real geometry mesh.


入れ子のクラスの概要
 
クラス com.jme3.scene.Spatial から継承された入れ子のクラス/インタフェース
Spatial.CullHint
 
フィールドの概要
 
クラス com.jme3.scene.Spatial から継承されたフィールド
queueDistance
 
コンストラクタの概要
TerrainQuad()
           
TerrainQuad(java.lang.String name, int patchSize, int totalSize, float[] heightMap)
           
TerrainQuad(java.lang.String name, int patchSize, int totalSize, float[] heightMap, LodCalculatorFactory lodCalculatorFactory)
           
TerrainQuad(java.lang.String name, int patchSize, int size, int totalSize, float[] heightMap, LodCalculatorFactory lodCalculatorFactory)
           
TerrainQuad(java.lang.String name, int patchSize, int size, Vector3f scale, float[] heightMap, LodCalculatorFactory lodCalculatorFactory)
           
 
メソッドの概要
 void adjustHeight(java.util.List<Vector2f> xz, java.util.List<java.lang.Float> height)
          Raise/lower the height at many points.
 void adjustHeight(Vector2f xz, float delta)
          Raise/lower the height in one call (instead of getHeight then setHeight).
 void attachBoundChildren(Node parent)
          A handy method that will attach all bounding boxes of this terrain to the node you supply.
 TerrainQuad clone()
           
 TerrainQuad clone(boolean cloneMaterials)
           
 int collideWith(Collidable other, CollisionResults results)
          Check collision with another Collidable.
 float[] createHeightSubBlock(float[] heightMap, int x, int y, int side)
           
 void findPick(Ray toTest, java.util.List<TerrainPickData> results)
          Gather the terrain patches that intersect the given ray (toTest).
 void generateDebugTangents(Material mat)
           
 void generateEntropy(ProgressMonitor progressMonitor)
          Pre-calculate entropy values.
 void getAllTerrainPatches(java.util.List<TerrainPatch> holder)
          Retrieve all Terrain Patches from all children and store them in the 'holder' list
 void getAllTerrainPatchesWithTranslation(java.util.Map<TerrainPatch,Vector3f> holder, Vector3f translation)
           
 float getHeight(Vector2f xz)
          Get the real-world height of the terrain at the specified X-Z coorindate.
 float[] getHeightMap()
          Get the heightmap of the entire terrain.
 float getHeightmapHeight(Vector2f xz)
          Get the heightmap height at the specified X-Z coordinate.
 Material getMaterial()
          Returns the material that this terrain uses.
 int getMaxLod()
          This is calculated by the specific LOD algorithm.
 int getPatchSize()
           
 int getQuadrant()
           
 int getTerrainSize()
          Used for painting to get the number of vertices along the edge of the terrain.
 float getTextureCoordinateScale()
          Get the scale of the texture coordinates.
 int getTotalSize()
           
 void read(JmeImporter e)
           
 void setHeight(java.util.List<Vector2f> xz, java.util.List<java.lang.Float> height)
          Set the height at many points.
 void setHeight(Vector2f xz, float height)
          Set the height at the specified X-Z coordinate.
 void setLocked(boolean locked)
          lock or unlock the meshes of this terrain.
 void setLodCalculatorFactory(LodCalculatorFactory lodCalculatorFactory)
           
 void setQuadrant(short quadrant)
           
 void update(java.util.List<Vector3f> locations)
          Call from the update() method of a terrain controller to update the LOD values of each patch.
 void write(JmeExporter e)
           
 
クラス com.jme3.scene.Node から継承されたメソッド
attachChild, attachChildAt, deepClone, depthFirstTraversal, descendantMatches, descendantMatches, descendantMatches, detachAllChildren, detachChild, detachChildAt, detachChildNamed, getChild, getChild, getChildIndex, getChildren, getQuantity, getTriangleCount, getVertexCount, hasChild, setLodLevel, setMaterial, setModelBound, swapChildren, updateGeometricState, updateLogicalState, updateModelBound
 
クラス com.jme3.scene.Spatial から継承されたメソッド
addControl, addLight, breadthFirstTraversal, center, checkCulling, getControl, getControl, getCullHint, getKey, getLastFrustumIntersection, getLocalCullHint, getLocalLightList, getLocalQueueBucket, getLocalRotation, getLocalScale, getLocalShadowMode, getLocalToWorldMatrix, getLocalTransform, getLocalTranslation, getName, getNumControls, getParent, getQueueBucket, getShadowMode, getUserData, getUserDataKeys, getWorldBound, getWorldLightList, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, localToWorld, lookAt, matches, move, move, removeControl, removeControl, removeFromParent, removeLight, rotate, rotate, rotateUpTo, runControlRender, scale, scale, setCullHint, setKey, setLastFrustumIntersection, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalScale, setLocalTransform, setLocalTranslation, setLocalTranslation, setName, setQueueBucket, setShadowMode, setUserData, toString, worldToLocal
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

TerrainQuad

public TerrainQuad()

TerrainQuad

public TerrainQuad(java.lang.String name,
                   int patchSize,
                   int totalSize,
                   float[] heightMap)

TerrainQuad

public TerrainQuad(java.lang.String name,
                   int patchSize,
                   int totalSize,
                   float[] heightMap,
                   LodCalculatorFactory lodCalculatorFactory)

TerrainQuad

public TerrainQuad(java.lang.String name,
                   int patchSize,
                   int size,
                   int totalSize,
                   float[] heightMap,
                   LodCalculatorFactory lodCalculatorFactory)

TerrainQuad

public TerrainQuad(java.lang.String name,
                   int patchSize,
                   int size,
                   Vector3f scale,
                   float[] heightMap,
                   LodCalculatorFactory lodCalculatorFactory)
メソッドの詳細

setLodCalculatorFactory

public void setLodCalculatorFactory(LodCalculatorFactory lodCalculatorFactory)

update

public void update(java.util.List<Vector3f> locations)
Call from the update() method of a terrain controller to update the LOD values of each patch. This will perform the geometry calculation in a background thread and do the actual update on the opengl thread.

定義:
インタフェース Terrain 内の update

generateEntropy

public void generateEntropy(ProgressMonitor progressMonitor)
インタフェース Terrain の記述:
Pre-calculate entropy values. Some terrain systems support entropy calculations to determine LOD changes. Often these entropy calculations are expensive and can be cached ahead of time. Use this method to do that.

定義:
インタフェース Terrain 内の generateEntropy

getMaterial

public Material getMaterial()
インタフェース Terrain の記述:
Returns the material that this terrain uses. This does not necessarily have to guarantee the material return is the only material used in the whole terrain structure.

定義:
インタフェース Terrain 内の getMaterial

getTextureCoordinateScale

public float getTextureCoordinateScale()
インタフェース Terrain の記述:
Get the scale of the texture coordinates. Normally if the texture is laid on the terrain and not scaled so that the texture does not repeat, then each texture coordinate (on a vertex) will be 1/(terrain size). That is: the coverage between each consecutive texture coordinate will be a percentage of the total terrain size. So if the terrain is 512 vertexes wide, then each texture coord will cover 1/512 (or 0.00195) percent of the texture. This is used for converting between tri-planar texture scales and regular texture scales.

定義:
インタフェース Terrain 内の getTextureCoordinateScale

generateDebugTangents

public void generateDebugTangents(Material mat)

createHeightSubBlock

public float[] createHeightSubBlock(float[] heightMap,
                                    int x,
                                    int y,
                                    int side)

attachBoundChildren

public void attachBoundChildren(Node parent)
A handy method that will attach all bounding boxes of this terrain to the node you supply. Useful to visualize the bounding boxes when debugging.

パラメータ:
parent - that will get the bounding box shapes of the terrain attached to

getHeightmapHeight

public float getHeightmapHeight(Vector2f xz)
インタフェース Terrain の記述:
Get the heightmap height at the specified X-Z coordinate. This does not count scaling and snaps the XZ coordinate to the nearest (rounded) heightmap grid point.

定義:
インタフェース Terrain 内の getHeightmapHeight
パラメータ:
xz - world coordinate
戻り値:
the height, unscaled and uninterpolated

getHeight

public float getHeight(Vector2f xz)
インタフェース Terrain の記述:
Get the real-world height of the terrain at the specified X-Z coorindate.

定義:
インタフェース Terrain 内の getHeight
パラメータ:
xz - the X-Z world coordinate
戻り値:
the height at the given point

setHeight

public void setHeight(Vector2f xz,
                      float height)
インタフェース Terrain の記述:
Set the height at the specified X-Z coordinate. To set the height of the terrain and see it, you will have to unlock the terrain meshes by calling terrain.setLocked(false) before you call setHeight().

定義:
インタフェース Terrain 内の setHeight
パラメータ:
xz - coordinate to set the height
height - that will be set at the coordinate

adjustHeight

public void adjustHeight(Vector2f xz,
                         float delta)
インタフェース Terrain の記述:
Raise/lower the height in one call (instead of getHeight then setHeight).

定義:
インタフェース Terrain 内の adjustHeight
パラメータ:
xz - world coordinate to adjust the terrain height
delta - +- value to adjust the height by

setHeight

public void setHeight(java.util.List<Vector2f> xz,
                      java.util.List<java.lang.Float> height)
インタフェース Terrain の記述:
Set the height at many points. The two lists must be the same size. Each xz coordinate entry matches to a height entry, 1 for 1. So the first coordinate matches to the first height value, the last to the last etc.

定義:
インタフェース Terrain 内の setHeight
パラメータ:
xz - a list of coordinates where the hight will be set
height - the heights that match the xz coordinates

adjustHeight

public void adjustHeight(java.util.List<Vector2f> xz,
                         java.util.List<java.lang.Float> height)
インタフェース Terrain の記述:
Raise/lower the height at many points. The two lists must be the same size. Each xz coordinate entry matches to a height entry, 1 for 1. So the first coordinate matches to the first height value, the last to the last etc.

定義:
インタフェース Terrain 内の adjustHeight
パラメータ:
xz - a list of coordinates where the hight will be adjusted
height - +- value to adjust the height by, that matches the xz coordinates

getTerrainSize

public int getTerrainSize()
インタフェース Terrain の記述:
Used for painting to get the number of vertices along the edge of the terrain. This is an un-scaled size, and should represent the vertex count (ie. the texture coord count) along an edge of a square terrain. In the standard TerrainQuad default implementation, this will return the "totalSize" of the terrain (512 or so).

定義:
インタフェース Terrain 内の getTerrainSize

setLocked

public void setLocked(boolean locked)
lock or unlock the meshes of this terrain. Locked meshes are uneditable but have better performance.

定義:
インタフェース Terrain 内の setLocked
パラメータ:
locked - or unlocked

getQuadrant

public int getQuadrant()

setQuadrant

public void setQuadrant(short quadrant)

collideWith

public int collideWith(Collidable other,
                       CollisionResults results)
インタフェース Collidable の記述:
Check collision with another Collidable.

定義:
インタフェース Collidable 内の collideWith
オーバーライド:
クラス Node 内の collideWith
パラメータ:
other - The object to check collision against
results - Will contain the list of CollisionResults.
戻り値:
how many collisions were found between this and other

findPick

public void findPick(Ray toTest,
                     java.util.List<TerrainPickData> results)
Gather the terrain patches that intersect the given ray (toTest). This only tests the bounding boxes

パラメータ:
toTest -
results -

getAllTerrainPatches

public void getAllTerrainPatches(java.util.List<TerrainPatch> holder)
Retrieve all Terrain Patches from all children and store them in the 'holder' list

パラメータ:
holder - must not be null, will be populated when returns

getAllTerrainPatchesWithTranslation

public void getAllTerrainPatchesWithTranslation(java.util.Map<TerrainPatch,Vector3f> holder,
                                                Vector3f translation)

read

public void read(JmeImporter e)
          throws java.io.IOException
定義:
インタフェース Savable 内の read
オーバーライド:
クラス Node 内の read
例外:
java.io.IOException

write

public void write(JmeExporter e)
           throws java.io.IOException
定義:
インタフェース Savable 内の write
オーバーライド:
クラス Node 内の write
例外:
java.io.IOException

clone

public TerrainQuad clone()
オーバーライド:
クラス Spatial 内の clone
戻り値:
A clone of this Spatial, the scene graph in its entirety is cloned and can be altered independently of the original scene graph. Note that meshes of geometries are not cloned explicitly, they are shared if static, or specially cloned if animated. All controls will be cloned using the Control.cloneForSpatial method on the clone.
関連項目:
Mesh.cloneForAnim()

clone

public TerrainQuad clone(boolean cloneMaterials)
オーバーライド:
クラス Node 内の clone
戻り値:
A clone of this Spatial, the scene graph in its entirety is cloned and can be altered independently of the original scene graph. Note that meshes of geometries are not cloned explicitly, they are shared if static, or specially cloned if animated. All controls will be cloned using the Control.cloneForSpatial method on the clone.
関連項目:
Mesh.cloneForAnim()

getMaxLod

public int getMaxLod()
インタフェース Terrain の記述:
This is calculated by the specific LOD algorithm. A value of one means that the terrain is showing full detail. The higher the value, the more the terrain has been generalized and the less detailed it will be.

定義:
インタフェース Terrain 内の getMaxLod

getPatchSize

public int getPatchSize()

getTotalSize

public int getTotalSize()

getHeightMap

public float[] getHeightMap()
インタフェース Terrain の記述:
Get the heightmap of the entire terrain. This can return null if that terrain object does not store the height data. Infinite or "paged" terrains will not be able to support this, so use with caution.

定義:
インタフェース Terrain 内の getHeightMap