aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
diff options
context:
space:
mode:
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}