com.jme3.terrain.heightmap
クラス CombinerHeightMap

java.lang.Object
  上位を拡張 com.jme3.terrain.heightmap.AbstractHeightMap
      上位を拡張 com.jme3.terrain.heightmap.CombinerHeightMap
すべての実装されたインタフェース:
HeightMap

public class CombinerHeightMap
extends AbstractHeightMap

CombinerHeightMap generates a new height map based on two provided height maps. These had maps can either be added together or substracted from each other. Each heightmap has a weight to determine how much one will affect the other. By default it is set to 0.5, 0.5 and meaning the two heightmaps are averaged evenly. This value can be adjusted at will, as long as the two factors are equal to 1.0.


フィールドの概要
static int ADDITION
          Constant mode to denote adding the two heightmaps.
static int SUBTRACTION
          Constant mode to denote subtracting the two heightmaps.
 
クラス com.jme3.terrain.heightmap.AbstractHeightMap から継承されたフィールド
NORMALIZE_RANGE
 
コンストラクタの概要
CombinerHeightMap(AbstractHeightMap map1, AbstractHeightMap map2, int mode)
          Constructor combines two given heightmaps by the specified mode.
CombinerHeightMap(AbstractHeightMap map1, float factor1, AbstractHeightMap map2, float factor2, int mode)
          Constructor combines two given heightmaps by the specified mode.
 
メソッドの概要
 boolean load()
          load builds a new heightmap based on the combination of two other heightmaps.
 void setFactors(float factor1, float factor2)
          setFactors sets the distribution of heightmaps.
 void setHeightMaps(AbstractHeightMap map1, AbstractHeightMap map2)
          setHeightMaps sets the height maps to combine.
 void setMode(int mode)
          setMode sets the mode of the combiner.
 
クラス com.jme3.terrain.heightmap.AbstractHeightMap から継承されたメソッド
erodeTerrain, findMinMaxHeights, flatten, getHeightMap, getInterpolatedHeight, getScaledHeightAtPoint, getScaledHeightMap, getSize, getTrueHeightAtPoint, normalizeTerrain, save, setHeightAtPoint, setHeightScale, setMagnificationFilter, setSize, smooth, unloadHeightMap
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

ADDITION

public static final int ADDITION
Constant mode to denote adding the two heightmaps.

関連項目:
定数フィールド値

SUBTRACTION

public static final int SUBTRACTION
Constant mode to denote subtracting the two heightmaps.

関連項目:
定数フィールド値
コンストラクタの詳細

CombinerHeightMap

public CombinerHeightMap(AbstractHeightMap map1,
                         AbstractHeightMap map2,
                         int mode)
                  throws java.lang.Exception
Constructor combines two given heightmaps by the specified mode. The heightmaps will be evenly distributed. The heightmaps must be of the same size.

パラメータ:
map1 - the first heightmap to combine.
map2 - the second heightmap to combine.
mode - denotes whether to add or subtract the heightmaps, may be either ADDITION or SUBTRACTION.
例外:
JmeException - if either map is null, their size do not match or the mode is invalid.
java.lang.Exception

CombinerHeightMap

public CombinerHeightMap(AbstractHeightMap map1,
                         float factor1,
                         AbstractHeightMap map2,
                         float factor2,
                         int mode)
                  throws java.lang.Exception
Constructor combines two given heightmaps by the specified mode. The heightmaps will be distributed based on the given factors. For example, if factor1 is 0.6 and factor2 is 0.4, then 60% of map1 will be used with 40% of map2. The two factors must add up to 1.0. The heightmaps must also be of the same size.

パラメータ:
map1 - the first heightmap to combine.
factor1 - the factor for map1.
map2 - the second heightmap to combine.
factor2 - the factor for map2.
mode - denotes whether to add or subtract the heightmaps, may be either ADDITION or SUBTRACTION.
例外:
JmeException - if either map is null, their size do not match, the mode is invalid, or the factors do not add to 1.0.
java.lang.Exception
メソッドの詳細

setFactors

public void setFactors(float factor1,
                       float factor2)
                throws java.lang.Exception
setFactors sets the distribution of heightmaps. For example, if factor1 is 0.6 and factor2 is 0.4, then 60% of map1 will be used with 40% of map2. The two factors must add up to 1.0.

パラメータ:
factor1 - the factor for map1.
factor2 - the factor for map2.
例外:
JmeException - if the factors do not add to 1.0.
java.lang.Exception

setHeightMaps

public void setHeightMaps(AbstractHeightMap map1,
                          AbstractHeightMap map2)
                   throws java.lang.Exception
setHeightMaps sets the height maps to combine. The size of the height maps must be the same.

パラメータ:
map1 - the first height map.
map2 - the second height map.
例外:
JmeException - if the either heightmap is null, or their sizes do not match.
java.lang.Exception

setMode

public void setMode(int mode)
             throws java.lang.Exception
setMode sets the mode of the combiner. This may either be ADDITION or SUBTRACTION.

パラメータ:
mode - the mode of the combiner.
例外:
JmeException - if mode is not ADDITION or SUBTRACTION.
java.lang.Exception

load

public boolean load()
load builds a new heightmap based on the combination of two other heightmaps. The conditions of the combiner determine the final outcome of the heightmap.

戻り値:
boolean if the heightmap was successfully created.