diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs index 8688485..c879143 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |||
@@ -1111,13 +1111,21 @@ public sealed class BSPrim : BSPhysObject | |||
1111 | // Undo me from any possible linkset so, if body is rebuilt, the link will get restored. | 1111 | // Undo me from any possible linkset so, if body is rebuilt, the link will get restored. |
1112 | // NOTE that the new linkset is not set. This saves the handle to the linkset | 1112 | // NOTE that the new linkset is not set. This saves the handle to the linkset |
1113 | // so we can add ourselves back when shape mangling is complete. | 1113 | // so we can add ourselves back when shape mangling is complete. |
1114 | Linkset.RemoveMeFromLinkset(this); | 1114 | bool needToRestoreLinkset = false; |
1115 | 1115 | ||
1116 | // Create the correct physical representation for this type of object. | 1116 | // Create the correct physical representation for this type of object. |
1117 | // Updates BSBody and BSShape with the new information. | 1117 | // Updates BSBody and BSShape with the new information. |
1118 | PhysicsScene.Shapes.GetBodyAndShape(forceRebuild, PhysicsScene.World, this, shapeData, _pbs); | 1118 | PhysicsScene.Shapes.GetBodyAndShape(forceRebuild, PhysicsScene.World, this, shapeData, _pbs, |
1119 | null, delegate(BulletBody dBody) | ||
1120 | { | ||
1121 | // Called if the current prim body is about to be destroyed. | ||
1122 | // The problem is the constraints for Linksets which need to be updated for the new body. | ||
1123 | Linkset.RemoveBodyDependencies(this); | ||
1124 | needToRestoreLinkset = true; | ||
1125 | }); | ||
1119 | 1126 | ||
1120 | Linkset = Linkset.AddMeToLinkset(this); | 1127 | if (needToRestoreLinkset) |
1128 | Linkset.RestoreBodyDependencies(this); | ||
1121 | 1129 | ||
1122 | // Make sure the properties are set on the new object | 1130 | // Make sure the properties are set on the new object |
1123 | UpdatePhysicalParameters(); | 1131 | UpdatePhysicalParameters(); |