mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 11:57:03 +08:00
BulletSim: rearrange code and add some tests to try and resolve the
initialization race conditions reported in Mantis 6792. When a region is initializing it seems that the prim initialization code can be interrupted part way through then taints are processed for prims that are not completely there.
This commit is contained in:
@@ -322,7 +322,7 @@ public abstract class BSLinkset
|
||||
bool ret = true;
|
||||
this.ForEachMember((member) =>
|
||||
{
|
||||
if (member.IsIncomplete || member.PrimAssetState == BSPhysObject.PrimAssetCondition.Waiting)
|
||||
if ((!member.IsInitialized) || member.IsIncomplete || member.PrimAssetState == BSPhysObject.PrimAssetCondition.Waiting)
|
||||
{
|
||||
ret = false;
|
||||
return true; // exit loop
|
||||
|
||||
@@ -83,11 +83,6 @@ public abstract class BSPhysObject : PhysicsActor
|
||||
// The collection of things that push me around
|
||||
PhysicalActors = new BSActorCollection(PhysScene);
|
||||
|
||||
// Initialize variables kept in base.
|
||||
GravModifier = 1.0f;
|
||||
Gravity = new OMV.Vector3(0f, 0f, BSParam.Gravity);
|
||||
HoverActive = false;
|
||||
|
||||
// We don't have any physical representation yet.
|
||||
PhysBody = new BulletBody(localID);
|
||||
PhysShape = new BSShapeNull();
|
||||
@@ -96,6 +91,12 @@ public abstract class BSPhysObject : PhysicsActor
|
||||
|
||||
PrimAssetState = PrimAssetCondition.Unknown;
|
||||
|
||||
// Initialize variables kept in base.
|
||||
// Beware that these cause taints to be queued whch can cause race conditions on startup.
|
||||
GravModifier = 1.0f;
|
||||
Gravity = new OMV.Vector3(0f, 0f, BSParam.Gravity);
|
||||
HoverActive = false;
|
||||
|
||||
// Default material type. Also sets Friction, Restitution and Density.
|
||||
SetMaterial((int)MaterialAttributes.Material.Wood);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user