From 80cee1b85a646045c02e2bb675056d532ce2fe27 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 24 Dec 2012 08:56:02 -0800 Subject: BulletSim: Fix single physical prim reporting its mass as zero. Properly return root mass as mass of just the root prim rather than the mass of the linkset. SOG has the logic to add the masses together to get the linkset mass. Update TODO list. --- OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs index 8580928..756faed 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs @@ -97,14 +97,7 @@ public abstract class BSLinkset } // We keep the prim's mass in the linkset structure since it could be dependent on other prims - protected float m_mass; - public float LinksetMass - { - get - { - return m_mass; - } - } + public float LinksetMass { get; protected set; } public virtual bool LinksetIsColliding { get { return false; } } @@ -128,7 +121,7 @@ public abstract class BSLinkset PhysicsScene = scene; LinksetRoot = parent; m_children = new HashSet(); - m_mass = parent.RawMass; + LinksetMass = parent.RawMass; Rebuilding = false; } @@ -143,7 +136,7 @@ public abstract class BSLinkset // Don't add the root to its own linkset if (!IsRoot(child)) AddChildToLinkset(child); - m_mass = ComputeLinksetMass(); + LinksetMass = ComputeLinksetMass(); } return this; } @@ -162,7 +155,7 @@ public abstract class BSLinkset return this; } RemoveChildFromLinkset(child); - m_mass = ComputeLinksetMass(); + LinksetMass = ComputeLinksetMass(); } // The child is down to a linkset of just itself @@ -230,7 +223,10 @@ public abstract class BSLinkset // When physical properties are changed the linkset needs to recalculate // its internal properties. // May be called at runtime or taint-time. - public abstract void Refresh(BSPhysObject requestor); + public virtual void Refresh(BSPhysObject requestor) + { + LinksetMass = ComputeLinksetMass(); + } // Flag denoting the linkset is in the process of being rebuilt. // Used to know not the schedule a rebuild in the middle of a rebuild. -- cgit v1.1