BulletSim: add BSConstraint.RecomputConstraintVariables for the recomputation after linksets changed, etc
parent
6f1f299619
commit
c1c1d48af1
|
@ -80,10 +80,27 @@ public abstract class BSConstraint : IDisposable
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
if (m_enabled)
|
if (m_enabled)
|
||||||
{
|
{
|
||||||
|
// Recompute the internal transforms
|
||||||
BulletSimAPI.CalculateTransforms2(m_constraint.Ptr);
|
BulletSimAPI.CalculateTransforms2(m_constraint.Ptr);
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset this constraint making sure it has all its internal structures
|
||||||
|
// recomputed and is enabled and ready to go.
|
||||||
|
public virtual bool RecomputeConstraintVariables(float mass)
|
||||||
|
{
|
||||||
|
bool ret = false;
|
||||||
|
if (m_enabled)
|
||||||
|
{
|
||||||
|
ret = CalculateTransforms();
|
||||||
|
if (ret)
|
||||||
|
{
|
||||||
|
BulletSimAPI.SetConstraintEnable2(m_constraint.Ptr, m_world.scene.NumericBool(true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue