Package Hexel.generation.terrainGenerator.heightMaps

Source Code of Hexel.generation.terrainGenerator.heightMaps.FractalHexagonalHeightMap

package Hexel.generation.terrainGenerator.heightMaps;

import Hexel.math.HexGeometry;
import Hexel.math.Vector2i;

public class FractalHexagonalHeightMap {
 
  private FractalHeightMapGenerator heightMapGen;
 
  public FractalHexagonalHeightMap(int seed){
    heightMapGen = new FractalHeightMapGenerator(seed);
  }
 
  public int getHeight(int x, int y, Vector2i tmp) {
    Vector2i hex = new Vector2i();
    Vector2i tri = new Vector2i();
    HexGeometry.tringleToHexel(x, y, hex);
    HexGeometry.hexelToTringle(hex.x, hex.y, tri);
    return heightMapGen.getHeight(tri.x, tri.y, tmp);
  }
}
TOP

Related Classes of Hexel.generation.terrainGenerator.heightMaps.FractalHexagonalHeightMap

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.