mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
varregion: refactor use of 'double heightmap[,]' into references to new class TerrainData
and push the implementation from Scene into the database readers and writers.
This commit is contained in:
@@ -68,13 +68,22 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// </summary>
|
||||
/// <param name="ter">HeightField data</param>
|
||||
/// <param name="regionID">region UUID</param>
|
||||
void StoreTerrain(TerrainData terrain, UUID regionID);
|
||||
|
||||
// Legacy version kept for downward compabibility
|
||||
void StoreTerrain(double[,] terrain, UUID regionID);
|
||||
|
||||
/// <summary>
|
||||
/// Load the latest terrain revision from region storage
|
||||
/// </summary>
|
||||
/// <param name="regionID">the region UUID</param>
|
||||
/// <param name="sizeX">the X dimension of the region being filled</param>
|
||||
/// <param name="sizeY">the Y dimension of the region being filled</param>
|
||||
/// <param name="sizeZ">the Z dimension of the region being filled</param>
|
||||
/// <returns>Heightfield data</returns>
|
||||
TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ);
|
||||
|
||||
// Legacy version kept for downward compabibility
|
||||
double[,] LoadTerrain(UUID regionID);
|
||||
|
||||
void StoreLandObject(ILandObject Parcel);
|
||||
|
||||
@@ -79,13 +79,22 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// </summary>
|
||||
/// <param name="ter">HeightField data</param>
|
||||
/// <param name="regionID">region UUID</param>
|
||||
void StoreTerrain(TerrainData terrain, UUID regionID);
|
||||
|
||||
// Legacy version kept for downward compabibility
|
||||
void StoreTerrain(double[,] terrain, UUID regionID);
|
||||
|
||||
/// <summary>
|
||||
/// Load the latest terrain revision from region storage
|
||||
/// </summary>
|
||||
/// <param name="regionID">the region UUID</param>
|
||||
/// <param name="pSizeX">the X dimension of the terrain being filled</param>
|
||||
/// <param name="pSizeY">the Y dimension of the terrain being filled</param>
|
||||
/// <param name="pSizeZ">the Z dimension of the terrain being filled</param>
|
||||
/// <returns>Heightfield data</returns>
|
||||
TerrainData LoadTerrain(UUID regionID, int pSizeX, int pSizeY, int pSizeZ);
|
||||
|
||||
// Legacy version kept for downward compabibility
|
||||
double[,] LoadTerrain(UUID regionID);
|
||||
|
||||
void StoreLandObject(ILandObject Parcel);
|
||||
@@ -136,4 +145,5 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
|
||||
void Shutdown();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,13 +25,23 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using OpenSim.Framework;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.Framework.Interfaces
|
||||
{
|
||||
public interface ITerrainChannel
|
||||
{
|
||||
int Height { get; }
|
||||
int Width { get;} // X dimension
|
||||
int Height { get;} // Y dimension
|
||||
int Altitude { get;} // Z dimension
|
||||
|
||||
double this[int x, int y] { get; set; }
|
||||
int Width { get; }
|
||||
|
||||
float GetHeightAtXYZ(float x, float y, float z);
|
||||
|
||||
// Return the packaged terrain data for passing into lower levels of communication
|
||||
TerrainData GetTerrainData();
|
||||
|
||||
/// <summary>
|
||||
/// Squash the entire heightmap into a single dimensioned array
|
||||
@@ -40,9 +50,14 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
float[] GetFloatsSerialised();
|
||||
|
||||
double[,] GetDoubles();
|
||||
|
||||
// Check if a location has been updated. Clears the taint flag as a side effect.
|
||||
bool Tainted(int x, int y);
|
||||
|
||||
ITerrainChannel MakeCopy();
|
||||
string SaveToXmlString();
|
||||
void LoadFromXmlString(string data);
|
||||
// Merge some terrain into this channel
|
||||
void Merge(ITerrainChannel newTerrain, Vector3 displacement, float radianRotation, Vector2 rotationDisplacement);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user