BulletSim: add calls for creating all the different Bullet constraint types.

Updated the DLLs and SOs and code for BulletXNA to create the types.
All the detailed control calls are not all in place yet.
This commit is contained in:
Robert Adams
2013-02-17 20:07:04 -08:00
parent 885b45b112
commit 1d7276235a
9 changed files with 338 additions and 47 deletions

View File

@@ -117,8 +117,7 @@ public sealed class BSConstraintCollection : IDisposable
if (this.TryGetConstraint(body1, body2, out constrain))
{
// remove the constraint from our collection
RemoveAndDestroyConstraint(constrain);
ret = true;
ret = RemoveAndDestroyConstraint(constrain);
}
}
@@ -126,17 +125,19 @@ public sealed class BSConstraintCollection : IDisposable
}
// The constraint MUST exist in the collection
// Could be called if the constraint was previously removed.
// Return 'true' if the constraint was actually removed and disposed.
public bool RemoveAndDestroyConstraint(BSConstraint constrain)
{
bool removed = false;
lock (m_constraints)
{
// remove the constraint from our collection
m_constraints.Remove(constrain);
removed = m_constraints.Remove(constrain);
}
// tell the engine that all its structures need to be freed
// Dispose() is safe to call multiple times
constrain.Dispose();
// we destroyed something
return true;
return removed;
}
// Remove all constraints that reference the passed body.