diff options
author | Robert Adams | 2012-09-27 19:57:35 -0700 |
---|---|---|
committer | Robert Adams | 2012-09-27 22:02:08 -0700 |
commit | 74dea4cfd52be75b4dd6277260c3ada80b939fbb (patch) | |
tree | 5781a9b2cb58bf27cb58d6189c535b33ca4af439 /OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs | |
parent | BulletSim: remove the trailing spaces from lines to make git happier (diff) | |
download | opensim-SC_OLD-74dea4cfd52be75b4dd6277260c3ada80b939fbb.zip opensim-SC_OLD-74dea4cfd52be75b4dd6277260c3ada80b939fbb.tar.gz opensim-SC_OLD-74dea4cfd52be75b4dd6277260c3ada80b939fbb.tar.bz2 opensim-SC_OLD-74dea4cfd52be75b4dd6277260c3ada80b939fbb.tar.xz |
BulletSim: rename some constraint variables to be consistant with other name use.
Added callbacks for shape and body changes in GetBodyAndShape() so the linkset
constraints can be picked up and restored. A better design might be to have
a "prim shape changed" event. Think about that.
Added constraint types to general constraint class.
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(); |