28 using System.Collections.Generic;
32 namespace OpenSim.
Region.PhysicsModule.BulletS
37 private static string LogHeader =
"[BULLETSIM CONSTRAINT]";
44 protected bool m_enabled =
false;
50 public bool IsEnabled {
get {
return m_enabled; } }
55 PhysicsScene = m_world.physicsScene;
63 if (m_constraint.HasPhysicalConstraint)
65 bool success = PhysicsScene.PE.DestroyConstraint(m_world, m_constraint);
66 m_world.physicsScene.DetailLog(
"{0},BSConstraint.Dispose,taint,id1={1},body1={2},id2={3},body2={4},success={5}",
68 m_body1.ID, m_body1.AddrString,
69 m_body2.ID, m_body2.AddrString,
81 m_world.physicsScene.DetailLog(
"{0},BSConstraint.SetLinearLimits,taint,low={1},high={2}", m_body1.ID, low, high);
82 ret = PhysicsScene.PE.SetLinearLimits(m_constraint, low, high);
92 m_world.physicsScene.DetailLog(
"{0},BSConstraint.SetAngularLimits,taint,low={1},high={2}", m_body1.ID, low, high);
93 ret = PhysicsScene.PE.SetAngularLimits(m_constraint, low, high);
103 PhysicsScene.PE.SetConstraintNumSolverIterations(m_constraint, cnt);
115 PhysicsScene.PE.CalculateTransforms(m_constraint);
128 ret = CalculateTransforms();
134 PhysicsScene.PE.SetConstraintEnable(m_constraint, BSParam.NumericBool(
true));
138 m_world.physicsScene.Logger.ErrorFormat(
"{0} CalculateTransforms failed. A={1}, B={2}", LogHeader, Body1.ID, Body2.ID);
virtual bool SetAngularLimits(Vector3 low, Vector3 high)
virtual bool CalculateTransforms()
BSConstraint(BulletWorld world)
BulletConstraint m_constraint
virtual bool SetLinearLimits(Vector3 low, Vector3 high)
virtual bool RecomputeConstraintVariables(float mass)
virtual bool SetSolverIterations(float cnt)