BulletSim: set mass for single prim linksets when going physical. This fixes single prim vehicles not working (the surf board now zooms).

0.7.5-pf-bulletsim
Robert Adams 2012-12-11 00:02:20 -08:00
parent 93393fb975
commit ebf30e7ba6
1 changed files with 8 additions and 1 deletions

View File

@ -110,12 +110,19 @@ public sealed class BSLinksetCompound : BSLinkset
{ {
bool ret = false; bool ret = false;
DetailLog("{0},BSLinksetCompound.MakeDynamic,call,IsRoot={1}", child.LocalID, IsRoot(child)); DetailLog("{0},BSLinksetCompound.MakeDynamic,call,IsRoot={1}", child.LocalID, IsRoot(child));
if (!IsRoot(child)) if (IsRoot(child))
{
// The root is going dynamic. Make sure mass is properly set.
m_mass = ComputeLinksetMass();
}
else
{ {
// The origional prims are removed from the world as the shape of the root compound // The origional prims are removed from the world as the shape of the root compound
// shape takes over. // shape takes over.
BulletSimAPI.AddToCollisionFlags2(child.PhysBody.ptr, CollisionFlags.CF_NO_CONTACT_RESPONSE); BulletSimAPI.AddToCollisionFlags2(child.PhysBody.ptr, CollisionFlags.CF_NO_CONTACT_RESPONSE);
BulletSimAPI.ForceActivationState2(child.PhysBody.ptr, ActivationState.DISABLE_SIMULATION); BulletSimAPI.ForceActivationState2(child.PhysBody.ptr, ActivationState.DISABLE_SIMULATION);
// We don't want collisions from the old linkset children.
BulletSimAPI.RemoveFromCollisionFlags2(child.PhysBody.ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS);
ret = true; ret = true;
} }
return ret; return ret;