aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
diff options
context:
space:
mode:
authorRobert Adams2013-02-07 21:57:31 -0800
committerRobert Adams2013-02-08 16:29:29 -0800
commit1b203601f43662541526369f540dd04f5b485be6 (patch)
tree418bae04970c59ed4ab7653686843bc2e916b730 /OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
parentBulletSim: reclass BSPrim into layers so linkset and physical world displacem... (diff)
downloadopensim-SC_OLD-1b203601f43662541526369f540dd04f5b485be6.zip
opensim-SC_OLD-1b203601f43662541526369f540dd04f5b485be6.tar.gz
opensim-SC_OLD-1b203601f43662541526369f540dd04f5b485be6.tar.bz2
opensim-SC_OLD-1b203601f43662541526369f540dd04f5b485be6.tar.xz
BulletSim: include the linkage to the layered prim implementation. Separate layers for physical (vs simulator) location displacement and linksets.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs30
1 files changed, 15 insertions, 15 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
index 3011465..cc814d1 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetConstraints.cs
@@ -36,7 +36,7 @@ public sealed class BSLinksetConstraints : BSLinkset
36{ 36{
37 // private static string LogHeader = "[BULLETSIM LINKSET CONSTRAINTS]"; 37 // private static string LogHeader = "[BULLETSIM LINKSET CONSTRAINTS]";
38 38
39 public BSLinksetConstraints(BSScene scene, BSPhysObject parent) : base(scene, parent) 39 public BSLinksetConstraints(BSScene scene, BSPrimLinkable parent) : base(scene, parent)
40 { 40 {
41 } 41 }
42 42
@@ -44,7 +44,7 @@ public sealed class BSLinksetConstraints : BSLinkset
44 // its internal properties. 44 // its internal properties.
45 // This is queued in the 'post taint' queue so the 45 // This is queued in the 'post taint' queue so the
46 // refresh will happen once after all the other taints are applied. 46 // refresh will happen once after all the other taints are applied.
47 public override void Refresh(BSPhysObject requestor) 47 public override void Refresh(BSPrimLinkable requestor)
48 { 48 {
49 base.Refresh(requestor); 49 base.Refresh(requestor);
50 50
@@ -65,7 +65,7 @@ public sealed class BSLinksetConstraints : BSLinkset
65 // has not yet been fully constructed. 65 // has not yet been fully constructed.
66 // Return 'true' if any properties updated on the passed object. 66 // Return 'true' if any properties updated on the passed object.
67 // Called at taint-time! 67 // Called at taint-time!
68 public override bool MakeDynamic(BSPhysObject child) 68 public override bool MakeDynamic(BSPrimLinkable child)
69 { 69 {
70 // What is done for each object in BSPrim is what we want. 70 // What is done for each object in BSPrim is what we want.
71 return false; 71 return false;
@@ -76,14 +76,14 @@ public sealed class BSLinksetConstraints : BSLinkset
76 // This doesn't normally happen -- OpenSim removes the objects from the physical 76 // This doesn't normally happen -- OpenSim removes the objects from the physical
77 // world if it is a static linkset. 77 // world if it is a static linkset.
78 // Called at taint-time! 78 // Called at taint-time!
79 public override bool MakeStatic(BSPhysObject child) 79 public override bool MakeStatic(BSPrimLinkable child)
80 { 80 {
81 // What is done for each object in BSPrim is what we want. 81 // What is done for each object in BSPrim is what we want.
82 return false; 82 return false;
83 } 83 }
84 84
85 // Called at taint-time!! 85 // Called at taint-time!!
86 public override void UpdateProperties(UpdatedProperties whichUpdated, BSPhysObject pObj) 86 public override void UpdateProperties(UpdatedProperties whichUpdated, BSPrimLinkable pObj)
87 { 87 {
88 // Nothing to do for constraints on property updates 88 // Nothing to do for constraints on property updates
89 } 89 }
@@ -93,7 +93,7 @@ public sealed class BSLinksetConstraints : BSLinkset
93 // up to rebuild the constraints before the next simulation step. 93 // up to rebuild the constraints before the next simulation step.
94 // Returns 'true' of something was actually removed and would need restoring 94 // Returns 'true' of something was actually removed and would need restoring
95 // Called at taint-time!! 95 // Called at taint-time!!
96 public override bool RemoveBodyDependencies(BSPrim child) 96 public override bool RemoveBodyDependencies(BSPrimLinkable child)
97 { 97 {
98 bool ret = false; 98 bool ret = false;
99 99
@@ -114,7 +114,7 @@ public sealed class BSLinksetConstraints : BSLinkset
114 114
115 // Add a new child to the linkset. 115 // Add a new child to the linkset.
116 // Called while LinkActivity is locked. 116 // Called while LinkActivity is locked.
117 protected override void AddChildToLinkset(BSPhysObject child) 117 protected override void AddChildToLinkset(BSPrimLinkable child)
118 { 118 {
119 if (!HasChild(child)) 119 if (!HasChild(child))
120 { 120 {
@@ -130,12 +130,12 @@ public sealed class BSLinksetConstraints : BSLinkset
130 130
131 // Remove the specified child from the linkset. 131 // Remove the specified child from the linkset.
132 // Safe to call even if the child is not really in my linkset. 132 // Safe to call even if the child is not really in my linkset.
133 protected override void RemoveChildFromLinkset(BSPhysObject child) 133 protected override void RemoveChildFromLinkset(BSPrimLinkable child)
134 { 134 {
135 if (m_children.Remove(child)) 135 if (m_children.Remove(child))
136 { 136 {
137 BSPhysObject rootx = LinksetRoot; // capture the root and body as of now 137 BSPrimLinkable rootx = LinksetRoot; // capture the root and body as of now
138 BSPhysObject childx = child; 138 BSPrimLinkable childx = child;
139 139
140 DetailLog("{0},BSLinksetConstraints.RemoveChildFromLinkset,call,rID={1},rBody={2},cID={3},cBody={4}", 140 DetailLog("{0},BSLinksetConstraints.RemoveChildFromLinkset,call,rID={1},rBody={2},cID={3},cBody={4}",
141 childx.LocalID, 141 childx.LocalID,
@@ -159,13 +159,13 @@ public sealed class BSLinksetConstraints : BSLinkset
159 159
160 // Create a constraint between me (root of linkset) and the passed prim (the child). 160 // Create a constraint between me (root of linkset) and the passed prim (the child).
161 // Called at taint time! 161 // Called at taint time!
162 private void PhysicallyLinkAChildToRoot(BSPhysObject rootPrim, BSPhysObject childPrim) 162 private void PhysicallyLinkAChildToRoot(BSPrimLinkable rootPrim, BSPrimLinkable childPrim)
163 { 163 {
164 // Don't build the constraint when asked. Put it off until just before the simulation step. 164 // Don't build the constraint when asked. Put it off until just before the simulation step.
165 Refresh(rootPrim); 165 Refresh(rootPrim);
166 } 166 }
167 167
168 private BSConstraint BuildConstraint(BSPhysObject rootPrim, BSPhysObject childPrim) 168 private BSConstraint BuildConstraint(BSPrimLinkable rootPrim, BSPrimLinkable childPrim)
169 { 169 {
170 // Zero motion for children so they don't interpolate 170 // Zero motion for children so they don't interpolate
171 childPrim.ZeroMotion(true); 171 childPrim.ZeroMotion(true);
@@ -239,7 +239,7 @@ public sealed class BSLinksetConstraints : BSLinkset
239 // The root and child bodies are passed in because we need to remove the constraint between 239 // The root and child bodies are passed in because we need to remove the constraint between
240 // the bodies that were present at unlink time. 240 // the bodies that were present at unlink time.
241 // Called at taint time! 241 // Called at taint time!
242 private bool PhysicallyUnlinkAChildFromRoot(BSPhysObject rootPrim, BSPhysObject childPrim) 242 private bool PhysicallyUnlinkAChildFromRoot(BSPrimLinkable rootPrim, BSPrimLinkable childPrim)
243 { 243 {
244 bool ret = false; 244 bool ret = false;
245 DetailLog("{0},BSLinksetConstraint.PhysicallyUnlinkAChildFromRoot,taint,root={1},rBody={2},child={3},cBody={4}", 245 DetailLog("{0},BSLinksetConstraint.PhysicallyUnlinkAChildFromRoot,taint,root={1},rBody={2},child={3},cBody={4}",
@@ -261,7 +261,7 @@ public sealed class BSLinksetConstraints : BSLinkset
261 // Remove linkage between myself and any possible children I might have. 261 // Remove linkage between myself and any possible children I might have.
262 // Returns 'true' of any constraints were destroyed. 262 // Returns 'true' of any constraints were destroyed.
263 // Called at taint time! 263 // Called at taint time!
264 private bool PhysicallyUnlinkAllChildrenFromRoot(BSPhysObject rootPrim) 264 private bool PhysicallyUnlinkAllChildrenFromRoot(BSPrimLinkable rootPrim)
265 { 265 {
266 DetailLog("{0},BSLinksetConstraint.PhysicallyUnlinkAllChildren,taint", rootPrim.LocalID); 266 DetailLog("{0},BSLinksetConstraint.PhysicallyUnlinkAllChildren,taint", rootPrim.LocalID);
267 267
@@ -281,7 +281,7 @@ public sealed class BSLinksetConstraints : BSLinkset
281 DetailLog("{0},BSLinksetConstraint.RecomputeLinksetConstraints,set,rBody={1},linksetMass={2}", 281 DetailLog("{0},BSLinksetConstraint.RecomputeLinksetConstraints,set,rBody={1},linksetMass={2}",
282 LinksetRoot.LocalID, LinksetRoot.PhysBody.AddrString, linksetMass); 282 LinksetRoot.LocalID, LinksetRoot.PhysBody.AddrString, linksetMass);
283 283
284 foreach (BSPhysObject child in m_children) 284 foreach (BSPrimLinkable child in m_children)
285 { 285 {
286 // A child in the linkset physically shows the mass of the whole linkset. 286 // A child in the linkset physically shows the mass of the whole linkset.
287 // This allows Bullet to apply enough force on the child to move the whole linkset. 287 // This allows Bullet to apply enough force on the child to move the whole linkset.