aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics
diff options
context:
space:
mode:
authorRobert Adams2013-08-07 11:13:53 -0700
committerJustin Clark-Casey (justincc)2013-09-20 21:02:12 +0100
commit3ffad76b0da68733474fc5a525060cba46693c63 (patch)
treeeab7352ae33b4281bab352db3faaa62a2b15f4bf /OpenSim/Region/Physics
parentBulletSim: move linkset extension operations into BSPrimLinkable where they s... (diff)
downloadopensim-SC_OLD-3ffad76b0da68733474fc5a525060cba46693c63.zip
opensim-SC_OLD-3ffad76b0da68733474fc5a525060cba46693c63.tar.gz
opensim-SC_OLD-3ffad76b0da68733474fc5a525060cba46693c63.tar.bz2
opensim-SC_OLD-3ffad76b0da68733474fc5a525060cba46693c63.tar.xz
BulletSim: initial implementation of physChangeLinkFixed that resets a linkset's link back to a fixed, non-moving connection.
Diffstat (limited to 'OpenSim/Region/Physics')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs29
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs4
2 files changed, 24 insertions, 9 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
index fc639ad..77d8246 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
@@ -60,10 +60,7 @@ public class BSPrimLinkable : BSPrimDisplaced
60 60
61 Linkset = BSLinkset.Factory(PhysScene, this); 61 Linkset = BSLinkset.Factory(PhysScene, this);
62 62
63 PhysScene.TaintedObject("BSPrimLinksetCompound.Refresh", delegate() 63 Linkset.Refresh(this);
64 {
65 Linkset.Refresh(this);
66 });
67 } 64 }
68 65
69 public override void Destroy() 66 public override void Destroy()
@@ -82,7 +79,7 @@ public class BSPrimLinkable : BSPrimDisplaced
82 79
83 Linkset = parent.Linkset.AddMeToLinkset(this); 80 Linkset = parent.Linkset.AddMeToLinkset(this);
84 81
85 DetailLog("{0},BSPrimLinkset.link,call,parentBefore={1}, childrenBefore=={2}, parentAfter={3}, childrenAfter={4}", 82 DetailLog("{0},BSPrimLinkable.link,call,parentBefore={1}, childrenBefore=={2}, parentAfter={3}, childrenAfter={4}",
86 LocalID, parentBefore.LocalID, childrenBefore, Linkset.LinksetRoot.LocalID, Linkset.NumberOfChildren); 83 LocalID, parentBefore.LocalID, childrenBefore, Linkset.LinksetRoot.LocalID, Linkset.NumberOfChildren);
87 } 84 }
88 return; 85 return;
@@ -98,7 +95,7 @@ public class BSPrimLinkable : BSPrimDisplaced
98 95
99 Linkset = Linkset.RemoveMeFromLinkset(this, false /* inTaintTime*/); 96 Linkset = Linkset.RemoveMeFromLinkset(this, false /* inTaintTime*/);
100 97
101 DetailLog("{0},BSPrimLinkset.delink,parentBefore={1},childrenBefore={2},parentAfter={3},childrenAfter={4}, ", 98 DetailLog("{0},BSPrimLinkable.delink,parentBefore={1},childrenBefore={2},parentAfter={3},childrenAfter={4}, ",
102 LocalID, parentBefore.LocalID, childrenBefore, Linkset.LinksetRoot.LocalID, Linkset.NumberOfChildren); 99 LocalID, parentBefore.LocalID, childrenBefore, Linkset.LinksetRoot.LocalID, Linkset.NumberOfChildren);
103 return; 100 return;
104 } 101 }
@@ -110,7 +107,7 @@ public class BSPrimLinkable : BSPrimDisplaced
110 set 107 set
111 { 108 {
112 base.Position = value; 109 base.Position = value;
113 PhysScene.TaintedObject("BSPrimLinkset.setPosition", delegate() 110 PhysScene.TaintedObject("BSPrimLinkable.setPosition", delegate()
114 { 111 {
115 Linkset.UpdateProperties(UpdatedProperties.Position, this); 112 Linkset.UpdateProperties(UpdatedProperties.Position, this);
116 }); 113 });
@@ -124,7 +121,7 @@ public class BSPrimLinkable : BSPrimDisplaced
124 set 121 set
125 { 122 {
126 base.Orientation = value; 123 base.Orientation = value;
127 PhysScene.TaintedObject("BSPrimLinkset.setOrientation", delegate() 124 PhysScene.TaintedObject("BSPrimLinkable.setOrientation", delegate()
128 { 125 {
129 Linkset.UpdateProperties(UpdatedProperties.Orientation, this); 126 Linkset.UpdateProperties(UpdatedProperties.Orientation, this);
130 }); 127 });
@@ -242,7 +239,7 @@ public class BSPrimLinkable : BSPrimDisplaced
242 bool ret = false; 239 bool ret = false;
243 if (LinksetType != newType) 240 if (LinksetType != newType)
244 { 241 {
245 DetailLog("{0},BSPrimLinkset.ConvertLinkset,oldT={1},newT={2}", LocalID, LinksetType, newType); 242 DetailLog("{0},BSPrimLinkable.ConvertLinkset,oldT={1},newT={2}", LocalID, LinksetType, newType);
246 243
247 // Set the implementation type first so the call to BSLinkset.Factory gets the new type. 244 // Set the implementation type first so the call to BSLinkset.Factory gets the new type.
248 this.LinksetType = newType; 245 this.LinksetType = newType;
@@ -288,12 +285,14 @@ public class BSPrimLinkable : BSPrimDisplaced
288 object ret = null; 285 object ret = null;
289 switch (pFunct) 286 switch (pFunct)
290 { 287 {
288 // physGetLinksetType();
291 case BSScene.PhysFunctGetLinksetType: 289 case BSScene.PhysFunctGetLinksetType:
292 { 290 {
293 ret = (object)LinksetType; 291 ret = (object)LinksetType;
294 m_log.DebugFormat("{0} Extension.physGetLinksetType, type={1}", LogHeader, ret); 292 m_log.DebugFormat("{0} Extension.physGetLinksetType, type={1}", LogHeader, ret);
295 break; 293 break;
296 } 294 }
295 // physSetLinksetType(type);
297 case BSScene.PhysFunctSetLinksetType: 296 case BSScene.PhysFunctSetLinksetType:
298 { 297 {
299 if (pParams.Length > 0) 298 if (pParams.Length > 0)
@@ -313,6 +312,18 @@ public class BSPrimLinkable : BSPrimDisplaced
313 } 312 }
314 break; 313 break;
315 } 314 }
315 // physChangeLinkFixed(linknum);
316 // Params: int linkNum, PhysActor linkedPrim
317 case BSScene.PhysFunctChangeLinkFixed:
318 {
319 if (pParams.Length > 1)
320 {
321 int linkNum = (int)pParams[0];
322 Manager.PhysicsActor linkActor = (Manager.PhysicsActor)pParams[1];
323 Linkset.Refresh(this);
324 }
325 break;
326 }
316 default: 327 default:
317 ret = base.Extension(pFunct, pParams); 328 ret = base.Extension(pFunct, pParams);
318 break; 329 break;
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 88d50b4..b451129 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -875,6 +875,10 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
875 // Per prim functions. See BSPrim. 875 // Per prim functions. See BSPrim.
876 public const string PhysFunctGetLinksetType = "BulletSim.GetLinksetType"; 876 public const string PhysFunctGetLinksetType = "BulletSim.GetLinksetType";
877 public const string PhysFunctSetLinksetType = "BulletSim.SetLinksetType"; 877 public const string PhysFunctSetLinksetType = "BulletSim.SetLinksetType";
878 public const string PhysFunctChangeLinkFixed = "BulletSim.ChangeLinkFixed";
879 public const string PhysFunctChangeLinkHinge = "BulletSim.ChangeLinkHinge";
880 public const string PhysFunctChangeLinkSpring = "BulletSim.ChangeLinkSpring";
881 public const string PhysFunctChangeLinkSlider = "BulletSim.ChangeLinkSlider";
878 // ============================================================= 882 // =============================================================
879 883
880 public override object Extension(string pFunct, params object[] pParams) 884 public override object Extension(string pFunct, params object[] pParams)