diff options
author | UbitUmarov | 2019-01-25 20:52:46 +0000 |
---|---|---|
committer | UbitUmarov | 2019-01-25 20:52:46 +0000 |
commit | 80487467594379f65f7e5358a43789a8e6c5648b (patch) | |
tree | 3de7ae8855306da27a7c1c2c496c656a01de95d9 /OpenSim/Region/ScriptEngine/Shared | |
parent | cleanup dead code (diff) | |
download | opensim-SC-80487467594379f65f7e5358a43789a8e6c5648b.zip opensim-SC-80487467594379f65f7e5358a43789a8e6c5648b.tar.gz opensim-SC-80487467594379f65f7e5358a43789a8e6c5648b.tar.bz2 opensim-SC-80487467594379f65f7e5358a43789a8e6c5648b.tar.xz |
changes on sog boundingbox and other cleanup
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 59 |
1 files changed, 21 insertions, 38 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6f3c7e9..943141c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -11240,50 +11240,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11240 | } | 11240 | } |
11241 | 11241 | ||
11242 | part = World.GetSceneObjectPart(objID); | 11242 | part = World.GetSceneObjectPart(objID); |
11243 | |||
11243 | // Currently only works for single prims without a sitting avatar | 11244 | // Currently only works for single prims without a sitting avatar |
11244 | if (part != null) | 11245 | if (part == null) |
11245 | { | 11246 | { |
11246 | float minX; | 11247 | result.Add(new LSL_Vector()); |
11247 | float maxX; | 11248 | result.Add(new LSL_Vector()); |
11248 | float minY; | 11249 | return result; |
11249 | float maxY; | 11250 | } |
11250 | float minZ; | ||
11251 | float maxZ; | ||
11252 | |||
11253 | // This BBox is in sim coordinates, with the offset being | ||
11254 | // a contained point. | ||
11255 | Vector3[] offsets = Scene.GetCombinedBoundingBox(new List<SceneObjectGroup> { part.ParentGroup }, | ||
11256 | out minX, out maxX, out minY, out maxY, out minZ, out maxZ); | ||
11257 | |||
11258 | minX -= offsets[0].X; | ||
11259 | maxX -= offsets[0].X; | ||
11260 | minY -= offsets[0].Y; | ||
11261 | maxY -= offsets[0].Y; | ||
11262 | minZ -= offsets[0].Z; | ||
11263 | maxZ -= offsets[0].Z; | ||
11264 | |||
11265 | LSL_Vector lower; | ||
11266 | LSL_Vector upper; | ||
11267 | |||
11268 | // Adjust to the documented error offsets (see LSL Wiki) | ||
11269 | lower = new LSL_Vector(minX + 0.05f, minY + 0.05f, minZ + 0.05f); | ||
11270 | upper = new LSL_Vector(maxX - 0.05f, maxY - 0.05f, maxZ - 0.05f); | ||
11271 | |||
11272 | if (lower.x > upper.x) | ||
11273 | lower.x = upper.x; | ||
11274 | if (lower.y > upper.y) | ||
11275 | lower.y = upper.y; | ||
11276 | if (lower.z > upper.z) | ||
11277 | lower.z = upper.z; | ||
11278 | 11251 | ||
11279 | result.Add(lower); | 11252 | SceneObjectGroup sog = part.ParentGroup; |
11280 | result.Add(upper); | 11253 | if(sog.IsDeleted) |
11254 | { | ||
11255 | result.Add(new LSL_Vector()); | ||
11256 | result.Add(new LSL_Vector()); | ||
11281 | return result; | 11257 | return result; |
11282 | } | 11258 | } |
11283 | 11259 | ||
11284 | // Not found so return empty values | 11260 | float minX; |
11285 | result.Add(new LSL_Vector()); | 11261 | float maxX; |
11286 | result.Add(new LSL_Vector()); | 11262 | float minY; |
11263 | float maxY; | ||
11264 | float minZ; | ||
11265 | float maxZ; | ||
11266 | sog.GetBoundingBox(out minX, out maxX, out minY, out maxY, out minZ, out maxZ); | ||
11267 | |||
11268 | result.Add(new LSL_Vector(minX, minY, minZ)); | ||
11269 | result.Add(new LSL_Vector(maxX, maxY, maxZ)); | ||
11287 | return result; | 11270 | return result; |
11288 | } | 11271 | } |
11289 | 11272 | ||