diff options
author | Robert Adams | 2013-03-28 10:56:21 -0700 |
---|---|---|
committer | Robert Adams | 2013-03-28 10:59:18 -0700 |
commit | 6a9630d2bdc27ed702936f4c44e6978f728a9ef0 (patch) | |
tree | 0f5a4a00d4108d3e1015fb9a36a0bbb456545668 /OpenSim/Region/Physics/BulletSPlugin/BSMaterials.cs | |
parent | BulletSim: tweaks to terrain boundry computation. No functional changes. (diff) | |
download | opensim-SC-6a9630d2bdc27ed702936f4c44e6978f728a9ef0.zip opensim-SC-6a9630d2bdc27ed702936f4c44e6978f728a9ef0.tar.gz opensim-SC-6a9630d2bdc27ed702936f4c44e6978f728a9ef0.tar.bz2 opensim-SC-6a9630d2bdc27ed702936f4c44e6978f728a9ef0.tar.xz |
BulletSim: fix race condition when creating very large mega-regions.
The symptom was exceptions while creating physical terrain.
Reduce default terrain mesh magnification to 2 from 3 because the
higher resolution uses a lot of memory and doesn't solve the terrain
smoothness for vehicles.
Added comments here and there and improved some debugging log messages.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSMaterials.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSMaterials.cs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSMaterials.cs b/OpenSim/Region/Physics/BulletSPlugin/BSMaterials.cs index 92d62ff..ee77d6e 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSMaterials.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSMaterials.cs | |||
@@ -180,11 +180,14 @@ public static class BSMaterials | |||
180 | // Use reflection to set the value in the attribute structure. | 180 | // Use reflection to set the value in the attribute structure. |
181 | private static void SetAttributeValue(int matType, string attribName, float val) | 181 | private static void SetAttributeValue(int matType, string attribName, float val) |
182 | { | 182 | { |
183 | // Get the current attribute values for this material | ||
183 | MaterialAttributes thisAttrib = Attributes[matType]; | 184 | MaterialAttributes thisAttrib = Attributes[matType]; |
185 | // Find the field for the passed attribute name (eg, find field named 'friction') | ||
184 | FieldInfo fieldInfo = thisAttrib.GetType().GetField(attribName.ToLower()); | 186 | FieldInfo fieldInfo = thisAttrib.GetType().GetField(attribName.ToLower()); |
185 | if (fieldInfo != null) | 187 | if (fieldInfo != null) |
186 | { | 188 | { |
187 | fieldInfo.SetValue(thisAttrib, val); | 189 | fieldInfo.SetValue(thisAttrib, val); |
190 | // Copy new attributes back to array -- since MaterialAttributes is 'struct', passed by value, not reference. | ||
188 | Attributes[matType] = thisAttrib; | 191 | Attributes[matType] = thisAttrib; |
189 | } | 192 | } |
190 | } | 193 | } |