diff options
author | Robert Adams | 2012-07-31 09:23:05 -0700 |
---|---|---|
committer | Robert Adams | 2012-07-31 09:23:05 -0700 |
commit | 50dbb9ffe480b08f13f7bebb8259193dc00f88dd (patch) | |
tree | 20a35e254d4ec9180b75af2e0a02e61dec53e028 /OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-50dbb9ffe480b08f13f7bebb8259193dc00f88dd.zip opensim-SC_OLD-50dbb9ffe480b08f13f7bebb8259193dc00f88dd.tar.gz opensim-SC_OLD-50dbb9ffe480b08f13f7bebb8259193dc00f88dd.tar.bz2 opensim-SC_OLD-50dbb9ffe480b08f13f7bebb8259193dc00f88dd.tar.xz |
BulletSim: add parameters and API calls for setting ERP and CFM.
Set ERP and CFM in linkset constraints.
Reorder rebuilding of object bodies so they are not rebuilt everytime
something is linked and unlinked.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs index fbb9e21..07f5a21 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSConstraint.cs | |||
@@ -50,7 +50,8 @@ public class BSConstraint : IDisposable | |||
50 | m_body2 = obj2; | 50 | m_body2 = obj2; |
51 | m_constraint = new BulletConstraint(BulletSimAPI.CreateConstraint2(m_world.Ptr, m_body1.Ptr, m_body2.Ptr, | 51 | m_constraint = new BulletConstraint(BulletSimAPI.CreateConstraint2(m_world.Ptr, m_body1.Ptr, m_body2.Ptr, |
52 | frame1, frame1rot, | 52 | frame1, frame1rot, |
53 | frame2, frame2rot)); | 53 | frame2, frame2rot, |
54 | true /*useLinearReferenceFrameA*/, true /*disableCollisionsBetweenLinkedBodies*/)); | ||
54 | m_enabled = true; | 55 | m_enabled = true; |
55 | } | 56 | } |
56 | 57 | ||
@@ -83,6 +84,15 @@ public class BSConstraint : IDisposable | |||
83 | return ret; | 84 | return ret; |
84 | } | 85 | } |
85 | 86 | ||
87 | public bool SetCFMAndERP(float cfm, float erp) | ||
88 | { | ||
89 | bool ret = false; | ||
90 | BulletSimAPI.SetConstraintParam2(m_constraint.Ptr, ConstraintParams.BT_CONSTRAINT_STOP_CFM, cfm, ConstraintParamAxis.AXIS_ALL); | ||
91 | BulletSimAPI.SetConstraintParam2(m_constraint.Ptr, ConstraintParams.BT_CONSTRAINT_STOP_ERP, erp, ConstraintParamAxis.AXIS_ALL); | ||
92 | BulletSimAPI.SetConstraintParam2(m_constraint.Ptr, ConstraintParams.BT_CONSTRAINT_CFM, cfm, ConstraintParamAxis.AXIS_ALL); | ||
93 | return ret; | ||
94 | } | ||
95 | |||
86 | public bool UseFrameOffset(bool useOffset) | 96 | public bool UseFrameOffset(bool useOffset) |
87 | { | 97 | { |
88 | bool ret = false; | 98 | bool ret = false; |