diff options
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 133 |
1 files changed, 118 insertions, 15 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index e9a849c..94a0ccf 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -37,14 +37,18 @@ using OpenMetaverse; | |||
37 | using OpenSim.Region.Framework; | 37 | using OpenSim.Region.Framework; |
38 | 38 | ||
39 | // TODOs for BulletSim (for BSScene, BSPrim, BSCharacter and BulletSim) | 39 | // TODOs for BulletSim (for BSScene, BSPrim, BSCharacter and BulletSim) |
40 | // Debug linkset | ||
41 | // Test with multiple regions in one simulator | ||
40 | // Adjust character capsule size when height is adjusted (ScenePresence.SetHeight) | 42 | // Adjust character capsule size when height is adjusted (ScenePresence.SetHeight) |
41 | // Test sculpties | 43 | // Test sculpties |
42 | // Compute physics FPS reasonably | 44 | // Compute physics FPS reasonably |
43 | // Based on material, set density and friction | 45 | // Based on material, set density and friction |
44 | // More efficient memory usage in passing hull information from BSPrim to BulletSim | 46 | // More efficient memory usage when passing hull information from BSPrim to BulletSim |
45 | // Four states of prim: Physical, regular, phantom and selected. Are we modeling these correctly? | 47 | // Four states of prim: Physical, regular, phantom and selected. Are we modeling these correctly? |
46 | // In SL one can set both physical and phantom (gravity, does not effect others, makes collisions with ground) | 48 | // In SL one can set both physical and phantom (gravity, does not effect others, makes collisions with ground) |
47 | // At the moment, physical and phantom causes object to drop through the terrain | 49 | // At the moment, physical and phantom causes object to drop through the terrain |
50 | // Physical phantom objects and related typing (collision options ) | ||
51 | // Check out llVolumeDetect. Must do something for that. | ||
48 | // Should prim.link() and prim.delink() membership checking happen at taint time? | 52 | // Should prim.link() and prim.delink() membership checking happen at taint time? |
49 | // Mesh sharing. Use meshHash to tell if we already have a hull of that shape and only create once | 53 | // Mesh sharing. Use meshHash to tell if we already have a hull of that shape and only create once |
50 | // Do attachments need to be handled separately? Need collision events. Do not collide with VolumeDetect | 54 | // Do attachments need to be handled separately? Need collision events. Do not collide with VolumeDetect |
@@ -52,6 +56,16 @@ using OpenSim.Region.Framework; | |||
52 | // Implement LockAngularMotion | 56 | // Implement LockAngularMotion |
53 | // Decide if clearing forces is the right thing to do when setting position (BulletSim::SetObjectTranslation) | 57 | // Decide if clearing forces is the right thing to do when setting position (BulletSim::SetObjectTranslation) |
54 | // Does NeedsMeshing() really need to exclude all the different shapes? | 58 | // Does NeedsMeshing() really need to exclude all the different shapes? |
59 | // Remove mesh and Hull stuff. Use mesh passed to bullet and use convexdecom from bullet. | ||
60 | // Add PID movement operations. What does ScenePresence.MoveToTarget do? | ||
61 | // Check terrain size. 128 or 127? | ||
62 | // Multiple contact points on collision? | ||
63 | // See code in ode::near... calls to collision_accounting_events() | ||
64 | // (This might not be a problem. ODE collects all the collisions with one object in one tick.) | ||
65 | // Use collision masks for collision with terrain and phantom objects | ||
66 | // Figure out how to not allocate a new Dictionary and List for every collision | ||
67 | // in BSPrim.Collide() and BSCharacter.Collide(). Can the same ones be reused? | ||
68 | // Raycast | ||
55 | // | 69 | // |
56 | namespace OpenSim.Region.Physics.BulletSPlugin | 70 | namespace OpenSim.Region.Physics.BulletSPlugin |
57 | { | 71 | { |
@@ -64,6 +78,8 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
64 | 78 | ||
65 | private Dictionary<uint, BSCharacter> m_avatars = new Dictionary<uint, BSCharacter>(); | 79 | private Dictionary<uint, BSCharacter> m_avatars = new Dictionary<uint, BSCharacter>(); |
66 | private Dictionary<uint, BSPrim> m_prims = new Dictionary<uint, BSPrim>(); | 80 | private Dictionary<uint, BSPrim> m_prims = new Dictionary<uint, BSPrim>(); |
81 | private HashSet<BSCharacter> m_avatarsWithCollisions = new HashSet<BSCharacter>(); | ||
82 | private HashSet<BSPrim> m_primsWithCollisions = new HashSet<BSPrim>(); | ||
67 | private List<BSPrim> m_vehicles = new List<BSPrim>(); | 83 | private List<BSPrim> m_vehicles = new List<BSPrim>(); |
68 | private float[] m_heightMap; | 84 | private float[] m_heightMap; |
69 | private float m_waterLevel; | 85 | private float m_waterLevel; |
@@ -164,6 +180,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
164 | if (m_log.IsDebugEnabled) | 180 | if (m_log.IsDebugEnabled) |
165 | { | 181 | { |
166 | m_log.DebugFormat("{0}: Initialize: Setting debug callback for unmanaged code", LogHeader); | 182 | m_log.DebugFormat("{0}: Initialize: Setting debug callback for unmanaged code", LogHeader); |
183 | // the handle is saved to it doesn't get freed after this call | ||
167 | m_DebugLogCallbackHandle = new BulletSimAPI.DebugLogCallback(BulletLogger); | 184 | m_DebugLogCallbackHandle = new BulletSimAPI.DebugLogCallback(BulletLogger); |
168 | BulletSimAPI.SetDebugLogCallback(m_DebugLogCallbackHandle); | 185 | BulletSimAPI.SetDebugLogCallback(m_DebugLogCallbackHandle); |
169 | } | 186 | } |
@@ -172,7 +189,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
172 | 189 | ||
173 | mesher = meshmerizer; | 190 | mesher = meshmerizer; |
174 | // The bounding box for the simulated world | 191 | // The bounding box for the simulated world |
175 | Vector3 worldExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, 4096f); | 192 | Vector3 worldExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, 8192f); |
176 | 193 | ||
177 | // m_log.DebugFormat("{0}: Initialize: Calling BulletSimAPI.Initialize.", LogHeader); | 194 | // m_log.DebugFormat("{0}: Initialize: Calling BulletSimAPI.Initialize.", LogHeader); |
178 | m_worldID = BulletSimAPI.Initialize(worldExtent, m_paramsHandle.AddrOfPinnedObject(), | 195 | m_worldID = BulletSimAPI.Initialize(worldExtent, m_paramsHandle.AddrOfPinnedObject(), |
@@ -220,10 +237,20 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
220 | parms.terrainFriction = 0.5f; | 237 | parms.terrainFriction = 0.5f; |
221 | parms.terrainHitFraction = 0.8f; | 238 | parms.terrainHitFraction = 0.8f; |
222 | parms.terrainRestitution = 0f; | 239 | parms.terrainRestitution = 0f; |
223 | parms.avatarFriction = 0.0f; | 240 | parms.avatarFriction = 0.5f; |
241 | parms.avatarRestitution = 0.0f; | ||
224 | parms.avatarDensity = 60f; | 242 | parms.avatarDensity = 60f; |
225 | parms.avatarCapsuleRadius = 0.37f; | 243 | parms.avatarCapsuleRadius = 0.37f; |
226 | parms.avatarCapsuleHeight = 1.5f; // 2.140599f | 244 | parms.avatarCapsuleHeight = 1.5f; // 2.140599f |
245 | parms.avatarContactProcessingThreshold = 0.1f; | ||
246 | |||
247 | parms.maxPersistantManifoldPoolSize = 0f; | ||
248 | parms.shouldDisableContactPoolDynamicAllocation = ConfigurationParameters.numericTrue; | ||
249 | parms.shouldForceUpdateAllAabbs = ConfigurationParameters.numericFalse; | ||
250 | parms.shouldRandomizeSolverOrder = ConfigurationParameters.numericFalse; | ||
251 | parms.shouldSplitSimulationIslands = ConfigurationParameters.numericFalse; | ||
252 | parms.shouldEnableFrictionCaching = ConfigurationParameters.numericFalse; | ||
253 | parms.numberOfSolverIterations = 0f; // means use default | ||
227 | 254 | ||
228 | if (config != null) | 255 | if (config != null) |
229 | { | 256 | { |
@@ -265,14 +292,40 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
265 | parms.terrainHitFraction = pConfig.GetFloat("TerrainHitFraction", parms.terrainHitFraction); | 292 | parms.terrainHitFraction = pConfig.GetFloat("TerrainHitFraction", parms.terrainHitFraction); |
266 | parms.terrainRestitution = pConfig.GetFloat("TerrainRestitution", parms.terrainRestitution); | 293 | parms.terrainRestitution = pConfig.GetFloat("TerrainRestitution", parms.terrainRestitution); |
267 | parms.avatarFriction = pConfig.GetFloat("AvatarFriction", parms.avatarFriction); | 294 | parms.avatarFriction = pConfig.GetFloat("AvatarFriction", parms.avatarFriction); |
295 | parms.avatarRestitution = pConfig.GetFloat("AvatarRestitution", parms.avatarRestitution); | ||
268 | parms.avatarDensity = pConfig.GetFloat("AvatarDensity", parms.avatarDensity); | 296 | parms.avatarDensity = pConfig.GetFloat("AvatarDensity", parms.avatarDensity); |
269 | parms.avatarCapsuleRadius = pConfig.GetFloat("AvatarCapsuleRadius", parms.avatarCapsuleRadius); | 297 | parms.avatarCapsuleRadius = pConfig.GetFloat("AvatarCapsuleRadius", parms.avatarCapsuleRadius); |
270 | parms.avatarCapsuleHeight = pConfig.GetFloat("AvatarCapsuleHeight", parms.avatarCapsuleHeight); | 298 | parms.avatarCapsuleHeight = pConfig.GetFloat("AvatarCapsuleHeight", parms.avatarCapsuleHeight); |
299 | parms.avatarContactProcessingThreshold = pConfig.GetFloat("AvatarContactProcessingThreshold", parms.avatarContactProcessingThreshold); | ||
300 | |||
301 | parms.maxPersistantManifoldPoolSize = pConfig.GetFloat("MaxPersistantManifoldPoolSize", parms.maxPersistantManifoldPoolSize); | ||
302 | parms.shouldDisableContactPoolDynamicAllocation = ParamBoolean(pConfig, "ShouldDisableContactPoolDynamicAllocation", parms.shouldDisableContactPoolDynamicAllocation); | ||
303 | parms.shouldForceUpdateAllAabbs = ParamBoolean(pConfig, "ShouldForceUpdateAllAabbs", parms.shouldForceUpdateAllAabbs); | ||
304 | parms.shouldRandomizeSolverOrder = ParamBoolean(pConfig, "ShouldRandomizeSolverOrder", parms.shouldRandomizeSolverOrder); | ||
305 | parms.shouldSplitSimulationIslands = ParamBoolean(pConfig, "ShouldSplitSimulationIslands", parms.shouldSplitSimulationIslands); | ||
306 | parms.shouldEnableFrictionCaching = ParamBoolean(pConfig, "ShouldEnableFrictionCaching", parms.shouldEnableFrictionCaching); | ||
307 | parms.numberOfSolverIterations = pConfig.GetFloat("NumberOfSolverIterations", parms.numberOfSolverIterations); | ||
271 | } | 308 | } |
272 | } | 309 | } |
273 | m_params[0] = parms; | 310 | m_params[0] = parms; |
274 | } | 311 | } |
275 | 312 | ||
313 | // A helper function that handles a true/false parameter and returns the proper float number encoding | ||
314 | float ParamBoolean(IConfig config, string parmName, float deflt) | ||
315 | { | ||
316 | float ret = deflt; | ||
317 | if (config.Contains(parmName)) | ||
318 | { | ||
319 | ret = ConfigurationParameters.numericFalse; | ||
320 | if (config.GetBoolean(parmName, false)) | ||
321 | { | ||
322 | ret = ConfigurationParameters.numericTrue; | ||
323 | } | ||
324 | } | ||
325 | return ret; | ||
326 | } | ||
327 | |||
328 | |||
276 | // Called directly from unmanaged code so don't do much | 329 | // Called directly from unmanaged code so don't do much |
277 | private void BulletLogger(string msg) | 330 | private void BulletLogger(string msg) |
278 | { | 331 | { |
@@ -384,6 +437,17 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
384 | } | 437 | } |
385 | } | 438 | } |
386 | 439 | ||
440 | // The SendCollision's batch up the collisions on the objects. Now push the collisions into the simulator. | ||
441 | foreach (BSPrim bsp in m_primsWithCollisions) | ||
442 | bsp.SendCollisions(); | ||
443 | m_primsWithCollisions.Clear(); | ||
444 | // foreach (BSCharacter bsc in m_avatarsWithCollisions) | ||
445 | // bsc.SendCollisions(); | ||
446 | // This is a kludge to get avatar movement updated. ODE sends collisions even if there isn't any | ||
447 | foreach (KeyValuePair<uint, BSCharacter> kvp in m_avatars) | ||
448 | kvp.Value.SendCollisions(); | ||
449 | m_avatarsWithCollisions.Clear(); | ||
450 | |||
387 | // If any of the objects had updated properties, tell the object it has been changed by the physics engine | 451 | // If any of the objects had updated properties, tell the object it has been changed by the physics engine |
388 | if (updatedEntityCount > 0) | 452 | if (updatedEntityCount > 0) |
389 | { | 453 | { |
@@ -391,16 +455,16 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
391 | { | 455 | { |
392 | EntityProperties entprop = m_updateArray[ii]; | 456 | EntityProperties entprop = m_updateArray[ii]; |
393 | // m_log.DebugFormat("{0}: entprop[{1}]: id={2}, pos={3}", LogHeader, ii, entprop.ID, entprop.Position); | 457 | // m_log.DebugFormat("{0}: entprop[{1}]: id={2}, pos={3}", LogHeader, ii, entprop.ID, entprop.Position); |
394 | BSCharacter actor; | ||
395 | if (m_avatars.TryGetValue(entprop.ID, out actor)) | ||
396 | { | ||
397 | actor.UpdateProperties(entprop); | ||
398 | continue; | ||
399 | } | ||
400 | BSPrim prim; | 458 | BSPrim prim; |
401 | if (m_prims.TryGetValue(entprop.ID, out prim)) | 459 | if (m_prims.TryGetValue(entprop.ID, out prim)) |
402 | { | 460 | { |
403 | prim.UpdateProperties(entprop); | 461 | prim.UpdateProperties(entprop); |
462 | continue; | ||
463 | } | ||
464 | BSCharacter actor; | ||
465 | if (m_avatars.TryGetValue(entprop.ID, out actor)) | ||
466 | { | ||
467 | actor.UpdateProperties(entprop); | ||
404 | } | 468 | } |
405 | } | 469 | } |
406 | } | 470 | } |
@@ -434,11 +498,13 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
434 | BSPrim prim; | 498 | BSPrim prim; |
435 | if (m_prims.TryGetValue(localID, out prim)) { | 499 | if (m_prims.TryGetValue(localID, out prim)) { |
436 | prim.Collide(collidingWith, type, collidePoint, collideNormal, penitration); | 500 | prim.Collide(collidingWith, type, collidePoint, collideNormal, penitration); |
501 | m_primsWithCollisions.Add(prim); | ||
437 | return; | 502 | return; |
438 | } | 503 | } |
439 | BSCharacter actor; | 504 | BSCharacter actor; |
440 | if (m_avatars.TryGetValue(localID, out actor)) { | 505 | if (m_avatars.TryGetValue(localID, out actor)) { |
441 | actor.Collide(collidingWith, type, collidePoint, collideNormal, penitration); | 506 | actor.Collide(collidingWith, type, collidePoint, collideNormal, penitration); |
507 | m_avatarsWithCollisions.Add(actor); | ||
442 | return; | 508 | return; |
443 | } | 509 | } |
444 | return; | 510 | return; |
@@ -470,12 +536,12 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
470 | 536 | ||
471 | public override void DeleteTerrain() | 537 | public override void DeleteTerrain() |
472 | { | 538 | { |
473 | m_log.DebugFormat("{0}: DeleteTerrain()", LogHeader); | 539 | // m_log.DebugFormat("{0}: DeleteTerrain()", LogHeader); |
474 | } | 540 | } |
475 | 541 | ||
476 | public override void Dispose() | 542 | public override void Dispose() |
477 | { | 543 | { |
478 | m_log.DebugFormat("{0}: Dispose()", LogHeader); | 544 | // m_log.DebugFormat("{0}: Dispose()", LogHeader); |
479 | } | 545 | } |
480 | 546 | ||
481 | public override Dictionary<uint, float> GetTopColliders() | 547 | public override Dictionary<uint, float> GetTopColliders() |
@@ -699,9 +765,23 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
699 | new PhysParameterEntry("DeactivationTime", "Seconds before considering an object potentially static" ), | 765 | new PhysParameterEntry("DeactivationTime", "Seconds before considering an object potentially static" ), |
700 | new PhysParameterEntry("LinearSleepingThreshold", "Seconds to measure linear movement before considering static" ), | 766 | new PhysParameterEntry("LinearSleepingThreshold", "Seconds to measure linear movement before considering static" ), |
701 | new PhysParameterEntry("AngularSleepingThreshold", "Seconds to measure angular movement before considering static" ), | 767 | new PhysParameterEntry("AngularSleepingThreshold", "Seconds to measure angular movement before considering static" ), |
702 | // new PhysParameterEntry("CcdMotionThreshold", "" ), | 768 | new PhysParameterEntry("CcdMotionThreshold", "Continuious collision detection threshold (0 means no CCD)" ), |
703 | // new PhysParameterEntry("CcdSweptSphereRadius", "" ), | 769 | new PhysParameterEntry("CcdSweptSphereRadius", "Continuious collision detection test radius" ), |
704 | new PhysParameterEntry("ContactProcessingThreshold", "Distance between contacts before doing collision check" ), | 770 | new PhysParameterEntry("ContactProcessingThreshold", "Distance between contacts before doing collision check" ), |
771 | // Can only change the following at initialization time. Change the INI file and reboot. | ||
772 | new PhysParameterEntry("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default)"), | ||
773 | new PhysParameterEntry("ShouldDisableContactPoolDynamicAllocation", "Enable to allow large changes in object count"), | ||
774 | new PhysParameterEntry("ShouldForceUpdateAllAabbs", "Enable to recomputer AABBs every simulator step"), | ||
775 | new PhysParameterEntry("ShouldRandomizeSolverOrder", "Enable for slightly better stacking interaction"), | ||
776 | new PhysParameterEntry("ShouldSplitSimulationIslands", "Enable splitting active object scanning islands"), | ||
777 | new PhysParameterEntry("ShouldEnableFrictionCaching", "Enable friction computation caching"), | ||
778 | new PhysParameterEntry("NumberOfSolverIterations", "Number of internal iterations (0 means default)"), | ||
779 | |||
780 | new PhysParameterEntry("Friction", "Set friction parameter for a specific object" ), | ||
781 | new PhysParameterEntry("Restitution", "Set restitution parameter for a specific object" ), | ||
782 | |||
783 | new PhysParameterEntry("Friction", "Set friction parameter for a specific object" ), | ||
784 | new PhysParameterEntry("Restitution", "Set restitution parameter for a specific object" ), | ||
705 | 785 | ||
706 | new PhysParameterEntry("TerrainFriction", "Factor to reduce movement against terrain surface" ), | 786 | new PhysParameterEntry("TerrainFriction", "Factor to reduce movement against terrain surface" ), |
707 | new PhysParameterEntry("TerrainHitFraction", "Distance to measure hit collisions" ), | 787 | new PhysParameterEntry("TerrainHitFraction", "Distance to measure hit collisions" ), |
@@ -710,7 +790,9 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
710 | new PhysParameterEntry("AvatarDensity", "Density of an avatar. Changed on avatar recreation." ), | 790 | new PhysParameterEntry("AvatarDensity", "Density of an avatar. Changed on avatar recreation." ), |
711 | new PhysParameterEntry("AvatarRestitution", "Bouncyness. Changed on avatar recreation." ), | 791 | new PhysParameterEntry("AvatarRestitution", "Bouncyness. Changed on avatar recreation." ), |
712 | new PhysParameterEntry("AvatarCapsuleRadius", "Radius of space around an avatar" ), | 792 | new PhysParameterEntry("AvatarCapsuleRadius", "Radius of space around an avatar" ), |
713 | new PhysParameterEntry("AvatarCapsuleHeight", "Default height of space around avatar" ) | 793 | new PhysParameterEntry("AvatarCapsuleHeight", "Default height of space around avatar" ), |
794 | new PhysParameterEntry("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions") | ||
795 | |||
714 | }; | 796 | }; |
715 | 797 | ||
716 | #region IPhysicsParameters | 798 | #region IPhysicsParameters |
@@ -733,6 +815,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
733 | switch (lparm) | 815 | switch (lparm) |
734 | { | 816 | { |
735 | case "detailedstats": m_detailedStatsStep = (int)val; break; | 817 | case "detailedstats": m_detailedStatsStep = (int)val; break; |
818 | |||
736 | case "meshlod": m_meshLOD = (int)val; break; | 819 | case "meshlod": m_meshLOD = (int)val; break; |
737 | case "sculptlod": m_sculptLOD = (int)val; break; | 820 | case "sculptlod": m_sculptLOD = (int)val; break; |
738 | case "maxsubstep": m_maxSubSteps = (int)val; break; | 821 | case "maxsubstep": m_maxSubSteps = (int)val; break; |
@@ -743,7 +826,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
743 | case "defaultdensity": m_params[0].defaultDensity = val; break; | 826 | case "defaultdensity": m_params[0].defaultDensity = val; break; |
744 | case "defaultrestitution": m_params[0].defaultRestitution = val; break; | 827 | case "defaultrestitution": m_params[0].defaultRestitution = val; break; |
745 | case "collisionmargin": m_params[0].collisionMargin = val; break; | 828 | case "collisionmargin": m_params[0].collisionMargin = val; break; |
746 | case "gravity": m_params[0].gravity = val; TaintedUpdateParameter(lparm, PhysParameterEntry.APPLY_TO_NONE, val); break; | 829 | case "gravity": m_params[0].gravity = val; TaintedUpdateParameter(lparm, localID, val); break; |
747 | 830 | ||
748 | case "lineardamping": UpdateParameterPrims(ref m_params[0].linearDamping, lparm, localID, val); break; | 831 | case "lineardamping": UpdateParameterPrims(ref m_params[0].linearDamping, lparm, localID, val); break; |
749 | case "angulardamping": UpdateParameterPrims(ref m_params[0].angularDamping, lparm, localID, val); break; | 832 | case "angulardamping": UpdateParameterPrims(ref m_params[0].angularDamping, lparm, localID, val); break; |
@@ -753,6 +836,17 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
753 | case "ccdmotionthreshold": UpdateParameterPrims(ref m_params[0].ccdMotionThreshold, lparm, localID, val); break; | 836 | case "ccdmotionthreshold": UpdateParameterPrims(ref m_params[0].ccdMotionThreshold, lparm, localID, val); break; |
754 | case "ccdsweptsphereradius": UpdateParameterPrims(ref m_params[0].ccdSweptSphereRadius, lparm, localID, val); break; | 837 | case "ccdsweptsphereradius": UpdateParameterPrims(ref m_params[0].ccdSweptSphereRadius, lparm, localID, val); break; |
755 | case "contactprocessingthreshold": UpdateParameterPrims(ref m_params[0].contactProcessingThreshold, lparm, localID, val); break; | 838 | case "contactprocessingthreshold": UpdateParameterPrims(ref m_params[0].contactProcessingThreshold, lparm, localID, val); break; |
839 | // the following are used only at initialization time so setting them makes no sense | ||
840 | // case "maxPersistantmanifoldpoolSize": m_params[0].maxPersistantManifoldPoolSize = val; break; | ||
841 | // case "shoulddisablecontactpooldynamicallocation": m_params[0].shouldDisableContactPoolDynamicAllocation = val; break; | ||
842 | // case "shouldforceupdateallaabbs": m_params[0].shouldForceUpdateAllAabbs = val; break; | ||
843 | // case "shouldrandomizesolverorder": m_params[0].shouldRandomizeSolverOrder = val; break; | ||
844 | // case "shouldsplitsimulationislands": m_params[0].shouldSplitSimulationIslands = val; break; | ||
845 | // case "shouldenablefrictioncaching": m_params[0].shouldEnableFrictionCaching = val; break; | ||
846 | // case "numberofsolveriterations": m_params[0].numberOfSolverIterations = val; break; | ||
847 | |||
848 | case "friction": TaintedUpdateParameter(lparm, localID, val); break; | ||
849 | case "restitution": TaintedUpdateParameter(lparm, localID, val); break; | ||
756 | 850 | ||
757 | // set a terrain physical feature and cause terrain to be recalculated | 851 | // set a terrain physical feature and cause terrain to be recalculated |
758 | case "terrainfriction": m_params[0].terrainFriction = val; TaintedUpdateParameter("terrain", 0, val); break; | 852 | case "terrainfriction": m_params[0].terrainFriction = val; TaintedUpdateParameter("terrain", 0, val); break; |
@@ -764,6 +858,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
764 | case "avatarrestitution": UpdateParameterAvatars(ref m_params[0].avatarRestitution, "avatar", localID, val); break; | 858 | case "avatarrestitution": UpdateParameterAvatars(ref m_params[0].avatarRestitution, "avatar", localID, val); break; |
765 | case "avatarcapsuleradius": UpdateParameterAvatars(ref m_params[0].avatarCapsuleRadius, "avatar", localID, val); break; | 859 | case "avatarcapsuleradius": UpdateParameterAvatars(ref m_params[0].avatarCapsuleRadius, "avatar", localID, val); break; |
766 | case "avatarcapsuleheight": UpdateParameterAvatars(ref m_params[0].avatarCapsuleHeight, "avatar", localID, val); break; | 860 | case "avatarcapsuleheight": UpdateParameterAvatars(ref m_params[0].avatarCapsuleHeight, "avatar", localID, val); break; |
861 | case "avatarcontactprocessingthreshold": UpdateParameterAvatars(ref m_params[0].avatarContactProcessingThreshold, "avatar", localID, val); break; | ||
767 | 862 | ||
768 | default: ret = false; break; | 863 | default: ret = false; break; |
769 | } | 864 | } |
@@ -856,6 +951,13 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
856 | case "ccdmotionthreshold": val = m_params[0].ccdMotionThreshold; break; | 951 | case "ccdmotionthreshold": val = m_params[0].ccdMotionThreshold; break; |
857 | case "ccdsweptsphereradius": val = m_params[0].ccdSweptSphereRadius; break; | 952 | case "ccdsweptsphereradius": val = m_params[0].ccdSweptSphereRadius; break; |
858 | case "contactprocessingthreshold": val = m_params[0].contactProcessingThreshold; break; | 953 | case "contactprocessingthreshold": val = m_params[0].contactProcessingThreshold; break; |
954 | case "maxPersistantmanifoldpoolSize": val = m_params[0].maxPersistantManifoldPoolSize; break; | ||
955 | case "shoulddisablecontactpooldynamicallocation": val = m_params[0].shouldDisableContactPoolDynamicAllocation; break; | ||
956 | case "shouldforceupdateallaabbs": val = m_params[0].shouldForceUpdateAllAabbs; break; | ||
957 | case "shouldrandomizesolverorder": val = m_params[0].shouldRandomizeSolverOrder; break; | ||
958 | case "shouldsplitsimulationislands": val = m_params[0].shouldSplitSimulationIslands; break; | ||
959 | case "shouldenablefrictioncaching": val = m_params[0].shouldEnableFrictionCaching; break; | ||
960 | case "numberofsolveriterations": val = m_params[0].numberOfSolverIterations; break; | ||
859 | 961 | ||
860 | case "terrainfriction": val = m_params[0].terrainFriction; break; | 962 | case "terrainfriction": val = m_params[0].terrainFriction; break; |
861 | case "terrainhitfraction": val = m_params[0].terrainHitFraction; break; | 963 | case "terrainhitfraction": val = m_params[0].terrainHitFraction; break; |
@@ -866,6 +968,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
866 | case "avatarrestitution": val = m_params[0].avatarRestitution; break; | 968 | case "avatarrestitution": val = m_params[0].avatarRestitution; break; |
867 | case "avatarcapsuleradius": val = m_params[0].avatarCapsuleRadius; break; | 969 | case "avatarcapsuleradius": val = m_params[0].avatarCapsuleRadius; break; |
868 | case "avatarcapsuleheight": val = m_params[0].avatarCapsuleHeight; break; | 970 | case "avatarcapsuleheight": val = m_params[0].avatarCapsuleHeight; break; |
971 | case "avatarcontactprocessingthreshold": val = m_params[0].avatarContactProcessingThreshold; break; | ||
869 | default: ret = false; break; | 972 | default: ret = false; break; |
870 | 973 | ||
871 | } | 974 | } |