Manages the landscape data and performs various rasterization algorithms (draw cells, lines etc)
More...
|
| LandscapeDataRasterizer (Terrain terrain, Rect worldBounds) |
| Creates a new instance More...
|
|
void | LoadData () |
| Loads the data from the terrain into memory for modification More...
|
|
void | DrawCell (float x, float y, float w, float h, float elevation) |
|
void | DrawCell (float x, float y, float w, float h, float elevation, float flatten) |
| Rasterizes the terrain height along the specified world cooridnate with the specified elevation height More...
|
|
void | SmoothCell (float x, float y, float w, float h, float elevation, int smoothingDistance, AnimationCurve smoothingCurve) |
|
void | SmoothCell (float x, float y, float w, float h, float elevation, int smoothingDistance, AnimationCurve smoothingCurve, float flatten) |
| Applies a smoothing blur filter based on the user-defined smoothing curve More...
|
|
void | SaveData () |
| Saves the data in memory back into the terrain. This modifies the terrain object More...
|
|
|
static float | GetHeight (Terrain terrain, float worldX, float worldZ) |
| Gets the height of the terrain at the specified world space More...
|
|
static void | WorldToTerrainDistance (Terrain terrain, float worldDistX, float worldDistZ, out int terrainDistX, out int terrainDistZ) |
|
static void | TerrainToWorldDistance (Terrain terrain, int terrainDistX, int terrainDistZ, out float worldDistX, out float worldDistZ) |
|
static void | WorldToTerrainCoord (Terrain terrain, float x, float y, out int gx, out int gy) |
| Converts the world coordinate to internal terrain coordinate where the data is loaded More...
|
|
static void | WorldToTerrainCoord (Terrain terrain, float x, float y, out int gx, out int gy, RasterizerTextureSpace textureSpace) |
| Converts the world coordinate to internal terrain coordinate where the data is loaded More...
|
|
static void | WorldToTerrainTextureCoord (Terrain terrain, float x, float y, out int tx, out int ty) |
| Converts the world coordinate to terrain texture coordinate More...
|
|
static void | WorldToTerrainDetailCoord (Terrain terrain, float x, float y, out int tx, out int ty) |
| Converts the world coordinate to terrain texture coordinate More...
|
|
Manages the landscape data and performs various rasterization algorithms (draw cells, lines etc)
Definition at line 17 of file LandscapeDataRasterizer.cs.
◆ LandscapeDataRasterizer()
DungeonArchitect.Landscape.LandscapeDataRasterizer.LandscapeDataRasterizer |
( |
Terrain |
terrain, |
|
|
Rect |
worldBounds |
|
) |
| |
Creates a new instance
- Parameters
-
terrain | The terrain object to modify |
elevation | The prefered ground level elevation |
Definition at line 32 of file LandscapeDataRasterizer.cs.
◆ DrawCell()
void DungeonArchitect.Landscape.LandscapeDataRasterizer.DrawCell |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
w, |
|
|
float |
h, |
|
|
float |
elevation, |
|
|
float |
flatten |
|
) |
| |
Rasterizes the terrain height along the specified world cooridnate with the specified elevation height
- Parameters
-
x | x cooridnate in world space |
y | z coordinate in world space |
w | width in world space |
h | height in world space |
elevation | The elevation to set in the specified bounds |
Definition at line 254 of file LandscapeDataRasterizer.cs.
◆ GetHeight()
static float DungeonArchitect.Landscape.LandscapeDataRasterizer.GetHeight |
( |
Terrain |
terrain, |
|
|
float |
worldX, |
|
|
float |
worldZ |
|
) |
| |
|
static |
Gets the height of the terrain at the specified world space
- Parameters
-
terrain | The terrain object |
worldX | X cooridnate in world space |
worldZ | Z cooridnate in world space |
- Returns
- The Y height of the terrain at the specified location
Definition at line 88 of file LandscapeDataRasterizer.cs.
◆ LoadData()
void DungeonArchitect.Landscape.LandscapeDataRasterizer.LoadData |
( |
| ) |
|
◆ SaveData()
void DungeonArchitect.Landscape.LandscapeDataRasterizer.SaveData |
( |
| ) |
|
◆ SmoothCell()
void DungeonArchitect.Landscape.LandscapeDataRasterizer.SmoothCell |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
w, |
|
|
float |
h, |
|
|
float |
elevation, |
|
|
int |
smoothingDistance, |
|
|
AnimationCurve |
smoothingCurve, |
|
|
float |
flatten |
|
) |
| |
Applies a smoothing blur filter based on the user-defined smoothing curve
- Parameters
-
x | x cooridnate in world space |
y | z coordinate in world space |
w | width in world space |
h | height in world space |
elevation | The elevation to set in the specified bounds |
smoothingDistance | The distance to apply the smoothing transition on. For e.g. if the distance it 5, the smoothing would occur over 5 units |
smoothingCurve | The user defined curve to control the steepness of cliffs |
Definition at line 307 of file LandscapeDataRasterizer.cs.
◆ WorldToTerrainCoord() [1/2]
static void DungeonArchitect.Landscape.LandscapeDataRasterizer.WorldToTerrainCoord |
( |
Terrain |
terrain, |
|
|
float |
x, |
|
|
float |
y, |
|
|
out int |
gx, |
|
|
out int |
gy |
|
) |
| |
|
static |
Converts the world coordinate to internal terrain coordinate where the data is loaded
- Parameters
-
terrain | The terrain to query |
x | x coordinate in world coordinate |
y | z coordinate in world coordinate |
gx | x cooridnate in the 2D terrain height data coordinate |
gy | y cooridnate in the 2D terrain height data coordinate |
Definition at line 132 of file LandscapeDataRasterizer.cs.
◆ WorldToTerrainCoord() [2/2]
static void DungeonArchitect.Landscape.LandscapeDataRasterizer.WorldToTerrainCoord |
( |
Terrain |
terrain, |
|
|
float |
x, |
|
|
float |
y, |
|
|
out int |
gx, |
|
|
out int |
gy, |
|
|
RasterizerTextureSpace |
textureSpace |
|
) |
| |
|
static |
Converts the world coordinate to internal terrain coordinate where the data is loaded
- Parameters
-
terrain | The terrain to query |
x | x coordinate in world coordinate |
y | z coordinate in world coordinate |
gx | x cooridnate in the 2D terrain height data coordinate |
gy | y cooridnate in the 2D terrain height data coordinate |
Definition at line 145 of file LandscapeDataRasterizer.cs.
◆ WorldToTerrainDetailCoord()
static void DungeonArchitect.Landscape.LandscapeDataRasterizer.WorldToTerrainDetailCoord |
( |
Terrain |
terrain, |
|
|
float |
x, |
|
|
float |
y, |
|
|
out int |
tx, |
|
|
out int |
ty |
|
) |
| |
|
static |
Converts the world coordinate to terrain texture coordinate
- Parameters
-
terrain | The terrain to query |
x | x coordinate in world coordinate |
y | z coordinate in world coordinate |
tx | x cooridnate in the 2D terrain texture data coordinate |
ty | y cooridnate in the 2D terrain texture data coordinate |
Definition at line 219 of file LandscapeDataRasterizer.cs.
◆ WorldToTerrainTextureCoord()
static void DungeonArchitect.Landscape.LandscapeDataRasterizer.WorldToTerrainTextureCoord |
( |
Terrain |
terrain, |
|
|
float |
x, |
|
|
float |
y, |
|
|
out int |
tx, |
|
|
out int |
ty |
|
) |
| |
|
static |
Converts the world coordinate to terrain texture coordinate
- Parameters
-
terrain | The terrain to query |
x | x coordinate in world coordinate |
y | z coordinate in world coordinate |
tx | x cooridnate in the 2D terrain texture data coordinate |
ty | y cooridnate in the 2D terrain texture data coordinate |
Definition at line 190 of file LandscapeDataRasterizer.cs.
The documentation for this class was generated from the following file: