diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 120 |
1 files changed, 81 insertions, 39 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index 27a78d1..2ca4912 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -39,23 +39,10 @@ using log4net; | |||
39 | using OpenMetaverse; | 39 | using OpenMetaverse; |
40 | 40 | ||
41 | // TODOs for BulletSim (for BSScene, BSPrim, BSCharacter and BulletSim) | 41 | // TODOs for BulletSim (for BSScene, BSPrim, BSCharacter and BulletSim) |
42 | // Test sculpties (verified that they don't work) | ||
43 | // Compute physics FPS reasonably | ||
44 | // Based on material, set density and friction | 42 | // Based on material, set density and friction |
45 | // Don't use constraints in linksets of non-physical objects. Means having to move children manually. | ||
46 | // Four states of prim: Physical, regular, phantom and selected. Are we modeling these correctly? | ||
47 | // In SL one can set both physical and phantom (gravity, does not effect others, makes collisions with ground) | ||
48 | // At the moment, physical and phantom causes object to drop through the terrain | ||
49 | // Physical phantom objects and related typing (collision options ) | ||
50 | // Check out llVolumeDetect. Must do something for that. | ||
51 | // Use collision masks for collision with terrain and phantom objects | ||
52 | // More efficient memory usage when passing hull information from BSPrim to BulletSim | 43 | // More efficient memory usage when passing hull information from BSPrim to BulletSim |
53 | // Should prim.link() and prim.delink() membership checking happen at taint time? | ||
54 | // Mesh sharing. Use meshHash to tell if we already have a hull of that shape and only create once. | ||
55 | // Do attachments need to be handled separately? Need collision events. Do not collide with VolumeDetect | 44 | // Do attachments need to be handled separately? Need collision events. Do not collide with VolumeDetect |
56 | // Implement LockAngularMotion | 45 | // Implement LockAngularMotion |
57 | // Decide if clearing forces is the right thing to do when setting position (BulletSim::SetObjectTranslation) | ||
58 | // Remove mesh and Hull stuff. Use mesh passed to bullet and use convexdecom from bullet. | ||
59 | // Add PID movement operations. What does ScenePresence.MoveToTarget do? | 46 | // Add PID movement operations. What does ScenePresence.MoveToTarget do? |
60 | // Check terrain size. 128 or 127? | 47 | // Check terrain size. 128 or 127? |
61 | // Raycast | 48 | // Raycast |
@@ -109,6 +96,19 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
109 | public long SimulationStep { get { return m_simulationStep; } } | 96 | public long SimulationStep { get { return m_simulationStep; } } |
110 | private int m_taintsToProcessPerStep; | 97 | private int m_taintsToProcessPerStep; |
111 | 98 | ||
99 | // Avatar parameters | ||
100 | public float ParamAvatarFriction { get; private set; } | ||
101 | public float ParamAvatarStandingFriction { get; private set; } | ||
102 | public float ParamAvatarDensity { get; private set; } | ||
103 | public float ParamAvatarRestitution { get; private set; } | ||
104 | public float ParamAvatarCapsuleWidth { get; private set; } | ||
105 | public float ParamAvatarCapsuleDepth { get; private set; } | ||
106 | public float ParamAvatarCapsuleHeight { get; private set; } | ||
107 | public float ParamAvatarContactProcessingThreshold { get; private set; } | ||
108 | |||
109 | public delegate void PreStepAction(float timeStep); | ||
110 | public event PreStepAction BeforeStep; | ||
111 | |||
112 | // A value of the time now so all the collision and update routines do not have to get their own | 112 | // A value of the time now so all the collision and update routines do not have to get their own |
113 | // Set to 'now' just before all the prims and actors are called for collisions and updates | 113 | // Set to 'now' just before all the prims and actors are called for collisions and updates |
114 | public int SimulationNowTime { get; private set; } | 114 | public int SimulationNowTime { get; private set; } |
@@ -140,7 +140,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
140 | public const uint GROUNDPLANE_ID = 1; | 140 | public const uint GROUNDPLANE_ID = 1; |
141 | public const uint CHILDTERRAIN_ID = 2; // Terrain allocated based on our mega-prim childre start here | 141 | public const uint CHILDTERRAIN_ID = 2; // Terrain allocated based on our mega-prim childre start here |
142 | 142 | ||
143 | private float m_waterLevel; | 143 | public float SimpleWaterLevel { get; set; } |
144 | public BSTerrainManager TerrainManager { get; private set; } | 144 | public BSTerrainManager TerrainManager { get; private set; } |
145 | 145 | ||
146 | public ConfigurationParameters Params | 146 | public ConfigurationParameters Params |
@@ -195,8 +195,10 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
195 | private string m_physicsLoggingDir; | 195 | private string m_physicsLoggingDir; |
196 | private string m_physicsLoggingPrefix; | 196 | private string m_physicsLoggingPrefix; |
197 | private int m_physicsLoggingFileMinutes; | 197 | private int m_physicsLoggingFileMinutes; |
198 | private bool m_physicsLoggingDoFlush; | ||
198 | // 'true' of the vehicle code is to log lots of details | 199 | // 'true' of the vehicle code is to log lots of details |
199 | public bool VehicleLoggingEnabled { get; private set; } | 200 | public bool VehicleLoggingEnabled { get; private set; } |
201 | public bool VehiclePhysicalLoggingEnabled { get; private set; } | ||
200 | 202 | ||
201 | #region Construction and Initialization | 203 | #region Construction and Initialization |
202 | public BSScene(string identifier) | 204 | public BSScene(string identifier) |
@@ -234,6 +236,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
234 | if (m_physicsLoggingEnabled) | 236 | if (m_physicsLoggingEnabled) |
235 | { | 237 | { |
236 | PhysicsLogging = new Logging.LogWriter(m_physicsLoggingDir, m_physicsLoggingPrefix, m_physicsLoggingFileMinutes); | 238 | PhysicsLogging = new Logging.LogWriter(m_physicsLoggingDir, m_physicsLoggingPrefix, m_physicsLoggingFileMinutes); |
239 | PhysicsLogging.ErrorLogger = m_log; // for DEBUG. Let's the logger output error messages. | ||
237 | } | 240 | } |
238 | else | 241 | else |
239 | { | 242 | { |
@@ -302,12 +305,22 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
302 | m_physicsLoggingDir = pConfig.GetString("PhysicsLoggingDir", "."); | 305 | m_physicsLoggingDir = pConfig.GetString("PhysicsLoggingDir", "."); |
303 | m_physicsLoggingPrefix = pConfig.GetString("PhysicsLoggingPrefix", "physics-%REGIONNAME%-"); | 306 | m_physicsLoggingPrefix = pConfig.GetString("PhysicsLoggingPrefix", "physics-%REGIONNAME%-"); |
304 | m_physicsLoggingFileMinutes = pConfig.GetInt("PhysicsLoggingFileMinutes", 5); | 307 | m_physicsLoggingFileMinutes = pConfig.GetInt("PhysicsLoggingFileMinutes", 5); |
308 | m_physicsLoggingDoFlush = pConfig.GetBoolean("PhysicsLoggingDoFlush", false); | ||
305 | // Very detailed logging for vehicle debugging | 309 | // Very detailed logging for vehicle debugging |
306 | VehicleLoggingEnabled = pConfig.GetBoolean("VehicleLoggingEnabled", false); | 310 | VehicleLoggingEnabled = pConfig.GetBoolean("VehicleLoggingEnabled", false); |
311 | VehiclePhysicalLoggingEnabled = pConfig.GetBoolean("VehiclePhysicalLoggingEnabled", false); | ||
307 | 312 | ||
308 | // Do any replacements in the parameters | 313 | // Do any replacements in the parameters |
309 | m_physicsLoggingPrefix = m_physicsLoggingPrefix.Replace("%REGIONNAME%", RegionName); | 314 | m_physicsLoggingPrefix = m_physicsLoggingPrefix.Replace("%REGIONNAME%", RegionName); |
310 | } | 315 | } |
316 | |||
317 | // The material characteristics. | ||
318 | BSMaterials.InitializeFromDefaults(Params); | ||
319 | if (pConfig != null) | ||
320 | { | ||
321 | // Let the user add new and interesting material property values. | ||
322 | BSMaterials.InitializefromParameters(pConfig); | ||
323 | } | ||
311 | } | 324 | } |
312 | } | 325 | } |
313 | 326 | ||
@@ -345,8 +358,6 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
345 | // make sure no stepping happens while we're deleting stuff | 358 | // make sure no stepping happens while we're deleting stuff |
346 | m_initialized = false; | 359 | m_initialized = false; |
347 | 360 | ||
348 | TerrainManager.ReleaseGroundPlaneAndTerrain(); | ||
349 | |||
350 | foreach (KeyValuePair<uint, BSPhysObject> kvp in PhysObjects) | 361 | foreach (KeyValuePair<uint, BSPhysObject> kvp in PhysObjects) |
351 | { | 362 | { |
352 | kvp.Value.Destroy(); | 363 | kvp.Value.Destroy(); |
@@ -366,6 +377,13 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
366 | Shapes = null; | 377 | Shapes = null; |
367 | } | 378 | } |
368 | 379 | ||
380 | if (TerrainManager != null) | ||
381 | { | ||
382 | TerrainManager.ReleaseGroundPlaneAndTerrain(); | ||
383 | TerrainManager.Dispose(); | ||
384 | TerrainManager = null; | ||
385 | } | ||
386 | |||
369 | // Anything left in the unmanaged code should be cleaned out | 387 | // Anything left in the unmanaged code should be cleaned out |
370 | BulletSimAPI.Shutdown2(World.ptr); | 388 | BulletSimAPI.Shutdown2(World.ptr); |
371 | 389 | ||
@@ -490,8 +508,10 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
490 | ProcessTaints(); | 508 | ProcessTaints(); |
491 | 509 | ||
492 | // Some of the prims operate with special vehicle properties | 510 | // Some of the prims operate with special vehicle properties |
493 | ProcessVehicles(timeStep); | 511 | DoPreStepActions(timeStep); |
494 | ProcessTaints(); // the vehicles might have added taints | 512 | |
513 | // the prestep actions might have added taints | ||
514 | ProcessTaints(); | ||
495 | 515 | ||
496 | // step the physical world one interval | 516 | // step the physical world one interval |
497 | m_simulationStep++; | 517 | m_simulationStep++; |
@@ -499,16 +519,17 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
499 | 519 | ||
500 | try | 520 | try |
501 | { | 521 | { |
502 | if (VehicleLoggingEnabled) DumpVehicles(); // DEBUG | 522 | if (VehiclePhysicalLoggingEnabled) DumpVehicles(); // DEBUG |
503 | if (PhysicsLogging.Enabled) beforeTime = Util.EnvironmentTickCount(); | 523 | if (PhysicsLogging.Enabled) beforeTime = Util.EnvironmentTickCount(); |
504 | 524 | ||
505 | numSubSteps = BulletSimAPI.PhysicsStep2(World.ptr, timeStep, m_maxSubSteps, m_fixedTimeStep, | 525 | numSubSteps = BulletSimAPI.PhysicsStep2(World.ptr, timeStep, m_maxSubSteps, m_fixedTimeStep, |
506 | out updatedEntityCount, out updatedEntitiesPtr, out collidersCount, out collidersPtr); | 526 | out updatedEntityCount, out updatedEntitiesPtr, out collidersCount, out collidersPtr); |
507 | 527 | ||
508 | if (PhysicsLogging.Enabled) simTime = Util.EnvironmentTickCountSubtract(beforeTime); | 528 | if (PhysicsLogging.Enabled) simTime = Util.EnvironmentTickCountSubtract(beforeTime); |
509 | DetailLog("{0},Simulate,call, frame={1}, nTaints={2}, simTime={3}, substeps={4}, updates={5}, colliders={6}", | 529 | DetailLog("{0},Simulate,call, frame={1}, nTaints={2}, simTime={3}, substeps={4}, updates={5}, colliders={6}, objWColl={7}", |
510 | DetailLogZero, m_simulationStep, numTaints, simTime, numSubSteps, updatedEntityCount, collidersCount); | 530 | DetailLogZero, m_simulationStep, numTaints, simTime, numSubSteps, |
511 | if (VehicleLoggingEnabled) DumpVehicles(); // DEBUG | 531 | updatedEntityCount, collidersCount, ObjectsWithCollisions.Count); |
532 | if (VehiclePhysicalLoggingEnabled) DumpVehicles(); // DEBUG | ||
512 | } | 533 | } |
513 | catch (Exception e) | 534 | catch (Exception e) |
514 | { | 535 | { |
@@ -520,9 +541,9 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
520 | collidersCount = 0; | 541 | collidersCount = 0; |
521 | } | 542 | } |
522 | 543 | ||
523 | // Don't have to use the pointers passed back since we know it is the same pinned memory we passed in | 544 | // Don't have to use the pointers passed back since we know it is the same pinned memory we passed in. |
524 | 545 | ||
525 | // Get a value for 'now' so all the collision and update routines don't have to get their own | 546 | // Get a value for 'now' so all the collision and update routines don't have to get their own. |
526 | SimulationNowTime = Util.EnvironmentTickCount(); | 547 | SimulationNowTime = Util.EnvironmentTickCount(); |
527 | 548 | ||
528 | // If there were collisions, process them by sending the event to the prim. | 549 | // If there were collisions, process them by sending the event to the prim. |
@@ -562,12 +583,16 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
562 | 583 | ||
563 | // Objects that are done colliding are removed from the ObjectsWithCollisions list. | 584 | // Objects that are done colliding are removed from the ObjectsWithCollisions list. |
564 | // Not done above because it is inside an iteration of ObjectWithCollisions. | 585 | // Not done above because it is inside an iteration of ObjectWithCollisions. |
586 | // This complex collision processing is required to create an empty collision | ||
587 | // event call after all collisions have happened on an object. This enables | ||
588 | // the simulator to generate the 'collision end' event. | ||
565 | if (ObjectsWithNoMoreCollisions.Count > 0) | 589 | if (ObjectsWithNoMoreCollisions.Count > 0) |
566 | { | 590 | { |
567 | foreach (BSPhysObject po in ObjectsWithNoMoreCollisions) | 591 | foreach (BSPhysObject po in ObjectsWithNoMoreCollisions) |
568 | ObjectsWithCollisions.Remove(po); | 592 | ObjectsWithCollisions.Remove(po); |
569 | ObjectsWithNoMoreCollisions.Clear(); | 593 | ObjectsWithNoMoreCollisions.Clear(); |
570 | } | 594 | } |
595 | // Done with collisions. | ||
571 | 596 | ||
572 | // If any of the objects had updated properties, tell the object it has been changed by the physics engine | 597 | // If any of the objects had updated properties, tell the object it has been changed by the physics engine |
573 | if (updatedEntityCount > 0) | 598 | if (updatedEntityCount > 0) |
@@ -585,15 +610,14 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
585 | 610 | ||
586 | ProcessPostStepTaints(); | 611 | ProcessPostStepTaints(); |
587 | 612 | ||
588 | // This causes the unmanaged code to output ALL the values found in ALL the objects in the world. | 613 | // The following causes the unmanaged code to output ALL the values found in ALL the objects in the world. |
589 | // Only enable this in a limited test world with few objects. | 614 | // Only enable this in a limited test world with few objects. |
590 | // BulletSimAPI.DumpAllInfo2(World.ptr); // DEBUG DEBUG DEBUG | 615 | // BulletSimAPI.DumpAllInfo2(World.ptr); // DEBUG DEBUG DEBUG |
591 | 616 | ||
592 | // The physics engine returns the number of milliseconds it simulated this call. | 617 | // The physics engine returns the number of milliseconds it simulated this call. |
593 | // These are summed and normalized to one second and divided by 1000 to give the reported physics FPS. | 618 | // These are summed and normalized to one second and divided by 1000 to give the reported physics FPS. |
594 | // We multiply by 55 to give a recognizable running rate (55 or less). | 619 | // Multiply by 55 to give a nominal frame rate of 55. |
595 | return numSubSteps * m_fixedTimeStep * 1000 * 55; | 620 | return (float)numSubSteps * m_fixedTimeStep * 1000f * 55f; |
596 | // return timeStep * 1000 * 55; | ||
597 | } | 621 | } |
598 | 622 | ||
599 | // Something has collided | 623 | // Something has collided |
@@ -639,12 +663,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
639 | 663 | ||
640 | public override void SetWaterLevel(float baseheight) | 664 | public override void SetWaterLevel(float baseheight) |
641 | { | 665 | { |
642 | m_waterLevel = baseheight; | 666 | SimpleWaterLevel = baseheight; |
643 | } | ||
644 | // Someday.... | ||
645 | public float GetWaterLevelAtXYZ(Vector3 loc) | ||
646 | { | ||
647 | return m_waterLevel; | ||
648 | } | 667 | } |
649 | 668 | ||
650 | public override void DeleteTerrain() | 669 | public override void DeleteTerrain() |
@@ -915,6 +934,16 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
915 | } | 934 | } |
916 | } | 935 | } |
917 | 936 | ||
937 | private void DoPreStepActions(float timeStep) | ||
938 | { | ||
939 | ProcessVehicles(timeStep); | ||
940 | |||
941 | PreStepAction actions = BeforeStep; | ||
942 | if (actions != null) | ||
943 | actions(timeStep); | ||
944 | |||
945 | } | ||
946 | |||
918 | // Some prims have extra vehicle actions | 947 | // Some prims have extra vehicle actions |
919 | // Called at taint time! | 948 | // Called at taint time! |
920 | private void ProcessVehicles(float timeStep) | 949 | private void ProcessVehicles(float timeStep) |
@@ -979,6 +1008,8 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
979 | // Should handle fetching the right type from the ini file and converting it. | 1008 | // Should handle fetching the right type from the ini file and converting it. |
980 | // -- a delegate for getting the value as a float | 1009 | // -- a delegate for getting the value as a float |
981 | // -- a delegate for setting the value from a float | 1010 | // -- a delegate for setting the value from a float |
1011 | // -- an optional delegate to update the value in the world. Most often used to | ||
1012 | // push the new value to an in-world object. | ||
982 | // | 1013 | // |
983 | // The single letter parameters for the delegates are: | 1014 | // The single letter parameters for the delegates are: |
984 | // s = BSScene | 1015 | // s = BSScene |
@@ -1069,7 +1100,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
1069 | (s,p,l,v) => { s.PID_P = v; } ), | 1100 | (s,p,l,v) => { s.PID_P = v; } ), |
1070 | 1101 | ||
1071 | new ParameterDefn("DefaultFriction", "Friction factor used on new objects", | 1102 | new ParameterDefn("DefaultFriction", "Friction factor used on new objects", |
1072 | 0.5f, | 1103 | 0.2f, |
1073 | (s,cf,p,v) => { s.m_params[0].defaultFriction = cf.GetFloat(p, v); }, | 1104 | (s,cf,p,v) => { s.m_params[0].defaultFriction = cf.GetFloat(p, v); }, |
1074 | (s) => { return s.m_params[0].defaultFriction; }, | 1105 | (s) => { return s.m_params[0].defaultFriction; }, |
1075 | (s,p,l,v) => { s.m_params[0].defaultFriction = v; } ), | 1106 | (s,p,l,v) => { s.m_params[0].defaultFriction = v; } ), |
@@ -1084,7 +1115,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
1084 | (s) => { return s.m_params[0].defaultRestitution; }, | 1115 | (s) => { return s.m_params[0].defaultRestitution; }, |
1085 | (s,p,l,v) => { s.m_params[0].defaultRestitution = v; } ), | 1116 | (s,p,l,v) => { s.m_params[0].defaultRestitution = v; } ), |
1086 | new ParameterDefn("CollisionMargin", "Margin around objects before collisions are calculated (must be zero!)", | 1117 | new ParameterDefn("CollisionMargin", "Margin around objects before collisions are calculated (must be zero!)", |
1087 | 0f, | 1118 | 0.04f, |
1088 | (s,cf,p,v) => { s.m_params[0].collisionMargin = cf.GetFloat(p, v); }, | 1119 | (s,cf,p,v) => { s.m_params[0].collisionMargin = cf.GetFloat(p, v); }, |
1089 | (s) => { return s.m_params[0].collisionMargin; }, | 1120 | (s) => { return s.m_params[0].collisionMargin; }, |
1090 | (s,p,l,v) => { s.m_params[0].collisionMargin = v; } ), | 1121 | (s,p,l,v) => { s.m_params[0].collisionMargin = v; } ), |
@@ -1151,7 +1182,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
1151 | (s) => { return s.m_params[0].terrainImplementation; }, | 1182 | (s) => { return s.m_params[0].terrainImplementation; }, |
1152 | (s,p,l,v) => { s.m_params[0].terrainImplementation = v; } ), | 1183 | (s,p,l,v) => { s.m_params[0].terrainImplementation = v; } ), |
1153 | new ParameterDefn("TerrainFriction", "Factor to reduce movement against terrain surface" , | 1184 | new ParameterDefn("TerrainFriction", "Factor to reduce movement against terrain surface" , |
1154 | 0.5f, | 1185 | 0.3f, |
1155 | (s,cf,p,v) => { s.m_params[0].terrainFriction = cf.GetFloat(p, v); }, | 1186 | (s,cf,p,v) => { s.m_params[0].terrainFriction = cf.GetFloat(p, v); }, |
1156 | (s) => { return s.m_params[0].terrainFriction; }, | 1187 | (s) => { return s.m_params[0].terrainFriction; }, |
1157 | (s,p,l,v) => { s.m_params[0].terrainFriction = v; /* TODO: set on real terrain */} ), | 1188 | (s,p,l,v) => { s.m_params[0].terrainFriction = v; /* TODO: set on real terrain */} ), |
@@ -1165,13 +1196,19 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
1165 | (s,cf,p,v) => { s.m_params[0].terrainRestitution = cf.GetFloat(p, v); }, | 1196 | (s,cf,p,v) => { s.m_params[0].terrainRestitution = cf.GetFloat(p, v); }, |
1166 | (s) => { return s.m_params[0].terrainRestitution; }, | 1197 | (s) => { return s.m_params[0].terrainRestitution; }, |
1167 | (s,p,l,v) => { s.m_params[0].terrainRestitution = v; /* TODO: set on real terrain */ } ), | 1198 | (s,p,l,v) => { s.m_params[0].terrainRestitution = v; /* TODO: set on real terrain */ } ), |
1199 | new ParameterDefn("TerrainCollisionMargin", "Margin where collision checking starts" , | ||
1200 | 0.04f, | ||
1201 | (s,cf,p,v) => { s.m_params[0].terrainCollisionMargin = cf.GetFloat(p, v); }, | ||
1202 | (s) => { return s.m_params[0].terrainCollisionMargin; }, | ||
1203 | (s,p,l,v) => { s.m_params[0].terrainCollisionMargin = v; /* TODO: set on real terrain */ } ), | ||
1204 | |||
1168 | new ParameterDefn("AvatarFriction", "Factor to reduce movement against an avatar. Changed on avatar recreation.", | 1205 | new ParameterDefn("AvatarFriction", "Factor to reduce movement against an avatar. Changed on avatar recreation.", |
1169 | 0.2f, | 1206 | 0.2f, |
1170 | (s,cf,p,v) => { s.m_params[0].avatarFriction = cf.GetFloat(p, v); }, | 1207 | (s,cf,p,v) => { s.m_params[0].avatarFriction = cf.GetFloat(p, v); }, |
1171 | (s) => { return s.m_params[0].avatarFriction; }, | 1208 | (s) => { return s.m_params[0].avatarFriction; }, |
1172 | (s,p,l,v) => { s.UpdateParameterObject(ref s.m_params[0].avatarFriction, p, l, v); } ), | 1209 | (s,p,l,v) => { s.UpdateParameterObject(ref s.m_params[0].avatarFriction, p, l, v); } ), |
1173 | new ParameterDefn("AvatarStandingFriction", "Avatar friction when standing. Changed on avatar recreation.", | 1210 | new ParameterDefn("AvatarStandingFriction", "Avatar friction when standing. Changed on avatar recreation.", |
1174 | 10f, | 1211 | 10.0f, |
1175 | (s,cf,p,v) => { s.m_params[0].avatarStandingFriction = cf.GetFloat(p, v); }, | 1212 | (s,cf,p,v) => { s.m_params[0].avatarStandingFriction = cf.GetFloat(p, v); }, |
1176 | (s) => { return s.m_params[0].avatarStandingFriction; }, | 1213 | (s) => { return s.m_params[0].avatarStandingFriction; }, |
1177 | (s,p,l,v) => { s.m_params[0].avatarStandingFriction = v; } ), | 1214 | (s,p,l,v) => { s.m_params[0].avatarStandingFriction = v; } ), |
@@ -1206,6 +1243,11 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
1206 | (s) => { return s.m_params[0].avatarContactProcessingThreshold; }, | 1243 | (s) => { return s.m_params[0].avatarContactProcessingThreshold; }, |
1207 | (s,p,l,v) => { s.UpdateParameterObject(ref s.m_params[0].avatarContactProcessingThreshold, p, l, v); } ), | 1244 | (s,p,l,v) => { s.UpdateParameterObject(ref s.m_params[0].avatarContactProcessingThreshold, p, l, v); } ), |
1208 | 1245 | ||
1246 | new ParameterDefn("VehicleAngularDamping", "Factor to damp vehicle angular movement per second (0.0 - 1.0)", | ||
1247 | 0.95f, | ||
1248 | (s,cf,p,v) => { s.m_params[0].vehicleAngularDamping = cf.GetFloat(p, v); }, | ||
1249 | (s) => { return s.m_params[0].vehicleAngularDamping; }, | ||
1250 | (s,p,l,v) => { s.m_params[0].vehicleAngularDamping = v; } ), | ||
1209 | 1251 | ||
1210 | new ParameterDefn("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default of 4096)", | 1252 | new ParameterDefn("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default of 4096)", |
1211 | 0f, | 1253 | 0f, |
@@ -1487,7 +1529,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
1487 | { | 1529 | { |
1488 | PhysicsLogging.Write(msg, args); | 1530 | PhysicsLogging.Write(msg, args); |
1489 | // Add the Flush() if debugging crashes. Gets all the messages written out. | 1531 | // Add the Flush() if debugging crashes. Gets all the messages written out. |
1490 | // PhysicsLogging.Flush(); | 1532 | if (m_physicsLoggingDoFlush) PhysicsLogging.Flush(); |
1491 | } | 1533 | } |
1492 | // Used to fill in the LocalID when there isn't one. It's the correct number of characters. | 1534 | // Used to fill in the LocalID when there isn't one. It's the correct number of characters. |
1493 | public const string DetailLogZero = "0000000000"; | 1535 | public const string DetailLogZero = "0000000000"; |