From b23e5fd8b6d1cc01eddaf08fde646551a8e2c984 Mon Sep 17 00:00:00 2001 From: Jak Daniels Date: Wed, 18 Nov 2015 18:02:13 +0000 Subject: Changes to LandObject/ILandObject to support importing OARs with different Region sizes to the destination region. Signed-off-by: UbitUmarov --- OpenSim/Framework/ILandObject.cs | 47 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/ILandObject.cs b/OpenSim/Framework/ILandObject.cs index db1496c..ef7a9e6 100644 --- a/OpenSim/Framework/ILandObject.cs +++ b/OpenSim/Framework/ILandObject.cs @@ -97,20 +97,63 @@ namespace OpenSim.Framework /// /// Land co-ordinates are zero indexed. The inputs are treated as points. So if you want to create a bitmap /// that covers an entire 256 x 256m region apart from a strip of land on the east, then you would need to - /// specify start_x = 0, start_y = 0, end_x = 252 (or anything up to 255), end_y = 256. + /// specify start_x = 0, start_y = 0, end_x = 252 (or anything up to 255), end_y = 255. /// /// At the moment, the smallest parcel of land is 4m x 4m, so if the /// region is 256 x 256m (the SL size), the bitmap returned will start at (0,0) and end at (63,63). + /// The value of the set_value needs to be true to define an active parcel of the given size. /// /// /// /// /// + /// /// The bitmap created. - bool[,] GetSquareLandBitmap(int start_x, int start_y, int end_x, int end_y); + bool[,] GetSquareLandBitmap(int start_x, int start_y, int end_x, int end_y, bool set_value = true); bool[,] ModifyLandBitmapSquare(bool[,] land_bitmap, int start_x, int start_y, int end_x, int end_y, bool set_value); + + /// + /// Merge two (same size) land bitmaps. + /// + /// + /// + /// The modified bitmap. bool[,] MergeLandBitmaps(bool[,] bitmap_base, bool[,] bitmap_add); + + /// + /// Remap a land bitmap. Takes the supplied land bitmap and rotates it, crops it and finally offsets it into + /// a final land bitmap of the target region size. + /// + /// The original parcel bitmap + /// + /// <x,y,?> + /// <x,y,?> + /// <x,y,?> + /// <x,y,?> + /// out: This is set if the resultant bitmap is now empty + /// out: parcel.AABBMin <x,y,0> + /// out: parcel.AABBMax <x,y,0> + /// New parcel bitmap + bool[,] RemapLandBitmap(bool[,] bitmap_base, Vector2 displacement, float rotationDegrees, Vector2 boundingOrigin, Vector2 boundingSize, Vector2 regionSize, out bool isEmptyNow, out Vector3 AABBMin, out Vector3 AABBMax); + + /// + /// Clears any parcel data in bitmap_base where there exists parcel data in bitmap_new. In other words the parcel data + /// in bitmap_new takes over the space of the parcel data in bitmap_base. + /// + /// + /// + /// out: This is set if the resultant bitmap is now empty + /// out: parcel.AABBMin <x,y,0> + /// out: parcel.AABBMax <x,y,0> + /// New parcel bitmap + bool[,] RemoveFromLandBitmap(bool[,] bitmap_base, bool[,] bitmap_new, out bool isEmptyNow, out Vector3 AABBMin, out Vector3 AABBMax); + + byte[] ConvertLandBitmapToBytes(); + bool[,] ConvertBytesToLandBitmap(bool overrideRegionSize = false); + bool IsLandBitmapEmpty(bool[,] landBitmap); + void DebugLandBitmap(bool[,] landBitmap); + void SendForceObjectSelect(int local_id, int request_type, List returnIDs, IClientAPI remote_client); void SendLandObjectOwners(IClientAPI remote_client); void ReturnLandObjects(uint type, UUID[] owners, UUID[] tasks, IClientAPI remote_client); -- cgit v1.1