mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 11:57:03 +08:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user