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/BSLinksetConstraints.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs index d95f223..6b592e7 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs @@ -46,6 +46,8 @@ public sealed class BSLinksetConstraints : BSLinkset // refresh will happen once after all the other taints are applied. public override void Refresh(BSPhysObject requestor) { + base.Refresh(requestor); + // Queue to happen after all the other taint processing PhysicsScene.PostTaintObject("BSLinksetContraints.Refresh", requestor.LocalID, delegate() { @@ -279,7 +281,7 @@ public sealed class BSLinksetConstraints : BSLinkset private void RecomputeLinksetConstraints() { float linksetMass = LinksetMass; - LinksetRoot.UpdatePhysicalMassProperties(linksetMass); + LinksetRoot.UpdatePhysicalMassProperties(linksetMass, true); // DEBUG: see of inter-linkset collisions are causing problems // BulletSimAPI.SetCollisionFilterMask2(LinksetRoot.BSBody.ptr, @@ -292,7 +294,7 @@ public sealed class BSLinksetConstraints : BSLinkset // A child in the linkset physically shows the mass of the whole linkset. // This allows Bullet to apply enough force on the child to move the whole linkset. // (Also do the mass stuff before recomputing the constraint so mass is not zero.) - child.UpdatePhysicalMassProperties(linksetMass); + child.UpdatePhysicalMassProperties(linksetMass, true); BSConstraint constrain; if (!PhysicsScene.Constraints.TryGetConstraint(LinksetRoot.PhysBody, child.PhysBody, out constrain)) -- cgit v1.1