From 9df85eadf4b3719a898fda8769313ae023962c25 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 10 Dec 2012 15:35:53 -0800 Subject: BulletSim: Fix crash on the destruction of physical linksets. While fixing the above, add methods to physical body and shape pointer wrapper so routines won't have to know that IntPtr.Zero means no physical instance. Fix problem with physical linksets failing after a few sits and unsits by properly restoring child prom positions for compound linksets after multiple selection and deselections. --- OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | 8 ++++++++ 1 file changed, 8 insertions(+) (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 0df4310..777c5cb 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs @@ -32,6 +32,14 @@ using OMV = OpenMetaverse; namespace OpenSim.Region.Physics.BulletSPlugin { + +// A BSPrim can get individual information about its linkedness attached +// to it through an instance of a subclass of LinksetInfo. +// Each type of linkset will define the information needed for its type. +public abstract class BSLinksetInfo +{ +} + public abstract class BSLinkset { // private static string LogHeader = "[BULLETSIM LINKSET]"; -- cgit v1.1 From 31d3952477b96b669d8a46d0941ea6d1bc1133b5 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Thu, 13 Dec 2012 16:23:51 -0800 Subject: BulletSim: fix problem with continuious rebuilding of physical linksets. This caused movement problems and large prim vehicles to take up a LOT of simulation time. --- OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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 777c5cb..ce0fbe6 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs @@ -124,7 +124,7 @@ public abstract class BSLinkset get { return ComputeLinksetGeometricCenter(); } } - protected void Initialize(BSScene scene, BSPhysObject parent) + protected BSLinkset(BSScene scene, BSPhysObject parent) { // A simple linkset of one (no children) LinksetID = m_nextLinksetID++; @@ -135,6 +135,7 @@ public abstract class BSLinkset LinksetRoot = parent; m_children = new HashSet(); m_mass = parent.RawMass; + Rebuilding = false; } // Link to a linkset where the child knows the parent. @@ -227,7 +228,7 @@ public abstract class BSLinkset // I am the root of a linkset and a new child is being added // Called while LinkActivity is locked. protected abstract void AddChildToLinkset(BSPhysObject child); - + // I am the root of a linkset and one of my children is being removed. // Safe to call even if the child is not really in my linkset. protected abstract void RemoveChildFromLinkset(BSPhysObject child); @@ -237,6 +238,10 @@ public abstract class BSLinkset // May be called at runtime or taint-time. public abstract void Refresh(BSPhysObject requestor); + // 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. + protected bool Rebuilding { get; set; } + // The object is going dynamic (physical). Do any setup necessary // for a dynamic linkset. // Only the state of the passed object can be modified. The rest of the linkset -- cgit v1.1