Package worldBuilder
Class TerrainEngine
- java.lang.Object
-
- worldBuilder.TerrainEngine
-
public class TerrainEngine extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description TerrainEngine(Map map)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
abort()
revert maps to last committed valuesboolean
commit()
make this heightMap officialboolean
exaggerate(boolean[] selected, double zMultiple)
exaggerate/compress delta Z for all points in a boxboolean
raise(boolean[] selected, double deltaZ)
raise or lower all points in a boxboolean
ridge(double x0, double y0, double x1, double y1, double height, double r1, double r2, int shape1, int shape2)
lay out a potentially asymmetric mountain/pit or ridge/valleyboolean
ridge(double x0, double y0, double x1, double y1, double height, double radius, int shape)
lay out a symmetric mountain/pit or ridge/valleyboolean
setIncoming(MeshPoint p, double flux)
set the incoming river flux for the specified MeshPointboolean
slope(int axis, double inclination)
impose a slope on the entire map
-
-
-
Constructor Detail
-
TerrainEngine
public TerrainEngine(Map map)
-
-
Method Detail
-
slope
public boolean slope(int axis, double inclination)
impose a slope on the entire map- Parameters:
axis
- (degrees: -180 - 180)inclination
- (dy/dx)
-
raise
public boolean raise(boolean[] selected, double deltaZ)
raise or lower all points in a box- Parameters:
selected
- ... per point selected/not booleansdeltaZ
- amount to add to each MeshPoint
-
exaggerate
public boolean exaggerate(boolean[] selected, double zMultiple)
exaggerate/compress delta Z for all points in a box- Parameters:
selected
- ... per point selected/not booleansdeltaZ
- amount to add to each MeshPoint
-
ridge
public boolean ridge(double x0, double y0, double x1, double y1, double height, double radius, int shape)
lay out a symmetric mountain/pit or ridge/valley- Parameters:
x0
- one end x (map coordinate)y0
- one end y (map coordinate)x1
- other end x (map coordinate)y1
- other end y (map coordinate)height
- height/depth (z units)radius
- width/2 (x/y units)shape
- from Parameters.CONICAL-CYLINDRICAL- Returns:
- boolean (were any points relocated)
-
ridge
public boolean ridge(double x0, double y0, double x1, double y1, double height, double r1, double r2, int shape1, int shape2)
lay out a potentially asymmetric mountain/pit or ridge/valley- Parameters:
x0
- one end x (map coordinate)y0
- one end y (map coordinate)x1
- other end x (map coordinate)y1
- other end y (map coordinate)height
- height/depth (z units)r1
- top/right width/2 (x/y units)r2
- bot/left width/2 (x/y units)shape1
- top/right profile (from Parameters.CONICAL-CYLINDRICAL)shape2
- bot/left profile- Returns:
- boolean (were any points relocated) NOTE A: MeshPoint.distanceLine() behaves badly when the line is of zero length or the point is beyond one of its end-points. Radius out from an end-point works out-side the end-points, but yields incorrectly small values for points between the two end-points. Thus it is important that we be able to distinguish these two cases so we can use the most appropriate distance formula. A point is in the end region if it is within R of an end-point, and beyond the separation distance from the other end-point. That separation distance ranges between sep and sqrt(sep^2 + radius^2) ... depending on how far away from the center line the point is. I am currently using the larger number for the test, but this means that distanceLine is being used in regions where it yields incorrect values ... resulting in radius inaccuracies outside the end-points.
-
setIncoming
public boolean setIncoming(MeshPoint p, double flux)
set the incoming river flux for the specified MeshPoint- Parameters:
MeshPointoint
- to be updatedflux
- for this MeshPoint
-
commit
public boolean commit()
make this heightMap official
-
abort
public boolean abort()
revert maps to last committed values
-
-