aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
diff options
context:
space:
mode:
authorRobert Adams2013-05-03 17:14:31 -0700
committerRobert Adams2013-05-06 13:32:24 -0700
commitbf318969836bf38dbd0325f24fa3d1bd12f34d77 (patch)
treedf9b70ed2edef90a5485340930a9dc4d4de7bc2a /OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
parentBulletSim: extend BSActorLockAxis to allow locking linear movement in (diff)
downloadopensim-SC_OLD-bf318969836bf38dbd0325f24fa3d1bd12f34d77.zip
opensim-SC_OLD-bf318969836bf38dbd0325f24fa3d1bd12f34d77.tar.gz
opensim-SC_OLD-bf318969836bf38dbd0325f24fa3d1bd12f34d77.tar.bz2
opensim-SC_OLD-bf318969836bf38dbd0325f24fa3d1bd12f34d77.tar.xz
BulletSim: simplify parameter specification by reducing the number of
specifications required for simple properties with defaults.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSParam.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSParam.cs283
1 files changed, 93 insertions, 190 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
index 2ac68e3..3ca7e16 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27using System; 27using System;
28using System.Collections.Generic; 28using System.Collections.Generic;
29using System.Reflection;
29using System.Text; 30using System.Text;
30 31
31using OpenSim.Region.Physics.Manager; 32using OpenSim.Region.Physics.Manager;
@@ -144,7 +145,7 @@ public static class BSParam
144 public static Vector3 VehicleAngularFactor { get; private set; } 145 public static Vector3 VehicleAngularFactor { get; private set; }
145 public static float VehicleGroundGravityFudge { get; private set; } 146 public static float VehicleGroundGravityFudge { get; private set; }
146 public static float VehicleAngularBankingTimescaleFudge { get; private set; } 147 public static float VehicleAngularBankingTimescaleFudge { get; private set; }
147 public static bool VehicleDebuggingEnabled { get; private set; } 148 public static bool VehicleDebuggingEnable { get; private set; }
148 149
149 // Convex Hulls 150 // Convex Hulls
150 public static int CSHullMaxDepthSplit { get; private set; } 151 public static int CSHullMaxDepthSplit { get; private set; }
@@ -236,17 +237,41 @@ public static class BSParam
236 getter = pGetter; 237 getter = pGetter;
237 objectSet = pObjSetter; 238 objectSet = pObjSetter;
238 } 239 }
239 /* Wish I could simplify using this definition but CLR doesn't store references so closure around delegates of references won't work 240 // Simple parameter variable where property name is the same as the INI file name
240 * TODO: Maybe use reflection and the name of the variable to create a reference for the getter/setter. 241 // and the value is only a simple get and set.
241 public ParameterDefn(string pName, string pDesc, T pDefault, ref T loc) 242 public ParameterDefn(string pName, string pDesc, T pDefault)
242 : base(pName, pDesc) 243 : base(pName, pDesc)
243 { 244 {
244 defaultValue = pDefault; 245 defaultValue = pDefault;
245 setter = (s, v) => { loc = v; }; 246 setter = (s, v) => { SetValueByName(s, name, v); };
246 getter = (s) => { return loc; }; 247 getter = (s) => { return GetValueByName(s, name); };
247 objectSet = null; 248 objectSet = null;
248 } 249 }
249 */ 250 // Use reflection to find the property named 'pName' in BSParam and assign 'val' to same.
251 private void SetValueByName(BSScene s, string pName, T val)
252 {
253 PropertyInfo prop = typeof(BSParam).GetProperty(pName, BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);
254 if (prop == null)
255 {
256 // This should only be output when someone adds a new INI parameter and misspells the name.
257 s.Logger.ErrorFormat("{0} SetValueByName: did not find '{1}'. Verify specified property name is the same as the given INI parameters name.", LogHeader, pName);
258 }
259 else
260 {
261 prop.SetValue(null, val, null);
262 }
263 }
264 // Use reflection to find the property named 'pName' in BSParam and return the value in same.
265 private T GetValueByName(BSScene s, string pName)
266 {
267 PropertyInfo prop = typeof(BSParam).GetProperty(pName, BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);
268 if (prop == null)
269 {
270 // This should only be output when someone adds a new INI parameter and misspells the name.
271 s.Logger.ErrorFormat("{0} GetValueByName: did not find '{1}'. Verify specified property name is the same as the given INI parameter name.", LogHeader, pName);
272 }
273 return (T)prop.GetValue(null, null);
274 }
250 public override void AssignDefault(BSScene s) 275 public override void AssignDefault(BSScene s)
251 { 276 {
252 setter(s, defaultValue); 277 setter(s, defaultValue);
@@ -336,26 +361,16 @@ public static class BSParam
336 (s) => { return ShouldUseHullsForPhysicalObjects; }, 361 (s) => { return ShouldUseHullsForPhysicalObjects; },
337 (s,v) => { ShouldUseHullsForPhysicalObjects = v; } ), 362 (s,v) => { ShouldUseHullsForPhysicalObjects = v; } ),
338 new ParameterDefn<bool>("ShouldRemoveZeroWidthTriangles", "If true, remove degenerate triangles from meshes", 363 new ParameterDefn<bool>("ShouldRemoveZeroWidthTriangles", "If true, remove degenerate triangles from meshes",
339 true, 364 true ),
340 (s) => { return ShouldRemoveZeroWidthTriangles; },
341 (s,v) => { ShouldRemoveZeroWidthTriangles = v; } ),
342 new ParameterDefn<bool>("ShouldUseBulletHACD", "If true, use the Bullet version of HACD", 365 new ParameterDefn<bool>("ShouldUseBulletHACD", "If true, use the Bullet version of HACD",
343 false, 366 false ),
344 (s) => { return ShouldUseBulletHACD; },
345 (s,v) => { ShouldUseBulletHACD = v; } ),
346 new ParameterDefn<bool>("ShouldUseSingleConvexHullForPrims", "If true, use a single convex hull shape for physical prims", 367 new ParameterDefn<bool>("ShouldUseSingleConvexHullForPrims", "If true, use a single convex hull shape for physical prims",
347 true, 368 true ),
348 (s) => { return ShouldUseSingleConvexHullForPrims; },
349 (s,v) => { ShouldUseSingleConvexHullForPrims = v; } ),
350 369
351 new ParameterDefn<int>("CrossingFailuresBeforeOutOfBounds", "How forgiving we are about getting into adjactent regions", 370 new ParameterDefn<int>("CrossingFailuresBeforeOutOfBounds", "How forgiving we are about getting into adjactent regions",
352 5, 371 5 ),
353 (s) => { return CrossingFailuresBeforeOutOfBounds; },
354 (s,v) => { CrossingFailuresBeforeOutOfBounds = v; } ),
355 new ParameterDefn<float>("UpdateVelocityChangeThreshold", "Change in updated velocity required before reporting change to simulator", 372 new ParameterDefn<float>("UpdateVelocityChangeThreshold", "Change in updated velocity required before reporting change to simulator",
356 0.1f, 373 0.1f ),
357 (s) => { return UpdateVelocityChangeThreshold; },
358 (s,v) => { UpdateVelocityChangeThreshold = v; } ),
359 374
360 new ParameterDefn<float>("MeshLevelOfDetail", "Level of detail to render meshes (32, 16, 8 or 4. 32=most detailed)", 375 new ParameterDefn<float>("MeshLevelOfDetail", "Level of detail to render meshes (32, 16, 8 or 4. 32=most detailed)",
361 32f, 376 32f,
@@ -422,18 +437,12 @@ public static class BSParam
422 (s,v) => { MaxAddForceMagnitude = v; MaxAddForceMagnitudeSquared = v * v; } ), 437 (s,v) => { MaxAddForceMagnitude = v; MaxAddForceMagnitudeSquared = v * v; } ),
423 // Density is passed around as 100kg/m3. This scales that to 1kg/m3. 438 // Density is passed around as 100kg/m3. This scales that to 1kg/m3.
424 new ParameterDefn<float>("DensityScaleFactor", "Conversion for simulator/viewer density (100kg/m3) to physical density (1kg/m3)", 439 new ParameterDefn<float>("DensityScaleFactor", "Conversion for simulator/viewer density (100kg/m3) to physical density (1kg/m3)",
425 0.01f, 440 0.01f ),
426 (s) => { return DensityScaleFactor; },
427 (s,v) => { DensityScaleFactor = v; } ),
428 441
429 new ParameterDefn<float>("PID_D", "Derivitive factor for motion smoothing", 442 new ParameterDefn<float>("PID_D", "Derivitive factor for motion smoothing",
430 2200f, 443 2200f ),
431 (s) => { return (float)PID_D; },
432 (s,v) => { PID_D = v; } ),
433 new ParameterDefn<float>("PID_P", "Parameteric factor for motion smoothing", 444 new ParameterDefn<float>("PID_P", "Parameteric factor for motion smoothing",
434 900f, 445 900f ),
435 (s) => { return (float)PID_P; },
436 (s,v) => { PID_P = v; } ),
437 446
438 new ParameterDefn<float>("DefaultFriction", "Friction factor used on new objects", 447 new ParameterDefn<float>("DefaultFriction", "Friction factor used on new objects",
439 0.2f, 448 0.2f,
@@ -500,94 +509,50 @@ public static class BSParam
500 (s,o) => { s.PE.SetContactProcessingThreshold(o.PhysBody, ContactProcessingThreshold); } ), 509 (s,o) => { s.PE.SetContactProcessingThreshold(o.PhysBody, ContactProcessingThreshold); } ),
501 510
502 new ParameterDefn<float>("TerrainImplementation", "Type of shape to use for terrain (0=heightmap, 1=mesh)", 511 new ParameterDefn<float>("TerrainImplementation", "Type of shape to use for terrain (0=heightmap, 1=mesh)",
503 (float)BSTerrainPhys.TerrainImplementation.Mesh, 512 (float)BSTerrainPhys.TerrainImplementation.Mesh ),
504 (s) => { return TerrainImplementation; },
505 (s,v) => { TerrainImplementation = v; } ),
506 new ParameterDefn<int>("TerrainMeshMagnification", "Number of times the 256x256 heightmap is multiplied to create the terrain mesh" , 513 new ParameterDefn<int>("TerrainMeshMagnification", "Number of times the 256x256 heightmap is multiplied to create the terrain mesh" ,
507 2, 514 2 ),
508 (s) => { return TerrainMeshMagnification; },
509 (s,v) => { TerrainMeshMagnification = v; } ),
510 new ParameterDefn<float>("TerrainFriction", "Factor to reduce movement against terrain surface" , 515 new ParameterDefn<float>("TerrainFriction", "Factor to reduce movement against terrain surface" ,
511 0.3f, 516 0.3f ),
512 (s) => { return TerrainFriction; },
513 (s,v) => { TerrainFriction = v; /* TODO: set on real terrain */} ),
514 new ParameterDefn<float>("TerrainHitFraction", "Distance to measure hit collisions" , 517 new ParameterDefn<float>("TerrainHitFraction", "Distance to measure hit collisions" ,
515 0.8f, 518 0.8f ),
516 (s) => { return TerrainHitFraction; },
517 (s,v) => { TerrainHitFraction = v; /* TODO: set on real terrain */ } ),
518 new ParameterDefn<float>("TerrainRestitution", "Bouncyness" , 519 new ParameterDefn<float>("TerrainRestitution", "Bouncyness" ,
519 0f, 520 0f ),
520 (s) => { return TerrainRestitution; },
521 (s,v) => { TerrainRestitution = v; /* TODO: set on real terrain */ } ),
522 new ParameterDefn<float>("TerrainContactProcessingThreshold", "Distance from terrain to stop processing collisions" , 521 new ParameterDefn<float>("TerrainContactProcessingThreshold", "Distance from terrain to stop processing collisions" ,
523 0.0f, 522 0.0f ),
524 (s) => { return TerrainContactProcessingThreshold; },
525 (s,v) => { TerrainContactProcessingThreshold = v; /* TODO: set on real terrain */ } ),
526 new ParameterDefn<float>("TerrainCollisionMargin", "Margin where collision checking starts" , 523 new ParameterDefn<float>("TerrainCollisionMargin", "Margin where collision checking starts" ,
527 0.08f, 524 0.08f ),
528 (s) => { return TerrainCollisionMargin; },
529 (s,v) => { TerrainCollisionMargin = v; /* TODO: set on real terrain */ } ),
530 525
531 new ParameterDefn<float>("AvatarFriction", "Factor to reduce movement against an avatar. Changed on avatar recreation.", 526 new ParameterDefn<float>("AvatarFriction", "Factor to reduce movement against an avatar. Changed on avatar recreation.",
532 0.2f, 527 0.2f ),
533 (s) => { return AvatarFriction; },
534 (s,v) => { AvatarFriction = v; } ),
535 new ParameterDefn<float>("AvatarStandingFriction", "Avatar friction when standing. Changed on avatar recreation.", 528 new ParameterDefn<float>("AvatarStandingFriction", "Avatar friction when standing. Changed on avatar recreation.",
536 0.95f, 529 0.95f ),
537 (s) => { return AvatarStandingFriction; },
538 (s,v) => { AvatarStandingFriction = v; } ),
539 new ParameterDefn<float>("AvatarAlwaysRunFactor", "Speed multiplier if avatar is set to always run", 530 new ParameterDefn<float>("AvatarAlwaysRunFactor", "Speed multiplier if avatar is set to always run",
540 1.3f, 531 1.3f ),
541 (s) => { return AvatarAlwaysRunFactor; },
542 (s,v) => { AvatarAlwaysRunFactor = v; } ),
543 new ParameterDefn<float>("AvatarDensity", "Density of an avatar. Changed on avatar recreation.", 532 new ParameterDefn<float>("AvatarDensity", "Density of an avatar. Changed on avatar recreation.",
544 3.5f, 533 3.5f) ,
545 (s) => { return AvatarDensity; },
546 (s,v) => { AvatarDensity = v; } ),
547 new ParameterDefn<float>("AvatarRestitution", "Bouncyness. Changed on avatar recreation.", 534 new ParameterDefn<float>("AvatarRestitution", "Bouncyness. Changed on avatar recreation.",
548 0f, 535 0f ),
549 (s) => { return AvatarRestitution; },
550 (s,v) => { AvatarRestitution = v; } ),
551 new ParameterDefn<float>("AvatarCapsuleWidth", "The distance between the sides of the avatar capsule", 536 new ParameterDefn<float>("AvatarCapsuleWidth", "The distance between the sides of the avatar capsule",
552 0.6f, 537 0.6f ) ,
553 (s) => { return AvatarCapsuleWidth; },
554 (s,v) => { AvatarCapsuleWidth = v; } ),
555 new ParameterDefn<float>("AvatarCapsuleDepth", "The distance between the front and back of the avatar capsule", 538 new ParameterDefn<float>("AvatarCapsuleDepth", "The distance between the front and back of the avatar capsule",
556 0.45f, 539 0.45f ),
557 (s) => { return AvatarCapsuleDepth; },
558 (s,v) => { AvatarCapsuleDepth = v; } ),
559 new ParameterDefn<float>("AvatarCapsuleHeight", "Default height of space around avatar", 540 new ParameterDefn<float>("AvatarCapsuleHeight", "Default height of space around avatar",
560 1.5f, 541 1.5f ),
561 (s) => { return AvatarCapsuleHeight; },
562 (s,v) => { AvatarCapsuleHeight = v; } ),
563 new ParameterDefn<float>("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions", 542 new ParameterDefn<float>("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions",
564 0.1f, 543 0.1f ),
565 (s) => { return AvatarContactProcessingThreshold; },
566 (s,v) => { AvatarContactProcessingThreshold = v; } ),
567 new ParameterDefn<float>("AvatarBelowGroundUpCorrectionMeters", "Meters to move avatar up if it seems to be below ground", 544 new ParameterDefn<float>("AvatarBelowGroundUpCorrectionMeters", "Meters to move avatar up if it seems to be below ground",
568 1.0f, 545 1.0f ),
569 (s) => { return AvatarBelowGroundUpCorrectionMeters; },
570 (s,v) => { AvatarBelowGroundUpCorrectionMeters = v; } ),
571 new ParameterDefn<float>("AvatarStepHeight", "Height of a step obstacle to consider step correction", 546 new ParameterDefn<float>("AvatarStepHeight", "Height of a step obstacle to consider step correction",
572 0.6f, 547 0.6f ) ,
573 (s) => { return AvatarStepHeight; },
574 (s,v) => { AvatarStepHeight = v; } ),
575 new ParameterDefn<float>("AvatarStepApproachFactor", "Factor to control angle of approach to step (0=straight on)", 548 new ParameterDefn<float>("AvatarStepApproachFactor", "Factor to control angle of approach to step (0=straight on)",
576 0.6f, 549 0.6f ),
577 (s) => { return AvatarStepApproachFactor; },
578 (s,v) => { AvatarStepApproachFactor = v; } ),
579 new ParameterDefn<float>("AvatarStepForceFactor", "Controls the amount of force up applied to step up onto a step", 550 new ParameterDefn<float>("AvatarStepForceFactor", "Controls the amount of force up applied to step up onto a step",
580 1.0f, 551 1.0f ),
581 (s) => { return AvatarStepForceFactor; },
582 (s,v) => { AvatarStepForceFactor = v; } ),
583 new ParameterDefn<float>("AvatarStepUpCorrectionFactor", "Multiplied by height of step collision to create up movement at step", 552 new ParameterDefn<float>("AvatarStepUpCorrectionFactor", "Multiplied by height of step collision to create up movement at step",
584 1.0f, 553 1.0f ),
585 (s) => { return AvatarStepUpCorrectionFactor; },
586 (s,v) => { AvatarStepUpCorrectionFactor = v; } ),
587 new ParameterDefn<int>("AvatarStepSmoothingSteps", "Number of frames after a step collision that we continue walking up stairs", 554 new ParameterDefn<int>("AvatarStepSmoothingSteps", "Number of frames after a step collision that we continue walking up stairs",
588 2, 555 2 ),
589 (s) => { return AvatarStepSmoothingSteps; },
590 (s,v) => { AvatarStepSmoothingSteps = v; } ),
591 556
592 new ParameterDefn<float>("VehicleMaxLinearVelocity", "Maximum velocity magnitude that can be assigned to a vehicle", 557 new ParameterDefn<float>("VehicleMaxLinearVelocity", "Maximum velocity magnitude that can be assigned to a vehicle",
593 1000.0f, 558 1000.0f,
@@ -598,37 +563,21 @@ public static class BSParam
598 (s) => { return (float)VehicleMaxAngularVelocity; }, 563 (s) => { return (float)VehicleMaxAngularVelocity; },
599 (s,v) => { VehicleMaxAngularVelocity = v; VehicleMaxAngularVelocitySq = v * v; } ), 564 (s,v) => { VehicleMaxAngularVelocity = v; VehicleMaxAngularVelocitySq = v * v; } ),
600 new ParameterDefn<float>("VehicleAngularDamping", "Factor to damp vehicle angular movement per second (0.0 - 1.0)", 565 new ParameterDefn<float>("VehicleAngularDamping", "Factor to damp vehicle angular movement per second (0.0 - 1.0)",
601 0.0f, 566 0.0f ),
602 (s) => { return VehicleAngularDamping; },
603 (s,v) => { VehicleAngularDamping = v; } ),
604 new ParameterDefn<Vector3>("VehicleLinearFactor", "Fraction of physical linear changes applied to vehicle (<0,0,0> to <1,1,1>)", 567 new ParameterDefn<Vector3>("VehicleLinearFactor", "Fraction of physical linear changes applied to vehicle (<0,0,0> to <1,1,1>)",
605 new Vector3(1f, 1f, 1f), 568 new Vector3(1f, 1f, 1f) ),
606 (s) => { return VehicleLinearFactor; },
607 (s,v) => { VehicleLinearFactor = v; } ),
608 new ParameterDefn<Vector3>("VehicleAngularFactor", "Fraction of physical angular changes applied to vehicle (<0,0,0> to <1,1,1>)", 569 new ParameterDefn<Vector3>("VehicleAngularFactor", "Fraction of physical angular changes applied to vehicle (<0,0,0> to <1,1,1>)",
609 new Vector3(1f, 1f, 1f), 570 new Vector3(1f, 1f, 1f) ),
610 (s) => { return VehicleAngularFactor; },
611 (s,v) => { VehicleAngularFactor = v; } ),
612 new ParameterDefn<float>("VehicleFriction", "Friction of vehicle on the ground (0.0 - 1.0)", 571 new ParameterDefn<float>("VehicleFriction", "Friction of vehicle on the ground (0.0 - 1.0)",
613 0.0f, 572 0.0f ),
614 (s) => { return VehicleFriction; },
615 (s,v) => { VehicleFriction = v; } ),
616 new ParameterDefn<float>("VehicleRestitution", "Bouncyness factor for vehicles (0.0 - 1.0)", 573 new ParameterDefn<float>("VehicleRestitution", "Bouncyness factor for vehicles (0.0 - 1.0)",
617 0.0f, 574 0.0f ),
618 (s) => { return VehicleRestitution; },
619 (s,v) => { VehicleRestitution = v; } ),
620 new ParameterDefn<float>("VehicleGroundGravityFudge", "Factor to multiply gravity if a ground vehicle is probably on the ground (0.0 - 1.0)", 575 new ParameterDefn<float>("VehicleGroundGravityFudge", "Factor to multiply gravity if a ground vehicle is probably on the ground (0.0 - 1.0)",
621 0.2f, 576 0.2f ),
622 (s) => { return VehicleGroundGravityFudge; },
623 (s,v) => { VehicleGroundGravityFudge = v; } ),
624 new ParameterDefn<float>("VehicleAngularBankingTimescaleFudge", "Factor to multiple angular banking timescale. Tune to increase realism.", 577 new ParameterDefn<float>("VehicleAngularBankingTimescaleFudge", "Factor to multiple angular banking timescale. Tune to increase realism.",
625 60.0f, 578 60.0f ),
626 (s) => { return VehicleAngularBankingTimescaleFudge; },
627 (s,v) => { VehicleAngularBankingTimescaleFudge = v; } ),
628 new ParameterDefn<bool>("VehicleDebuggingEnable", "Turn on/off vehicle debugging", 579 new ParameterDefn<bool>("VehicleDebuggingEnable", "Turn on/off vehicle debugging",
629 false, 580 false ),
630 (s) => { return VehicleDebuggingEnabled; },
631 (s,v) => { VehicleDebuggingEnabled = v; } ),
632 581
633 new ParameterDefn<float>("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default of 4096)", 582 new ParameterDefn<float>("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default of 4096)",
634 0f, 583 0f,
@@ -673,99 +622,53 @@ public static class BSParam
673 (s,v) => { GlobalContactBreakingThreshold = v; s.UnmanagedParams[0].globalContactBreakingThreshold = v; } ), 622 (s,v) => { GlobalContactBreakingThreshold = v; s.UnmanagedParams[0].globalContactBreakingThreshold = v; } ),
674 623
675 new ParameterDefn<int>("CSHullMaxDepthSplit", "CS impl: max depth to split for hull. 1-10 but > 7 is iffy", 624 new ParameterDefn<int>("CSHullMaxDepthSplit", "CS impl: max depth to split for hull. 1-10 but > 7 is iffy",
676 7, 625 7 ),
677 (s) => { return CSHullMaxDepthSplit; },
678 (s,v) => { CSHullMaxDepthSplit = v; } ),
679 new ParameterDefn<int>("CSHullMaxDepthSplitForSimpleShapes", "CS impl: max depth setting for simple prim shapes", 626 new ParameterDefn<int>("CSHullMaxDepthSplitForSimpleShapes", "CS impl: max depth setting for simple prim shapes",
680 2, 627 2 ),
681 (s) => { return CSHullMaxDepthSplitForSimpleShapes; },
682 (s,v) => { CSHullMaxDepthSplitForSimpleShapes = v; } ),
683 new ParameterDefn<float>("CSHullConcavityThresholdPercent", "CS impl: concavity threshold percent (0-20)", 628 new ParameterDefn<float>("CSHullConcavityThresholdPercent", "CS impl: concavity threshold percent (0-20)",
684 5f, 629 5f ),
685 (s) => { return CSHullConcavityThresholdPercent; },
686 (s,v) => { CSHullConcavityThresholdPercent = v; } ),
687 new ParameterDefn<float>("CSHullVolumeConservationThresholdPercent", "percent volume conservation to collapse hulls (0-30)", 630 new ParameterDefn<float>("CSHullVolumeConservationThresholdPercent", "percent volume conservation to collapse hulls (0-30)",
688 5f, 631 5f ),
689 (s) => { return CSHullVolumeConservationThresholdPercent; },
690 (s,v) => { CSHullVolumeConservationThresholdPercent = v; } ),
691 new ParameterDefn<int>("CSHullMaxVertices", "CS impl: maximum number of vertices in output hulls. Keep < 50.", 632 new ParameterDefn<int>("CSHullMaxVertices", "CS impl: maximum number of vertices in output hulls. Keep < 50.",
692 32, 633 32 ),
693 (s) => { return CSHullMaxVertices; },
694 (s,v) => { CSHullMaxVertices = v; } ),
695 new ParameterDefn<float>("CSHullMaxSkinWidth", "CS impl: skin width to apply to output hulls.", 634 new ParameterDefn<float>("CSHullMaxSkinWidth", "CS impl: skin width to apply to output hulls.",
696 0f, 635 0f ),
697 (s) => { return CSHullMaxSkinWidth; },
698 (s,v) => { CSHullMaxSkinWidth = v; } ),
699 636
700 new ParameterDefn<float>("BHullMaxVerticesPerHull", "Bullet impl: max number of vertices per created hull", 637 new ParameterDefn<float>("BHullMaxVerticesPerHull", "Bullet impl: max number of vertices per created hull",
701 100f, 638 100f ),
702 (s) => { return BHullMaxVerticesPerHull; },
703 (s,v) => { BHullMaxVerticesPerHull = v; } ),
704 new ParameterDefn<float>("BHullMinClusters", "Bullet impl: minimum number of hulls to create per mesh", 639 new ParameterDefn<float>("BHullMinClusters", "Bullet impl: minimum number of hulls to create per mesh",
705 2f, 640 2f ),
706 (s) => { return BHullMinClusters; },
707 (s,v) => { BHullMinClusters = v; } ),
708 new ParameterDefn<float>("BHullCompacityWeight", "Bullet impl: weight factor for how compact to make hulls", 641 new ParameterDefn<float>("BHullCompacityWeight", "Bullet impl: weight factor for how compact to make hulls",
709 2f, 642 0.1f ),
710 (s) => { return BHullCompacityWeight; },
711 (s,v) => { BHullCompacityWeight = v; } ),
712 new ParameterDefn<float>("BHullVolumeWeight", "Bullet impl: weight factor for volume in created hull", 643 new ParameterDefn<float>("BHullVolumeWeight", "Bullet impl: weight factor for volume in created hull",
713 0.1f, 644 0f ),
714 (s) => { return BHullVolumeWeight; },
715 (s,v) => { BHullVolumeWeight = v; } ),
716 new ParameterDefn<float>("BHullConcavity", "Bullet impl: weight factor for how convex a created hull can be", 645 new ParameterDefn<float>("BHullConcavity", "Bullet impl: weight factor for how convex a created hull can be",
717 100f, 646 100f ),
718 (s) => { return BHullConcavity; },
719 (s,v) => { BHullConcavity = v; } ),
720 new ParameterDefn<bool>("BHullAddExtraDistPoints", "Bullet impl: whether to add extra vertices for long distance vectors", 647 new ParameterDefn<bool>("BHullAddExtraDistPoints", "Bullet impl: whether to add extra vertices for long distance vectors",
721 false, 648 false ),
722 (s) => { return BHullAddExtraDistPoints; },
723 (s,v) => { BHullAddExtraDistPoints = v; } ),
724 new ParameterDefn<bool>("BHullAddNeighboursDistPoints", "Bullet impl: whether to add extra vertices between neighbor hulls", 649 new ParameterDefn<bool>("BHullAddNeighboursDistPoints", "Bullet impl: whether to add extra vertices between neighbor hulls",
725 false, 650 false ),
726 (s) => { return BHullAddNeighboursDistPoints; },
727 (s,v) => { BHullAddNeighboursDistPoints = v; } ),
728 new ParameterDefn<bool>("BHullAddFacesPoints", "Bullet impl: whether to add extra vertices to break up hull faces", 651 new ParameterDefn<bool>("BHullAddFacesPoints", "Bullet impl: whether to add extra vertices to break up hull faces",
729 false, 652 false ),
730 (s) => { return BHullAddFacesPoints; },
731 (s,v) => { BHullAddFacesPoints = v; } ),
732 new ParameterDefn<bool>("BHullShouldAdjustCollisionMargin", "Bullet impl: whether to shrink resulting hulls to account for collision margin", 653 new ParameterDefn<bool>("BHullShouldAdjustCollisionMargin", "Bullet impl: whether to shrink resulting hulls to account for collision margin",
733 false, 654 false ),
734 (s) => { return BHullShouldAdjustCollisionMargin; },
735 (s,v) => { BHullShouldAdjustCollisionMargin = v; } ),
736 655
737 new ParameterDefn<float>("LinksetImplementation", "Type of linkset implementation (0=Constraint, 1=Compound, 2=Manual)", 656 new ParameterDefn<float>("LinksetImplementation", "Type of linkset implementation (0=Constraint, 1=Compound, 2=Manual)",
738 (float)BSLinkset.LinksetImplementation.Compound, 657 (float)BSLinkset.LinksetImplementation.Compound ),
739 (s) => { return LinksetImplementation; },
740 (s,v) => { LinksetImplementation = v; } ),
741 new ParameterDefn<bool>("LinkConstraintUseFrameOffset", "For linksets built with constraints, enable frame offsetFor linksets built with constraints, enable frame offset.", 658 new ParameterDefn<bool>("LinkConstraintUseFrameOffset", "For linksets built with constraints, enable frame offsetFor linksets built with constraints, enable frame offset.",
742 false, 659 false ),
743 (s) => { return LinkConstraintUseFrameOffset; },
744 (s,v) => { LinkConstraintUseFrameOffset = v; } ),
745 new ParameterDefn<bool>("LinkConstraintEnableTransMotor", "Whether to enable translational motor on linkset constraints", 660 new ParameterDefn<bool>("LinkConstraintEnableTransMotor", "Whether to enable translational motor on linkset constraints",
746 true, 661 true ),
747 (s) => { return LinkConstraintEnableTransMotor; },
748 (s,v) => { LinkConstraintEnableTransMotor = v; } ),
749 new ParameterDefn<float>("LinkConstraintTransMotorMaxVel", "Maximum velocity to be applied by translational motor in linkset constraints", 662 new ParameterDefn<float>("LinkConstraintTransMotorMaxVel", "Maximum velocity to be applied by translational motor in linkset constraints",
750 5.0f, 663 5.0f ),
751 (s) => { return LinkConstraintTransMotorMaxVel; },
752 (s,v) => { LinkConstraintTransMotorMaxVel = v; } ),
753 new ParameterDefn<float>("LinkConstraintTransMotorMaxForce", "Maximum force to be applied by translational motor in linkset constraints", 664 new ParameterDefn<float>("LinkConstraintTransMotorMaxForce", "Maximum force to be applied by translational motor in linkset constraints",
754 0.1f, 665 0.1f ),
755 (s) => { return LinkConstraintTransMotorMaxForce; },
756 (s,v) => { LinkConstraintTransMotorMaxForce = v; } ),
757 new ParameterDefn<float>("LinkConstraintCFM", "Amount constraint can be violated. 0=no violation, 1=infinite. Default=0.1", 666 new ParameterDefn<float>("LinkConstraintCFM", "Amount constraint can be violated. 0=no violation, 1=infinite. Default=0.1",
758 0.1f, 667 0.1f ),
759 (s) => { return LinkConstraintCFM; },
760 (s,v) => { LinkConstraintCFM = v; } ),
761 new ParameterDefn<float>("LinkConstraintERP", "Amount constraint is corrected each tick. 0=none, 1=all. Default = 0.2", 668 new ParameterDefn<float>("LinkConstraintERP", "Amount constraint is corrected each tick. 0=none, 1=all. Default = 0.2",
762 0.1f, 669 0.1f ),
763 (s) => { return LinkConstraintERP; },
764 (s,v) => { LinkConstraintERP = v; } ),
765 new ParameterDefn<float>("LinkConstraintSolverIterations", "Number of solver iterations when computing constraint. (0 = Bullet default)", 670 new ParameterDefn<float>("LinkConstraintSolverIterations", "Number of solver iterations when computing constraint. (0 = Bullet default)",
766 40, 671 40 ),
767 (s) => { return LinkConstraintSolverIterations; },
768 (s,v) => { LinkConstraintSolverIterations = v; } ),
769 672
770 new ParameterDefn<int>("PhysicsMetricFrames", "Frames between outputting detailed phys metrics. (0 is off)", 673 new ParameterDefn<int>("PhysicsMetricFrames", "Frames between outputting detailed phys metrics. (0 is off)",
771 0, 674 0,