aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs54
-rw-r--r--OpenSim/Region/DataSnapshot/DataSnapshotManager.cs34
-rw-r--r--OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs3
-rw-r--r--OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs3
-rw-r--r--OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs5
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs4
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSParam.cs20
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs47
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt7
10 files changed, 122 insertions, 59 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 7361f50..7497d88 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -138,6 +138,10 @@ namespace OpenSim
138 /// <param name="configSource"></param> 138 /// <param name="configSource"></param>
139 public OpenSimBase(IConfigSource configSource) : base() 139 public OpenSimBase(IConfigSource configSource) : base()
140 { 140 {
141 // FIXME: This should be done down in ServerBase but we need to sort out and refactor the log4net
142 // XmlConfigurator calls first accross servers.
143 m_log.InfoFormat("[SERVER BASE]: Starting in {0}", m_startupDirectory);
144
141 LoadConfigSettings(configSource); 145 LoadConfigSettings(configSource);
142 } 146 }
143 147
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index ddaa227..121fb2a 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -156,9 +156,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
156 156
157 public void Initialise(IConfigSource config) 157 public void Initialise(IConfigSource config)
158 { 158 {
159 IConfig myConfig = config.Configs["Startup"]; 159 string permissionModules = Util.GetConfigVarFromSections<string>(config, "permissionmodules",
160 160 new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule");
161 string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule");
162 161
163 List<string> modules = new List<string>(permissionModules.Split(',')); 162 List<string> modules = new List<string>(permissionModules.Split(','));
164 163
@@ -167,26 +166,34 @@ namespace OpenSim.Region.CoreModules.World.Permissions
167 166
168 m_Enabled = true; 167 m_Enabled = true;
169 168
170 m_allowGridGods = myConfig.GetBoolean("allow_grid_gods", false); 169 m_allowGridGods = Util.GetConfigVarFromSections<bool>(config, "allow_grid_gods",
171 m_bypassPermissions = !myConfig.GetBoolean("serverside_object_permissions", true); 170 new string[] { "Startup", "Permissions" }, false);
172 m_propagatePermissions = myConfig.GetBoolean("propagate_permissions", true); 171 m_bypassPermissions = !Util.GetConfigVarFromSections<bool>(config, "serverside_object_permissions",
173 m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); 172 new string[] { "Startup", "Permissions" }, true);
174 m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false); 173 m_propagatePermissions = Util.GetConfigVarFromSections<bool>(config, "propagate_permissions",
175 m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); 174 new string[] { "Startup", "Permissions" }, true);
176 175 m_RegionOwnerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_owner_is_god",
177 m_SimpleBuildPermissions = myConfig.GetBoolean("simple_build_permissions", false); 176 new string[] { "Startup", "Permissions" }, true);
177 m_RegionManagerIsGod = Util.GetConfigVarFromSections<bool>(config, "region_manager_is_god",
178 new string[] { "Startup", "Permissions" }, false);
179 m_ParcelOwnerIsGod = Util.GetConfigVarFromSections<bool>(config, "parcel_owner_is_god",
180 new string[] { "Startup", "Permissions" }, true);
181
182 m_SimpleBuildPermissions = Util.GetConfigVarFromSections<bool>(config, "simple_build_permissions",
183 new string[] { "Startup", "Permissions" }, false);
178 184
179 m_allowedScriptCreators 185 m_allowedScriptCreators
180 = ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators); 186 = ParseUserSetConfigSetting(config, "allowed_script_creators", m_allowedScriptCreators);
181 m_allowedScriptEditors 187 m_allowedScriptEditors
182 = ParseUserSetConfigSetting(myConfig, "allowed_script_editors", m_allowedScriptEditors); 188 = ParseUserSetConfigSetting(config, "allowed_script_editors", m_allowedScriptEditors);
183 189
184 if (m_bypassPermissions) 190 if (m_bypassPermissions)
185 m_log.Info("[PERMISSIONS]: serverside_object_permissions = false in ini file so disabling all region service permission checks"); 191 m_log.Info("[PERMISSIONS]: serverside_object_permissions = false in ini file so disabling all region service permission checks");
186 else 192 else
187 m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks"); 193 m_log.Debug("[PERMISSIONS]: Enabling all region service permission checks");
188 194
189 string grant = myConfig.GetString("GrantLSL", ""); 195 string grant = Util.GetConfigVarFromSections<string>(config, "GrantLSL",
196 new string[] { "Startup", "Permissions" }, string.Empty);
190 if (grant.Length > 0) 197 if (grant.Length > 0)
191 { 198 {
192 foreach (string uuidl in grant.Split(',')) 199 foreach (string uuidl in grant.Split(','))
@@ -196,7 +203,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
196 } 203 }
197 } 204 }
198 205
199 grant = myConfig.GetString("GrantCS", ""); 206 grant = Util.GetConfigVarFromSections<string>(config, "GrantCS",
207 new string[] { "Startup", "Permissions" }, string.Empty);
200 if (grant.Length > 0) 208 if (grant.Length > 0)
201 { 209 {
202 foreach (string uuidl in grant.Split(',')) 210 foreach (string uuidl in grant.Split(','))
@@ -206,7 +214,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
206 } 214 }
207 } 215 }
208 216
209 grant = myConfig.GetString("GrantVB", ""); 217 grant = Util.GetConfigVarFromSections<string>(config, "GrantVB",
218 new string[] { "Startup", "Permissions" }, string.Empty);
210 if (grant.Length > 0) 219 if (grant.Length > 0)
211 { 220 {
212 foreach (string uuidl in grant.Split(',')) 221 foreach (string uuidl in grant.Split(','))
@@ -216,7 +225,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
216 } 225 }
217 } 226 }
218 227
219 grant = myConfig.GetString("GrantJS", ""); 228 grant = Util.GetConfigVarFromSections<string>(config, "GrantJS",
229 new string[] { "Startup", "Permissions" }, string.Empty);
220 if (grant.Length > 0) 230 if (grant.Length > 0)
221 { 231 {
222 foreach (string uuidl in grant.Split(',')) 232 foreach (string uuidl in grant.Split(','))
@@ -226,7 +236,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions
226 } 236 }
227 } 237 }
228 238
229 grant = myConfig.GetString("GrantYP", ""); 239 grant = Util.GetConfigVarFromSections<string>(config, "GrantYP",
240 new string[] { "Startup", "Permissions" }, string.Empty);
230 if (grant.Length > 0) 241 if (grant.Length > 0)
231 { 242 {
232 foreach (string uuidl in grant.Split(',')) 243 foreach (string uuidl in grant.Split(','))
@@ -464,11 +475,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
464 /// <param name="settingName"></param> 475 /// <param name="settingName"></param>
465 /// <param name="defaultValue">The default value for this attribute</param> 476 /// <param name="defaultValue">The default value for this attribute</param>
466 /// <returns>The parsed value</returns> 477 /// <returns>The parsed value</returns>
467 private static UserSet ParseUserSetConfigSetting(IConfig config, string settingName, UserSet defaultValue) 478 private static UserSet ParseUserSetConfigSetting(IConfigSource config, string settingName, UserSet defaultValue)
468 { 479 {
469 UserSet userSet = defaultValue; 480 UserSet userSet = defaultValue;
470 481
471 string rawSetting = config.GetString(settingName, defaultValue.ToString()); 482 string rawSetting = Util.GetConfigVarFromSections<string>(config, settingName,
483 new string[] {"Startup", "Permissions"}, defaultValue.ToString());
472 484
473 // Temporary measure to allow 'gods' to be specified in config for consistency's sake. In the long term 485 // Temporary measure to allow 'gods' to be specified in config for consistency's sake. In the long term
474 // this should disappear. 486 // this should disappear.
diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
index 32017a8..dd48dd5 100644
--- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
+++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
@@ -148,8 +148,6 @@ namespace OpenSim.Region.DataSnapshot
148 return; 148 return;
149 } 149 }
150 150
151 if (m_enabled)
152 m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname);
153 } 151 }
154 152
155 } 153 }
@@ -163,8 +161,22 @@ namespace OpenSim.Region.DataSnapshot
163 161
164 m_log.DebugFormat("[DATASNAPSHOT]: Module added to Scene {0}.", scene.RegionInfo.RegionName); 162 m_log.DebugFormat("[DATASNAPSHOT]: Module added to Scene {0}.", scene.RegionInfo.RegionName);
165 163
166 m_snapStore.AddScene(scene); 164 if (!m_servicesNotified)
165 {
166 m_hostname = scene.RegionInfo.ExternalHostName;
167 m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname);
168
169 //Hand it the first scene, assuming that all scenes have the same BaseHTTPServer
170 new DataRequestHandler(scene, this);
171
172 if (m_dataServices != "" && m_dataServices != "noservices")
173 NotifyDataServices(m_dataServices, "online");
174
175 m_servicesNotified = true;
176 }
177
167 m_scenes.Add(scene); 178 m_scenes.Add(scene);
179 m_snapStore.AddScene(scene);
168 180
169 Assembly currentasm = Assembly.GetExecutingAssembly(); 181 Assembly currentasm = Assembly.GetExecutingAssembly();
170 182
@@ -189,22 +201,6 @@ namespace OpenSim.Region.DataSnapshot
189 } 201 }
190 } 202 }
191 203
192 // Must be done here because on shared modules, PostInitialise() will run
193 // BEFORE any scenes are registered. There is no "all scenes have been loaded"
194 // kind of callback because scenes may be created dynamically, so we cannot
195 // have that info, ever.
196 if (!m_servicesNotified)
197 {
198 //Hand it the first scene, assuming that all scenes have the same BaseHTTPServer
199 new DataRequestHandler(m_scenes[0], this);
200
201 m_hostname = m_scenes[0].RegionInfo.ExternalHostName;
202
203 if (m_dataServices != "" && m_dataServices != "noservices")
204 NotifyDataServices(m_dataServices, "online");
205
206 m_servicesNotified = true;
207 }
208 } 204 }
209 205
210 public void RemoveRegion(Scene scene) 206 public void RemoveRegion(Scene scene)
diff --git a/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs b/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs
index ad2fc7a..0615036 100644
--- a/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs
+++ b/OpenSim/Region/OptionalModules/Example/BareBonesNonShared/BareBonesNonSharedModule.cs
@@ -33,10 +33,11 @@ using Nini.Config;
33using OpenSim.Region.Framework.Interfaces; 33using OpenSim.Region.Framework.Interfaces;
34using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
35 35
36// You will need to uncomment this line if you are adding a region module to some other assembly which does not already 36// You will need to uncomment these lines if you are adding a region module to some other assembly which does not already
37// specify its assembly. Otherwise, the region modules in the assembly will not be picked up when OpenSimulator scans 37// specify its assembly. Otherwise, the region modules in the assembly will not be picked up when OpenSimulator scans
38// the available DLLs 38// the available DLLs
39//[assembly: Addin("MyModule", "1.0")] 39//[assembly: Addin("MyModule", "1.0")]
40//[assembly: AddinDependency("OpenSim", "0.5")]
40 41
41namespace OpenSim.Region.OptionalModules.Example.BareBonesNonShared 42namespace OpenSim.Region.OptionalModules.Example.BareBonesNonShared
42{ 43{
diff --git a/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs b/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs
index bb9cbb7..811a263 100644
--- a/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs
+++ b/OpenSim/Region/OptionalModules/Example/BareBonesShared/BareBonesSharedModule.cs
@@ -33,10 +33,11 @@ using Nini.Config;
33using OpenSim.Region.Framework.Interfaces; 33using OpenSim.Region.Framework.Interfaces;
34using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
35 35
36// You will need to uncomment this line if you are adding a region module to some other assembly which does not already 36// You will need to uncomment these lines if you are adding a region module to some other assembly which does not already
37// specify its assembly. Otherwise, the region modules in the assembly will not be picked up when OpenSimulator scans 37// specify its assembly. Otherwise, the region modules in the assembly will not be picked up when OpenSimulator scans
38// the available DLLs 38// the available DLLs
39//[assembly: Addin("MyModule", "1.0")] 39//[assembly: Addin("MyModule", "1.0")]
40//[assembly: AddinDependency("OpenSim", "0.5")]
40 41
41namespace OpenSim.Region.OptionalModules.Example.BareBonesShared 42namespace OpenSim.Region.OptionalModules.Example.BareBonesShared
42{ 43{
diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
index 39cabb5..a375da9 100644
--- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
+++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
@@ -57,9 +57,10 @@ namespace OpenSim.Region.OptionalModules
57 57
58 public void Initialise(IConfigSource config) 58 public void Initialise(IConfigSource config)
59 { 59 {
60 IConfig myConfig = config.Configs["Startup"]; 60 //IConfig myConfig = config.Configs["Startup"];
61 61
62 string permissionModules = myConfig.GetString("permissionmodules", "DefaultPermissionsModule"); 62 string permissionModules = Util.GetConfigVarFromSections<string>(config, "permissionmodules",
63 new string[] { "Startup", "Permissions" }, "DefaultPermissionsModule");
63 64
64 List<string> modules=new List<string>(permissionModules.Split(',')); 65 List<string> modules=new List<string>(permissionModules.Split(','));
65 66
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
index e6933f9..235cefc 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs
@@ -961,13 +961,13 @@ namespace OpenSim.Region.Physics.BulletSPlugin
961 // ================================================================== 961 // ==================================================================
962 // Clamp high or low velocities 962 // Clamp high or low velocities
963 float newVelocityLengthSq = VehicleVelocity.LengthSquared(); 963 float newVelocityLengthSq = VehicleVelocity.LengthSquared();
964 if (newVelocityLengthSq > BSParam.VehicleMaxLinearVelocitySq) 964 if (newVelocityLengthSq > BSParam.VehicleMaxLinearVelocitySquared)
965 { 965 {
966 Vector3 origVelW = VehicleVelocity; // DEBUG DEBUG 966 Vector3 origVelW = VehicleVelocity; // DEBUG DEBUG
967 VehicleVelocity /= VehicleVelocity.Length(); 967 VehicleVelocity /= VehicleVelocity.Length();
968 VehicleVelocity *= BSParam.VehicleMaxLinearVelocity; 968 VehicleVelocity *= BSParam.VehicleMaxLinearVelocity;
969 VDetailLog("{0}, MoveLinear,clampMax,origVelW={1},lenSq={2},maxVelSq={3},,newVelW={4}", 969 VDetailLog("{0}, MoveLinear,clampMax,origVelW={1},lenSq={2},maxVelSq={3},,newVelW={4}",
970 Prim.LocalID, origVelW, newVelocityLengthSq, BSParam.VehicleMaxLinearVelocitySq, VehicleVelocity); 970 Prim.LocalID, origVelW, newVelocityLengthSq, BSParam.VehicleMaxLinearVelocitySquared, VehicleVelocity);
971 } 971 }
972 else if (newVelocityLengthSq < 0.001f) 972 else if (newVelocityLengthSq < 0.001f)
973 VehicleVelocity = Vector3.Zero; 973 VehicleVelocity = Vector3.Zero;
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
index dc57b67..fa58109 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
@@ -47,12 +47,16 @@ public static class BSParam
47 public static float SculptLOD { get; private set; } 47 public static float SculptLOD { get; private set; }
48 48
49 public static int CrossingFailuresBeforeOutOfBounds { get; private set; } 49 public static int CrossingFailuresBeforeOutOfBounds { get; private set; }
50 public static float UpdateVelocityChangeThreshold { get; private set; }
50 51
51 public static float MinimumObjectMass { get; private set; } 52 public static float MinimumObjectMass { get; private set; }
52 public static float MaximumObjectMass { get; private set; } 53 public static float MaximumObjectMass { get; private set; }
53 public static float MaxLinearVelocity { get; private set; } 54 public static float MaxLinearVelocity { get; private set; }
55 public static float MaxLinearVelocitySquared { get; private set; }
54 public static float MaxAngularVelocity { get; private set; } 56 public static float MaxAngularVelocity { get; private set; }
57 public static float MaxAngularVelocitySquared { get; private set; }
55 public static float MaxAddForceMagnitude { get; private set; } 58 public static float MaxAddForceMagnitude { get; private set; }
59 public static float MaxAddForceMagnitudeSquared { get; private set; }
56 public static float DensityScaleFactor { get; private set; } 60 public static float DensityScaleFactor { get; private set; }
57 61
58 public static float LinearDamping { get; private set; } 62 public static float LinearDamping { get; private set; }
@@ -109,7 +113,7 @@ public static class BSParam
109 113
110 // Vehicle parameters 114 // Vehicle parameters
111 public static float VehicleMaxLinearVelocity { get; private set; } 115 public static float VehicleMaxLinearVelocity { get; private set; }
112 public static float VehicleMaxLinearVelocitySq { get; private set; } 116 public static float VehicleMaxLinearVelocitySquared { get; private set; }
113 public static float VehicleMaxAngularVelocity { get; private set; } 117 public static float VehicleMaxAngularVelocity { get; private set; }
114 public static float VehicleMaxAngularVelocitySq { get; private set; } 118 public static float VehicleMaxAngularVelocitySq { get; private set; }
115 public static float VehicleAngularDamping { get; private set; } 119 public static float VehicleAngularDamping { get; private set; }
@@ -265,7 +269,7 @@ public static class BSParam
265 // The single letter parameters for the delegates are: 269 // The single letter parameters for the delegates are:
266 // s = BSScene 270 // s = BSScene
267 // o = BSPhysObject 271 // o = BSPhysObject
268 // v = value (float) 272 // v = value (appropriate type)
269 private static ParameterDefnBase[] ParameterDefinitions = 273 private static ParameterDefnBase[] ParameterDefinitions =
270 { 274 {
271 new ParameterDefn<bool>("MeshSculptedPrim", "Whether to create meshes for sculpties", 275 new ParameterDefn<bool>("MeshSculptedPrim", "Whether to create meshes for sculpties",
@@ -289,6 +293,10 @@ public static class BSParam
289 5, 293 5,
290 (s) => { return CrossingFailuresBeforeOutOfBounds; }, 294 (s) => { return CrossingFailuresBeforeOutOfBounds; },
291 (s,v) => { CrossingFailuresBeforeOutOfBounds = v; } ), 295 (s,v) => { CrossingFailuresBeforeOutOfBounds = v; } ),
296 new ParameterDefn<float>("UpdateVelocityChangeThreshold", "Change in updated velocity required before reporting change to simulator",
297 0.1f,
298 (s) => { return UpdateVelocityChangeThreshold; },
299 (s,v) => { UpdateVelocityChangeThreshold = v; } ),
292 300
293 new ParameterDefn<float>("MeshLevelOfDetail", "Level of detail to render meshes (32, 16, 8 or 4. 32=most detailed)", 301 new ParameterDefn<float>("MeshLevelOfDetail", "Level of detail to render meshes (32, 16, 8 or 4. 32=most detailed)",
294 32f, 302 32f,
@@ -343,16 +351,16 @@ public static class BSParam
343 new ParameterDefn<float>("MaxLinearVelocity", "Maximum velocity magnitude that can be assigned to an object", 351 new ParameterDefn<float>("MaxLinearVelocity", "Maximum velocity magnitude that can be assigned to an object",
344 1000.0f, 352 1000.0f,
345 (s) => { return MaxLinearVelocity; }, 353 (s) => { return MaxLinearVelocity; },
346 (s,v) => { MaxLinearVelocity = v; } ), 354 (s,v) => { MaxLinearVelocity = v; MaxLinearVelocitySquared = v * v; } ),
347 new ParameterDefn<float>("MaxAngularVelocity", "Maximum rotational velocity magnitude that can be assigned to an object", 355 new ParameterDefn<float>("MaxAngularVelocity", "Maximum rotational velocity magnitude that can be assigned to an object",
348 1000.0f, 356 1000.0f,
349 (s) => { return MaxAngularVelocity; }, 357 (s) => { return MaxAngularVelocity; },
350 (s,v) => { MaxAngularVelocity = v; } ), 358 (s,v) => { MaxAngularVelocity = v; MaxAngularVelocitySquared = v * v; } ),
351 // LL documentation says thie number should be 20f for llApplyImpulse and 200f for llRezObject 359 // LL documentation says thie number should be 20f for llApplyImpulse and 200f for llRezObject
352 new ParameterDefn<float>("MaxAddForceMagnitude", "Maximum force that can be applied by llApplyImpulse (SL says 20f)", 360 new ParameterDefn<float>("MaxAddForceMagnitude", "Maximum force that can be applied by llApplyImpulse (SL says 20f)",
353 20000.0f, 361 20000.0f,
354 (s) => { return MaxAddForceMagnitude; }, 362 (s) => { return MaxAddForceMagnitude; },
355 (s,v) => { MaxAddForceMagnitude = v; } ), 363 (s,v) => { MaxAddForceMagnitude = v; MaxAddForceMagnitudeSquared = v * v; } ),
356 // Density is passed around as 100kg/m3. This scales that to 1kg/m3. 364 // Density is passed around as 100kg/m3. This scales that to 1kg/m3.
357 new ParameterDefn<float>("DensityScaleFactor", "Conversion for simulator/viewer density (100kg/m3) to physical density (1kg/m3)", 365 new ParameterDefn<float>("DensityScaleFactor", "Conversion for simulator/viewer density (100kg/m3) to physical density (1kg/m3)",
358 0.01f, 366 0.01f,
@@ -505,7 +513,7 @@ public static class BSParam
505 new ParameterDefn<float>("VehicleMaxLinearVelocity", "Maximum velocity magnitude that can be assigned to a vehicle", 513 new ParameterDefn<float>("VehicleMaxLinearVelocity", "Maximum velocity magnitude that can be assigned to a vehicle",
506 1000.0f, 514 1000.0f,
507 (s) => { return (float)VehicleMaxLinearVelocity; }, 515 (s) => { return (float)VehicleMaxLinearVelocity; },
508 (s,v) => { VehicleMaxLinearVelocity = v; VehicleMaxLinearVelocitySq = v * v; } ), 516 (s,v) => { VehicleMaxLinearVelocity = v; VehicleMaxLinearVelocitySquared = v * v; } ),
509 new ParameterDefn<float>("VehicleMaxAngularVelocity", "Maximum rotational velocity magnitude that can be assigned to a vehicle", 517 new ParameterDefn<float>("VehicleMaxAngularVelocity", "Maximum rotational velocity magnitude that can be assigned to a vehicle",
510 12.0f, 518 12.0f,
511 (s) => { return (float)VehicleMaxAngularVelocity; }, 519 (s) => { return (float)VehicleMaxAngularVelocity; },
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index 8f660c4..a465613 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -108,6 +108,9 @@ public class BSPrim : BSPhysObject
108 // do the actual object creation at taint time 108 // do the actual object creation at taint time
109 PhysicsScene.TaintedObject("BSPrim.create", delegate() 109 PhysicsScene.TaintedObject("BSPrim.create", delegate()
110 { 110 {
111 // Make sure the object is being created with some sanity.
112 ExtremeSanityCheck(true /* inTaintTime */);
113
111 CreateGeomAndObject(true); 114 CreateGeomAndObject(true);
112 115
113 CurrentCollisionFlags = PhysicsScene.PE.GetCollisionFlags(PhysBody); 116 CurrentCollisionFlags = PhysicsScene.PE.GetCollisionFlags(PhysBody);
@@ -450,6 +453,38 @@ public class BSPrim : BSPhysObject
450 return ret; 453 return ret;
451 } 454 }
452 455
456 // Occasionally things will fly off and really get lost.
457 // Find the wanderers and bring them back.
458 // Return 'true' if some parameter need some sanity.
459 private bool ExtremeSanityCheck(bool inTaintTime)
460 {
461 bool ret = false;
462
463 uint wayOutThere = Constants.RegionSize * Constants.RegionSize;
464 // There have been instances of objects getting thrown way out of bounds and crashing
465 // the border crossing code.
466 if ( _position.X < -Constants.RegionSize || _position.X > wayOutThere
467 || _position.Y < -Constants.RegionSize || _position.Y > wayOutThere
468 || _position.Z < -Constants.RegionSize || _position.Z > wayOutThere)
469 {
470 _position = new OMV.Vector3(10, 10, 50);
471 ZeroMotion(inTaintTime);
472 ret = true;
473 }
474 if (_velocity.LengthSquared() > BSParam.MaxLinearVelocity)
475 {
476 _velocity = Util.ClampV(_velocity, BSParam.MaxLinearVelocity);
477 ret = true;
478 }
479 if (_rotationalVelocity.LengthSquared() > BSParam.MaxAngularVelocitySquared)
480 {
481 _rotationalVelocity = Util.ClampV(_rotationalVelocity, BSParam.MaxAngularVelocity);
482 ret = true;
483 }
484
485 return ret;
486 }
487
453 // Return the effective mass of the object. 488 // Return the effective mass of the object.
454 // The definition of this call is to return the mass of the prim. 489 // The definition of this call is to return the mass of the prim.
455 // If the simulator cares about the mass of the linkset, it will sum it itself. 490 // If the simulator cares about the mass of the linkset, it will sum it itself.
@@ -585,12 +620,12 @@ public class BSPrim : BSPhysObject
585 if (VehicleController.Type == Vehicle.TYPE_NONE) 620 if (VehicleController.Type == Vehicle.TYPE_NONE)
586 { 621 {
587 UnRegisterPreStepAction("BSPrim.Vehicle", LocalID); 622 UnRegisterPreStepAction("BSPrim.Vehicle", LocalID);
588 PhysicsScene.AfterStep -= VehicleController.PostStep; 623 UnRegisterPostStepAction("BSPrim.Vehicle", LocalID);
589 } 624 }
590 else 625 else
591 { 626 {
592 RegisterPreStepAction("BSPrim.Vehicle", LocalID, VehicleController.Step); 627 RegisterPreStepAction("BSPrim.Vehicle", LocalID, VehicleController.Step);
593 PhysicsScene.AfterStep += VehicleController.PostStep; 628 RegisterPostStepAction("BSPrim.Vehicle", LocalID, VehicleController.PostStep);
594 } 629 }
595 }); 630 });
596 } 631 }
@@ -732,7 +767,7 @@ public class BSPrim : BSPhysObject
732 set { 767 set {
733 PhysicsScene.AssertInTaintTime("BSPrim.ForceVelocity"); 768 PhysicsScene.AssertInTaintTime("BSPrim.ForceVelocity");
734 769
735 _velocity = value; 770 _velocity = Util.ClampV(value, BSParam.MaxLinearVelocity);
736 if (PhysBody.HasPhysicalBody) 771 if (PhysBody.HasPhysicalBody)
737 { 772 {
738 DetailLog("{0},BSPrim.ForceVelocity,taint,vel={1}", LocalID, _velocity); 773 DetailLog("{0},BSPrim.ForceVelocity,taint,vel={1}", LocalID, _velocity);
@@ -1098,7 +1133,7 @@ public class BSPrim : BSPhysObject
1098 return _rotationalVelocity; 1133 return _rotationalVelocity;
1099 } 1134 }
1100 set { 1135 set {
1101 _rotationalVelocity = value; 1136 _rotationalVelocity = Util.ClampV(value, BSParam.MaxAngularVelocity);
1102 if (PhysBody.HasPhysicalBody) 1137 if (PhysBody.HasPhysicalBody)
1103 { 1138 {
1104 DetailLog("{0},BSPrim.ForceRotationalVel,taint,rotvel={1}", LocalID, _rotationalVelocity); 1139 DetailLog("{0},BSPrim.ForceRotationalVel,taint,rotvel={1}", LocalID, _rotationalVelocity);
@@ -1230,6 +1265,7 @@ public class BSPrim : BSPhysObject
1230 1265
1231 RegisterPreStepAction("BSPrim.Hover", LocalID, delegate(float timeStep) 1266 RegisterPreStepAction("BSPrim.Hover", LocalID, delegate(float timeStep)
1232 { 1267 {
1268 // Don't do hovering while the object is selected.
1233 if (!IsPhysicallyActive) 1269 if (!IsPhysicallyActive)
1234 return; 1270 return;
1235 1271
@@ -1737,10 +1773,9 @@ public class BSPrim : BSPhysObject
1737 // Assign directly to the local variables so the normal set actions do not happen 1773 // Assign directly to the local variables so the normal set actions do not happen
1738 _position = entprop.Position; 1774 _position = entprop.Position;
1739 _orientation = entprop.Rotation; 1775 _orientation = entprop.Rotation;
1740 // _velocity = entprop.Velocity;
1741 // DEBUG DEBUG DEBUG -- smooth velocity changes a bit. The simulator seems to be 1776 // DEBUG DEBUG DEBUG -- smooth velocity changes a bit. The simulator seems to be
1742 // very sensitive to velocity changes. 1777 // very sensitive to velocity changes.
1743 if (entprop.Velocity == OMV.Vector3.Zero || !entprop.Velocity.ApproxEquals(_velocity, 0.1f)) 1778 if (entprop.Velocity == OMV.Vector3.Zero || !entprop.Velocity.ApproxEquals(_velocity, BSParam.UpdateVelocityChangeThreshold))
1744 _velocity = entprop.Velocity; 1779 _velocity = entprop.Velocity;
1745 _acceleration = entprop.Acceleration; 1780 _acceleration = entprop.Acceleration;
1746 _rotationalVelocity = entprop.RotationalVelocity; 1781 _rotationalVelocity = entprop.RotationalVelocity;
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt
index 4dc16f4..8a15abe 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt
+++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt
@@ -9,6 +9,9 @@ Enable vehicle border crossings (at least as poorly as ODE)
9Lock axis 9Lock axis
10Deleting a linkset while standing on the root will leave the physical shape of the root behind. 10Deleting a linkset while standing on the root will leave the physical shape of the root behind.
11 Not sure if it is because standing on it. Done with large prim linksets. 11 Not sure if it is because standing on it. Done with large prim linksets.
12Linkset child rotations.
13 Nebadon spiral tube has middle sections which are rotated wrong.
14 Select linked spiral tube. Delink and note where the middle section ends up.
12Vehicle angular vertical attraction 15Vehicle angular vertical attraction
13vehicle angular banking 16vehicle angular banking
14Center-of-gravity 17Center-of-gravity
@@ -68,6 +71,8 @@ Vehicle attributes are not restored when a vehicle is rezzed on region creation
68 71
69GENERAL TODO LIST: 72GENERAL TODO LIST:
70================================================= 73=================================================
74Explore btGImpactMeshShape as alternative to convex hulls for simplified physical objects.
75 Regular triangle meshes don't do physical collisions.
71Resitution of a prim works on another prim but not on terrain. 76Resitution of a prim works on another prim but not on terrain.
72 The dropped prim doesn't bounce properly on the terrain. 77 The dropped prim doesn't bounce properly on the terrain.
73Add a sanity check for PIDTarget location. 78Add a sanity check for PIDTarget location.
@@ -338,4 +343,4 @@ Avatar standing on a moving object should start to move with the object. (DONE 2
338Angular motion around Z moves the vehicle in world Z and not vehicle Z in ODE. 343Angular motion around Z moves the vehicle in world Z and not vehicle Z in ODE.
339 Verify that angular motion specified around Z moves in the vehicle coordinates. 344 Verify that angular motion specified around Z moves in the vehicle coordinates.
340 DONE 20130120: BulletSim properly applies force in vehicle relative coordinates. 345 DONE 20130120: BulletSim properly applies force in vehicle relative coordinates.
341Nebadon vehicles turning funny in arena (DONE) \ No newline at end of file 346Nebadon vehicles turning funny in arena (DONE)