Interface ITerrainSampler
Interface to TerrainSampler.
Namespace: DaggerfallWorkshop
Assembly: Assembly-CSharp.dll
Syntax
public interface ITerrainSampler
Properties
| Improve this Doc View SourceBeachElevation
Beach line elevation. How far above sea level the beach line extends.
Declaration
float BeachElevation { get; set; }
Property Value
Type | Description |
---|---|
Single |
HeightmapDimension
Declaration
int HeightmapDimension { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
MaxTerrainHeight
Maximum height of terrain. Used for clamping max height and setting Unity's TerrainData.size Y axis.
Declaration
float MaxTerrainHeight { get; set; }
Property Value
Type | Description |
---|---|
Single |
MeanTerrainHeightScale
Mean scale factor of terrain height. This should return the mean value of the scale factor for terrain heights (e.g. multiplication factor of low resolution height map values + multiplication factor of detailed height map values). This value can/will be used by terrain-related mods.
Declaration
float MeanTerrainHeightScale { get; set; }
Property Value
Type | Description |
---|---|
Single |
OceanElevation
Sea level. Use for clamping min height and texturing with ocean.
Declaration
float OceanElevation { get; set; }
Property Value
Type | Description |
---|---|
Single |
Version
Version of terrain sampler implementation. This is serialized with save games to ensure player is being loaded back into the same world on deserialization. If you make a change to how heightmaps are generated, then you MUST tick up the version number. Failed to do this can make player fall through world on load.
Declaration
int Version { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceGenerateSamples(ref MapPixelData)
Populates a MapPixelData struct using custom height sample generator.
Declaration
void GenerateSamples(ref MapPixelData mapPixel)
Parameters
Type | Name | Description |
---|---|---|
MapPixelData | mapPixel | MapPixelData struct. |
IsLocationTerrainBlended()
Indicates whether this sampler blends / flattens terrain for locations and thus controls whether the standard job to blend terrain for locations should be run or not.
Declaration
bool IsLocationTerrainBlended()
Returns
Type | Description |
---|---|
Boolean | true if this sampler blends terrain for locations, false if standard location blending should be performed |
ScheduleGenerateSamplesJob(ref MapPixelData)
Populates a MapPixelData struct using custom height sample generator implemented using Unity Jobs system. The Dispose() method should be called after the jobs are completed to free any allocated memory. NOTE: Backwards compatible with implementations that only implement GenerateSamples, and will call that then convert the output before returning. (reduces performance a little)
Declaration
JobHandle ScheduleGenerateSamplesJob(ref MapPixelData mapPixel)
Parameters
Type | Name | Description |
---|---|---|
MapPixelData | mapPixel | MapPixelData struct. |
Returns
Type | Description |
---|---|
Unity.Jobs.JobHandle | JobHandle of the scheduled job. |
TerrainHeightScale(Int32, Int32)
Get terrain height scale for given x and y position on the world map
Declaration
float TerrainHeightScale(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
Int32 | x | world map x position |
Int32 | y | world map y position |
Returns
Type | Description |
---|---|
Single |