aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authorMichael Cerquoni2015-05-04 16:23:16 -0400
committerMichael Cerquoni2015-05-04 16:23:16 -0400
commit44b8b9fef625f6f562a7d8cb0531bd518f11d037 (patch)
tree97b866cfac2ec6b6aee10bf563d5d780a946fbaf /OpenSim/Region/ScriptEngine
parentfix a minor whitespace issue (diff)
downloadopensim-SC_OLD-44b8b9fef625f6f562a7d8cb0531bd518f11d037.zip
opensim-SC_OLD-44b8b9fef625f6f562a7d8cb0531bd518f11d037.tar.gz
opensim-SC_OLD-44b8b9fef625f6f562a7d8cb0531bd518f11d037.tar.bz2
opensim-SC_OLD-44b8b9fef625f6f562a7d8cb0531bd518f11d037.tar.xz
Revert "Patch llCastRay fully-simplified to V2." for further review.
This reverts commit c96ee68953eb31fc2ad6d1df9b7a4bb19c584e17.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs29
1 files changed, 14 insertions, 15 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 25f1958..c90f015 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -221,8 +221,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
221 protected float m_primSafetyCoeffX = 2.414214f; 221 protected float m_primSafetyCoeffX = 2.414214f;
222 protected float m_primSafetyCoeffY = 2.414214f; 222 protected float m_primSafetyCoeffY = 2.414214f;
223 protected float m_primSafetyCoeffZ = 1.618034f; 223 protected float m_primSafetyCoeffZ = 1.618034f;
224 protected bool m_useCastRayV2 = false;
225 protected int RC_USE_V2 = 512;
226 protected float m_floatToleranceInCastRay = 0.000001f; 224 protected float m_floatToleranceInCastRay = 0.000001f;
227 protected float m_floatTolerance2InCastRay = 0.0001f; 225 protected float m_floatTolerance2InCastRay = 0.0001f;
228 protected int m_maxHitsInCastRay = 16; 226 protected int m_maxHitsInCastRay = 16;
@@ -231,6 +229,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
231 protected bool m_detectExitsInCastRay = false; 229 protected bool m_detectExitsInCastRay = false;
232 protected bool m_filterPartsInCastRay = false; 230 protected bool m_filterPartsInCastRay = false;
233 protected bool m_doAttachmentsInCastRay = false; 231 protected bool m_doAttachmentsInCastRay = false;
232 protected bool m_useCastRayV1 = true;
234 233
235 //An array of HTTP/1.1 headers that are not allowed to be used 234 //An array of HTTP/1.1 headers that are not allowed to be used
236 //as custom headers by llHTTPRequest. 235 //as custom headers by llHTTPRequest.
@@ -337,8 +336,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
337 m_primSafetyCoeffX = lslConfig.GetFloat("PrimBoundingBoxSafetyCoefficientX", m_primSafetyCoeffX); 336 m_primSafetyCoeffX = lslConfig.GetFloat("PrimBoundingBoxSafetyCoefficientX", m_primSafetyCoeffX);
338 m_primSafetyCoeffY = lslConfig.GetFloat("PrimBoundingBoxSafetyCoefficientY", m_primSafetyCoeffY); 337 m_primSafetyCoeffY = lslConfig.GetFloat("PrimBoundingBoxSafetyCoefficientY", m_primSafetyCoeffY);
339 m_primSafetyCoeffZ = lslConfig.GetFloat("PrimBoundingBoxSafetyCoefficientZ", m_primSafetyCoeffZ); 338 m_primSafetyCoeffZ = lslConfig.GetFloat("PrimBoundingBoxSafetyCoefficientZ", m_primSafetyCoeffZ);
340 m_useCastRayV2 = lslConfig.GetBoolean("UseLlCastRayV2", m_useCastRayV2);
341 RC_USE_V2 = lslConfig.GetInt("RC_USE_V2", RC_USE_V2);
342 m_floatToleranceInCastRay = lslConfig.GetFloat("FloatToleranceInLlCastRay", m_floatToleranceInCastRay); 339 m_floatToleranceInCastRay = lslConfig.GetFloat("FloatToleranceInLlCastRay", m_floatToleranceInCastRay);
343 m_floatTolerance2InCastRay = lslConfig.GetFloat("FloatTolerance2InLlCastRay", m_floatTolerance2InCastRay); 340 m_floatTolerance2InCastRay = lslConfig.GetFloat("FloatTolerance2InLlCastRay", m_floatTolerance2InCastRay);
344 m_maxHitsInCastRay = lslConfig.GetInt("MaxHitsInLlCastRay", m_maxHitsInCastRay); 341 m_maxHitsInCastRay = lslConfig.GetInt("MaxHitsInLlCastRay", m_maxHitsInCastRay);
@@ -347,6 +344,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
347 m_detectExitsInCastRay = lslConfig.GetBoolean("DetectExitHitsInLlCastRay", m_detectExitsInCastRay); 344 m_detectExitsInCastRay = lslConfig.GetBoolean("DetectExitHitsInLlCastRay", m_detectExitsInCastRay);
348 m_filterPartsInCastRay = lslConfig.GetBoolean("FilterPartsInLlCastRay", m_filterPartsInCastRay); 345 m_filterPartsInCastRay = lslConfig.GetBoolean("FilterPartsInLlCastRay", m_filterPartsInCastRay);
349 m_doAttachmentsInCastRay = lslConfig.GetBoolean("DoAttachmentsInLlCastRay", m_doAttachmentsInCastRay); 346 m_doAttachmentsInCastRay = lslConfig.GetBoolean("DoAttachmentsInLlCastRay", m_doAttachmentsInCastRay);
347 m_useCastRayV1 = lslConfig.GetBoolean("UseLlCastRayV1", m_useCastRayV1);
350 } 348 }
351 349
352 IConfig smtpConfig = seConfigSource.Configs["SMTP"]; 350 IConfig smtpConfig = seConfigSource.Configs["SMTP"];
@@ -13813,7 +13811,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
13813 return contacts[0]; 13811 return contacts[0];
13814 } 13812 }
13815 13813
13816 public LSL_List llCastRay(LSL_Vector start, LSL_Vector end, LSL_List options) 13814 public LSL_List llCastRayV1(LSL_Vector start, LSL_Vector end, LSL_List options)
13817 { 13815 {
13818 LSL_List list = new LSL_List(); 13816 LSL_List list = new LSL_List();
13819 13817
@@ -13842,10 +13840,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
13842 rejectTypes = options.GetLSLIntegerItem(i + 1); 13840 rejectTypes = options.GetLSLIntegerItem(i + 1);
13843 } 13841 }
13844 13842
13845 // Use llCastRay v2 if configured or requested
13846 if (m_useCastRayV2 || (dataFlags & RC_USE_V2) == RC_USE_V2)
13847 return llCastRayV2(start, end, options);
13848
13849 if (count > 16) 13843 if (count > 16)
13850 count = 16; 13844 count = 16;
13851 13845
@@ -14009,20 +14003,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
14009 } 14003 }
14010 14004
14011 /// <summary> 14005 /// <summary>
14012 /// Implementation of llCastRay similar to SL 2015-04-21. 14006 /// Full implementation of llCastRay similar to SL 2015-04-21.
14013 /// http://wiki.secondlife.com/wiki/LlCastRay 14007 /// http://wiki.secondlife.com/wiki/LlCastRay
14014 /// Uses pure geometry, bounding shapes, meshing and no physics 14008 /// Uses pure geometry, bounding shapes, meshing and no physics
14015 /// for prims, sculpts, meshes, avatars and terrain. 14009 /// for prims, sculpts, meshes, avatars and terrain.
14016 /// Implements all flags, reject types and data flags. 14010 /// Implements all flags, reject types and data flags.
14017 /// Can handle both objects/groups and prims/parts, by config. 14011 /// Can handle both objects/groups and prims/parts, by config.
14012 /// May give poor results with multi-part meshes where "root"
14013 /// part doesn't dominate, owing to "guessed" bounding boxes.
14018 /// May sometimes be inaccurate owing to calculation precision 14014 /// May sometimes be inaccurate owing to calculation precision
14019 /// and a bug in libopenmetaverse PrimMesher. 14015 /// and a bug in libopenmetaverse PrimMesher.
14020 /// </summary> 14016 /// </summary>
14021 public LSL_List llCastRayV2(LSL_Vector start, LSL_Vector end, LSL_List options) 14017 public LSL_List llCastRay(LSL_Vector start, LSL_Vector end, LSL_List options)
14022 { 14018 {
14019 // Use llCastRay v1 if configured
14020 if (m_useCastRayV1)
14021 return llCastRayV1(start, end, options);
14022
14023 // Initialize 14023 // Initialize
14024 // Keep AddScriptLPS commented while called from llCastRay 14024 m_host.AddScriptLPS(1);
14025 // m_host.AddScriptLPS(1);
14026 List<RayHit> rayHits = new List<RayHit>(); 14025 List<RayHit> rayHits = new List<RayHit>();
14027 LSL_List result = new LSL_List(); 14026 LSL_List result = new LSL_List();
14028 float tol = m_floatToleranceInCastRay; 14027 float tol = m_floatToleranceInCastRay;
@@ -14058,10 +14057,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
14058 Vector3 ray = end - start; 14057 Vector3 ray = end - start;
14059 float rayLength = ray.Length(); 14058 float rayLength = ray.Length();
14060 14059
14061 // Try to get a mesher and return failure if none, degenerate ray, or max 0 hits 14060 // Try to get a mesher and return failure if none or degenerate ray
14062 IRendering primMesher = null; 14061 IRendering primMesher = null;
14063 List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory()); 14062 List<string> renderers = RenderingLoader.ListRenderers(Util.ExecutingDirectory());
14064 if (renderers.Count < 1 || rayLength < tol || m_maxHitsInCastRay < 1) 14063 if (renderers.Count < 1 || rayLength < tol)
14065 { 14064 {
14066 result.Add(new LSL_Integer(ScriptBaseClass.RCERR_UNKNOWN)); 14065 result.Add(new LSL_Integer(ScriptBaseClass.RCERR_UNKNOWN));
14067 return result; 14066 return result;