diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/Minimodule/Heightmap.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/Minimodule/IHeightmap.cs | 21 |
2 files changed, 28 insertions, 5 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Heightmap.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Heightmap.cs index 2f6c204..875de50 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Heightmap.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Heightmap.cs | |||
@@ -31,13 +31,19 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
31 | { | 31 | { |
32 | public class Heightmap : IHeightmap | 32 | public class Heightmap : IHeightmap |
33 | { | 33 | { |
34 | private Scene m_scene; | 34 | private readonly Scene m_scene; |
35 | 35 | ||
36 | public Heightmap(Scene scene) | 36 | public Heightmap(Scene scene) |
37 | { | 37 | { |
38 | m_scene = scene; | 38 | m_scene = scene; |
39 | } | 39 | } |
40 | 40 | ||
41 | public double this[int x, int y] | ||
42 | { | ||
43 | get { return Get(x, y); } | ||
44 | set { Set(x, y, value); } | ||
45 | } | ||
46 | |||
41 | public int Height | 47 | public int Height |
42 | { | 48 | { |
43 | get { return m_scene.Heightmap.Height; } | 49 | get { return m_scene.Heightmap.Height; } |
@@ -48,12 +54,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
48 | get { return m_scene.Heightmap.Width; } | 54 | get { return m_scene.Heightmap.Width; } |
49 | } | 55 | } |
50 | 56 | ||
51 | public double Get(int x, int y) | 57 | protected double Get(int x, int y) |
52 | { | 58 | { |
53 | return m_scene.Heightmap[x, y]; | 59 | return m_scene.Heightmap[x, y]; |
54 | } | 60 | } |
55 | 61 | ||
56 | public void Set(int x, int y, double val) | 62 | protected void Set(int x, int y, double val) |
57 | { | 63 | { |
58 | m_scene.Heightmap[x, y] = val; | 64 | m_scene.Heightmap[x, y] = val; |
59 | } | 65 | } |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IHeightmap.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IHeightmap.cs index 37cf8ae..afea12b 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IHeightmap.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IHeightmap.cs | |||
@@ -33,9 +33,26 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
33 | { | 33 | { |
34 | public interface IHeightmap | 34 | public interface IHeightmap |
35 | { | 35 | { |
36 | /// <summary> | ||
37 | /// Returns [or sets] the heightmap value at specified coordinates. | ||
38 | /// </summary> | ||
39 | /// <param name="x">X Coordinate</param> | ||
40 | /// <param name="y">Y Coordinate</param> | ||
41 | /// <returns>A value in meters representing height. Can be negative. Value correlates with Z parameter in world coordinates</returns> | ||
42 | double this[int x, int y] | ||
43 | { | ||
44 | get; | ||
45 | set; | ||
46 | } | ||
47 | |||
48 | /// <summary> | ||
49 | /// The maximum height of the region (Y axis), exclusive. (eg Height = 256, max Y = 255). Minimum is always 0 inclusive. | ||
50 | /// </summary> | ||
36 | int Height { get; } | 51 | int Height { get; } |
52 | |||
53 | /// <summary> | ||
54 | /// The maximum width of the region (X axis), exclusive. (eg Width = 256, max X = 255). Minimum is always 0 inclusive. | ||
55 | /// </summary> | ||
37 | int Width { get; } | 56 | int Width { get; } |
38 | double Get(int x, int y); | ||
39 | void Set(int x, int y, double val); | ||
40 | } | 57 | } |
41 | } | 58 | } |