aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
diff options
context:
space:
mode:
authorRobert Adams2013-08-01 17:43:06 -0700
committerRobert Adams2013-08-02 09:47:12 -0700
commit24df15dab7befd50f7a45eb54f001e6e481f0ec4 (patch)
treef3502a9782d68848c00fe3cb9b4b2a04dfa91f61 /OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
parentBulletSim: add BSLinkInfo structure to remember link specific information (diff)
downloadopensim-SC-24df15dab7befd50f7a45eb54f001e6e481f0ec4.zip
opensim-SC-24df15dab7befd50f7a45eb54f001e6e481f0ec4.tar.gz
opensim-SC-24df15dab7befd50f7a45eb54f001e6e481f0ec4.tar.bz2
opensim-SC-24df15dab7befd50f7a45eb54f001e6e481f0ec4.tar.xz
BulletSim: add implementation of 'physSetLinksetType' and 'physGetLinksetType'
and processing routines in BulletSim. Add linkset rebuild/conversion routine in BSLinkset.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
index 2f392da..c565998 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
@@ -233,5 +233,35 @@ public class BSPrimLinkable : BSPrimDisplaced
233 base.HasSomeCollision = value; 233 base.HasSomeCollision = value;
234 } 234 }
235 } 235 }
236
237 // Convert the existing linkset of this prim into a new type.
238 public bool ConvertLinkset(BSLinkset.LinksetImplementation newType)
239 {
240 bool ret = false;
241 if (LinksetType != newType)
242 {
243 BSLinkset oldLinkset = Linkset;
244 BSLinkset newLinkset = BSLinkset.Factory(PhysScene, this);
245
246 // Pick up any physical dependencies this linkset might have in the physics engine.
247 oldLinkset.RemoveDependencies(this);
248
249 // Copy the linkset children from the old linkset to the new (will be a new instance from the factory)
250 oldLinkset.ForEachLinkInfo((li) =>
251 {
252 oldLinkset.RemoveMeFromLinkset(li.member);
253 newLinkset.AddMeToLinkset(li.member);
254 li.member.Linkset = newLinkset;
255 return false;
256 });
257
258 this.Linkset = newLinkset;
259
260 // Force the shape and linkset to get reconstructed
261 newLinkset.Refresh(this);
262 this.ForceBodyShapeRebuild(true);
263 }
264 return ret;
265 }
236} 266}
237} 267}