aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMichael Cerquoni2015-05-04 16:23:16 -0400
committerMichael Cerquoni2015-05-04 16:23:16 -0400
commit44b8b9fef625f6f562a7d8cb0531bd518f11d037 (patch)
tree97b866cfac2ec6b6aee10bf563d5d780a946fbaf
parentfix a minor whitespace issue (diff)
downloadopensim-SC-44b8b9fef625f6f562a7d8cb0531bd518f11d037.zip
opensim-SC-44b8b9fef625f6f562a7d8cb0531bd518f11d037.tar.gz
opensim-SC-44b8b9fef625f6f562a7d8cb0531bd518f11d037.tar.bz2
opensim-SC-44b8b9fef625f6f562a7d8cb0531bd518f11d037.tar.xz
Revert "Patch llCastRay fully-simplified to V2." for further review.
This reverts commit c96ee68953eb31fc2ad6d1df9b7a4bb19c584e17.
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs29
-rw-r--r--bin/OpenSimDefaults.ini16
2 files changed, 22 insertions, 23 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;
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index 4e1b7ca..275c207 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -1397,6 +1397,11 @@
1397 ; Maximum number of external urls that scripts can set up in this simulator (e.g. via llRequestURL()) 1397 ; Maximum number of external urls that scripts can set up in this simulator (e.g. via llRequestURL())
1398 max_external_urls_per_simulator = 100 1398 max_external_urls_per_simulator = 100
1399 1399
1400 ; Use version 1 of llCastRay as default if true. If set to false, the new
1401 ; version of llCastRay will be used. This gives better accuracy but
1402 ; uses more CPU and may may be slow on some servers
1403 UseLlCastRayV1 = true
1404
1400 ; Use size boxes instead of meshed prims, sculpts and mesh when calculating bounding boxes. 1405 ; Use size boxes instead of meshed prims, sculpts and mesh when calculating bounding boxes.
1401 ; Speeds up calculations but can make them inaccurate, in some cases very inaccurate. 1406 ; Speeds up calculations but can make them inaccurate, in some cases very inaccurate.
1402 UseSimpleBoxesInGetBoundingBox = false 1407 UseSimpleBoxesInGetBoundingBox = false
@@ -1489,14 +1494,6 @@
1489 ; Worst case is twisted tube, 0.5+sqrt(1.25) 1494 ; Worst case is twisted tube, 0.5+sqrt(1.25)
1490 PrimBoundingBoxSafetyCoefficientZ = 1.618034 1495 PrimBoundingBoxSafetyCoefficientZ = 1.618034
1491 1496
1492 ; Use new version 2 of llCastRay as default if true
1493 ; This gives better accuracy and speed on some servers, but may be slower on other servers
1494 UseLlCastRayV2 = false
1495
1496 ; Irregular bit flag to use after RC_DATA_FLAGS in calls to llCastRay to use version 2
1497 ; Bit flags RC_GET_NORMAL = 1, RC_GET_ROOT_KEY = 2 and RC_GET_LINK_NUM = 4 are already in regular use
1498 RC_USE_V2 = 512
1499
1500 ; Accepted calculation precision error in calculations in llCastRay 1497 ; Accepted calculation precision error in calculations in llCastRay
1501 FloatToleranceInLlCastRay = 0.000001 1498 FloatToleranceInLlCastRay = 0.000001
1502 1499
@@ -1521,6 +1518,9 @@
1521 ; Detect attachments in llCastRay if true 1518 ; Detect attachments in llCastRay if true
1522 DoAttachmentsInLlCastRay = false 1519 DoAttachmentsInLlCastRay = false
1523 1520
1521 ; Use legacy version 1 of llCastRay if true
1522 UseLlCastRayV1 = true
1523
1524[DataSnapshot] 1524[DataSnapshot]
1525 ; The following set of configs pertains to search. 1525 ; The following set of configs pertains to search.
1526 ; Set index_sims to true to enable search engines to index your searchable data 1526 ; Set index_sims to true to enable search engines to index your searchable data