aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
diff options
context:
space:
mode:
authorRobert Adams2012-07-25 14:52:17 -0700
committerRobert Adams2012-07-25 16:31:08 -0700
commitd7add2940a38437e748ca74163bbf37acecfa04c (patch)
tree9628de187941813fc3f9cf3348786c43dd6c50c6 /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
parentBulletSim: small change to use the pointer to the bullet object for zeroing f... (diff)
downloadopensim-SC-d7add2940a38437e748ca74163bbf37acecfa04c.zip
opensim-SC-d7add2940a38437e748ca74163bbf37acecfa04c.tar.gz
opensim-SC-d7add2940a38437e748ca74163bbf37acecfa04c.tar.bz2
opensim-SC-d7add2940a38437e748ca74163bbf37acecfa04c.tar.xz
BulletSim: add parameters for setting linkset constraint factors
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs25
1 files changed, 23 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 07a377b..a1587a8 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -1025,6 +1025,27 @@ public class BSScene : PhysicsScene, IPhysicsParameters
1025 (s) => { return s.m_params[0].numberOfSolverIterations; }, 1025 (s) => { return s.m_params[0].numberOfSolverIterations; },
1026 (s,p,l,v) => { s.m_params[0].numberOfSolverIterations = v; } ), 1026 (s,p,l,v) => { s.m_params[0].numberOfSolverIterations = v; } ),
1027 1027
1028 new ParameterDefn("LinkConstraintUseFrameOffset", "For linksets built with constraints, enable frame offsetFor linksets built with constraints, enable frame offset.",
1029 ConfigurationParameters.numericTrue,
1030 (s,cf,p,v) => { s.m_params[0].linkConstraintUseFrameOffset = s.NumericBool(cf.GetBoolean(p, s.BoolNumeric(v))); },
1031 (s) => { return s.m_params[0].linkConstraintUseFrameOffset; },
1032 (s,p,l,v) => { s.m_params[0].linkConstraintUseFrameOffset = v; } ),
1033 new ParameterDefn("LinkConstraintEnableTransMotor", "Whether to enable translational motor on linkset constraints",
1034 ConfigurationParameters.numericTrue,
1035 (s,cf,p,v) => { s.m_params[0].linkConstraintEnableTransMotor = s.NumericBool(cf.GetBoolean(p, s.BoolNumeric(v))); },
1036 (s) => { return s.m_params[0].linkConstraintEnableTransMotor; },
1037 (s,p,l,v) => { s.m_params[0].linkConstraintEnableTransMotor = v; } ),
1038 new ParameterDefn("LinkConstraintTransMotorMaxVel", "Maximum velocity to be applied by translational motor in linkset constraints",
1039 5.0f,
1040 (s,cf,p,v) => { s.m_params[0].linkConstraintTransMotorMaxVel = cf.GetFloat(p, v); },
1041 (s) => { return s.m_params[0].linkConstraintTransMotorMaxVel; },
1042 (s,p,l,v) => { s.m_params[0].linkConstraintTransMotorMaxVel = v; } ),
1043 new ParameterDefn("LinkConstraintTransMotorMaxForce", "Maximum force to be applied by translational motor in linkset constraints",
1044 0.1f,
1045 (s,cf,p,v) => { s.m_params[0].linkConstraintTransMotorMaxForce = cf.GetFloat(p, v); },
1046 (s) => { return s.m_params[0].linkConstraintTransMotorMaxForce; },
1047 (s,p,l,v) => { s.m_params[0].linkConstraintTransMotorMaxForce = v; } ),
1048
1028 new ParameterDefn("DetailedStats", "Frames between outputting detailed phys stats. (0 is off)", 1049 new ParameterDefn("DetailedStats", "Frames between outputting detailed phys stats. (0 is off)",
1029 0f, 1050 0f,
1030 (s,cf,p,v) => { s.m_detailedStatsStep = cf.GetInt(p, (int)v); }, 1051 (s,cf,p,v) => { s.m_detailedStatsStep = cf.GetInt(p, (int)v); },
@@ -1039,13 +1060,13 @@ public class BSScene : PhysicsScene, IPhysicsParameters
1039 }; 1060 };
1040 1061
1041 // Convert a boolean to our numeric true and false values 1062 // Convert a boolean to our numeric true and false values
1042 protected float NumericBool(bool b) 1063 public float NumericBool(bool b)
1043 { 1064 {
1044 return (b ? ConfigurationParameters.numericTrue : ConfigurationParameters.numericFalse); 1065 return (b ? ConfigurationParameters.numericTrue : ConfigurationParameters.numericFalse);
1045 } 1066 }
1046 1067
1047 // Convert numeric true and false values to a boolean 1068 // Convert numeric true and false values to a boolean
1048 protected bool BoolNumeric(float b) 1069 public bool BoolNumeric(float b)
1049 { 1070 {
1050 return (b == ConfigurationParameters.numericTrue ? true : false); 1071 return (b == ConfigurationParameters.numericTrue ? true : false);
1051 } 1072 }