From ebf30e7ba66446d7018346c12111d65a030d2786 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Tue, 11 Dec 2012 00:02:20 -0800 Subject: BulletSim: set mass for single prim linksets when going physical. This fixes single prim vehicles not working (the surf board now zooms). --- OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Physics') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs index fe5b5e3..d2abdb4 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs @@ -110,12 +110,19 @@ public sealed class BSLinksetCompound : BSLinkset { bool ret = false; 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 // shape takes over. BulletSimAPI.AddToCollisionFlags2(child.PhysBody.ptr, CollisionFlags.CF_NO_CONTACT_RESPONSE); 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; } return ret; -- cgit v1.1