mirror of
https://github.com/opensim/opensim.git
synced 2026-08-13 05:05:43 +08:00
terrain replace double by float
This commit is contained in:
@@ -36,7 +36,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
int Height { get;} // Y dimension
|
||||
int Altitude { get;} // Z dimension
|
||||
|
||||
double this[int x, int y] { get; set; }
|
||||
float this[int x, int y] { get; set; }
|
||||
|
||||
float GetHeightAtXYZ(float x, float y, float z);
|
||||
|
||||
|
||||
@@ -119,10 +119,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return m_terrainData;
|
||||
}
|
||||
|
||||
// ITerrainChannel.GetFloatsSerialized()
|
||||
// This one dimensional version is ordered so height = map[y*sizeX+x];
|
||||
// DEPRECATED: don't use this function as it does not retain the dimensions of the terrain
|
||||
// and the caller will probably do the wrong thing if the terrain is not the legacy 256x256.
|
||||
public float[] GetFloatsSerialised()
|
||||
{
|
||||
return m_terrainData.GetFloatsSerialized();
|
||||
@@ -147,12 +144,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
// ITerrainChannel.this[x,y]
|
||||
public double this[int x, int y]
|
||||
public float this[int x, int y]
|
||||
{
|
||||
get {
|
||||
if (x < 0 || x >= Width || y < 0 || y >= Height)
|
||||
return 0;
|
||||
return (double)m_terrainData[x, y];
|
||||
return m_terrainData[x, y];
|
||||
}
|
||||
set
|
||||
{
|
||||
@@ -492,7 +489,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
float value;
|
||||
value = BitConverter.ToSingle(dataArray, index);
|
||||
index += 4;
|
||||
this[x, y] = (double)value;
|
||||
this[x, y] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user