Package toxi.sim.erosion
Class TalusAngleErosion
java.lang.Object
toxi.sim.erosion.ErosionFunction
toxi.sim.erosion.TalusAngleErosion
For each neighbour it's computed the difference between the processed cell
and the neighbour:
d[i] = h - h[i];the maximum positive difference is stored in d_max, and the sum of all the positive differences that are bigger than T (this numer is n), the talus angle, is stored in d_tot. Now it's possible to update all the n cells (where d[i] is bigger than T) using this formula:
h[i] = h[i] + c * (d_max - T) * (d[i] / d_tot);and the main cell with this other formula:
h = h - (d_max - (n * d_max * T / d_tot));The Talus angle T is a threshold that determines which slopes are affected by the erosion, instead the c constant determines how much material is eroded.
-
Constructor Summary
-
Method Summary
Methods inherited from class toxi.sim.erosion.ErosionFunction
erodeAll, erodeWithinPolygon, setElevation
-
Constructor Details
-
TalusAngleErosion
public TalusAngleErosion(float theta, float amount) - Parameters:
theta
- talus angleamount
- material transport amount
-
-
Method Details
-
erodeAt
public void erodeAt(int x, int y) - Specified by:
erodeAt
in classErosionFunction
-
getAmount
public float getAmount()- Returns:
- the amount
-
getTheta
public float getTheta()- Returns:
- the theta
-
setAmount
public void setAmount(float amount) - Parameters:
amount
- the amount to set
-
setTheta
public void setTheta(float theta) - Parameters:
theta
- the theta to set
-
toString
-