diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs index 6b592e75e4..86c29c7530 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs @@ -48,12 +48,15 @@ public sealed class BSLinksetConstraints : BSLinkset { base.Refresh(requestor); - // Queue to happen after all the other taint processing - PhysicsScene.PostTaintObject("BSLinksetContraints.Refresh", requestor.LocalID, delegate() - { - if (HasAnyChildren && IsRoot(requestor)) - RecomputeLinksetConstraints(); - }); + if (HasAnyChildren && IsRoot(requestor)) + { + // Queue to happen after all the other taint processing + PhysicsScene.PostTaintObject("BSLinksetContraints.Refresh", requestor.LocalID, delegate() + { + if (HasAnyChildren && IsRoot(requestor)) + RecomputeLinksetConstraints(); + }); + } } // The object is going dynamic (physical). Do any setup necessary diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs index 73b57643c7..b093890274 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs @@ -67,6 +67,11 @@ public abstract class BSPhysObject : PhysicsActor PhysObjectName = name; TypeName = typeName; + // We don't have any physical representation yet. + PhysBody = new BulletBody(localID); + PhysShape = new BulletShape(); + + // A linkset of just me Linkset = BSLinkset.Factory(PhysicsScene, this); LastAssetBuildFailed = false; diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index 5f3f0d13e2..2de47170f7 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs @@ -111,10 +111,7 @@ public sealed class BSPrim : BSPhysObject _mass = CalculateMass(); - // No body or shape yet - PhysBody = new BulletBody(LocalID); - PhysShape = new BulletShape(); - + // Cause linkset variables to be initialized (like mass) Linkset.Refresh(this); DetailLog("{0},BSPrim.constructor,call", LocalID); diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs index 5ad6746fc4..cd5d1702f4 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimData.cs @@ -35,7 +35,7 @@ namespace OpenSim.Region.Physics.BulletSPlugin // These hold pointers to allocated objects in the unmanaged space. // The physics engine controller class created at initialization -public struct BulletWorld +public class BulletWorld { public BulletWorld(uint worldId, BSScene bss, IntPtr xx) { @@ -50,7 +50,7 @@ public struct BulletWorld } // An allocated Bullet btRigidBody -public struct BulletBody +public class BulletBody { public BulletBody(uint id) : this(id, IntPtr.Zero) { @@ -96,9 +96,14 @@ public struct BulletBody } } -public struct BulletShape +public class BulletShape { - public BulletShape(IntPtr xx) : this(xx, BSPhysicsShapeType.SHAPE_UNKNOWN) + public BulletShape() + : this(IntPtr.Zero, BSPhysicsShapeType.SHAPE_UNKNOWN) + { + } + public BulletShape(IntPtr xx) + : this(xx, BSPhysicsShapeType.SHAPE_UNKNOWN) { } public BulletShape(IntPtr xx, BSPhysicsShapeType typ) @@ -136,7 +141,7 @@ public struct BulletShape } // An allocated Bullet btConstraint -public struct BulletConstraint +public class BulletConstraint { public BulletConstraint(IntPtr xx) { diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt index f805836eaa..8ec9871b06 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimTODO.txt @@ -97,6 +97,9 @@ Selecting and deselecting physical objects causes CPU processing time to jump Re-implement buoyancy as a separate force on the object rather than diddling gravity. Register a pre-step event to add the force. More efficient memory usage when passing hull information from BSPrim to BulletSim +Avatar movement motor check for zero or small movement. Somehow suppress small movements + when avatar has stopped and is just standing. Simple test for near zero has + the problem of preventing starting up (increase from zero) especially when falling. LINKSETS ====================================================== @@ -195,6 +198,7 @@ Should taints check for existance or activeness of target? keeps the object from being freed, but that is just an accident. Possibly have and 'active' flag that is checked by the taint processor? Parameters for physics logging should be moved from BSScene to BSParam (at least boolean ones) +Can some of the physical wrapper classes (BulletBody, BulletWorld, BulletShape) be 'sealed'? THREADING =================================================