aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
diff options
context:
space:
mode:
authorRobert Adams2013-07-23 08:13:01 -0700
committerRobert Adams2013-07-23 08:13:01 -0700
commitaec8852af793699a4c1093a38b992daf2dbd97f3 (patch)
tree8d628e8e17e0773fc2ee95e500a2ae919fcd6da9 /OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
parentRevert "Revert "Add experimental stubs for an extension function interface on... (diff)
downloadopensim-SC-aec8852af793699a4c1093a38b992daf2dbd97f3.zip
opensim-SC-aec8852af793699a4c1093a38b992daf2dbd97f3.tar.gz
opensim-SC-aec8852af793699a4c1093a38b992daf2dbd97f3.tar.bz2
opensim-SC-aec8852af793699a4c1093a38b992daf2dbd97f3.tar.xz
Revert "Revert "BulletSim: move collision processing for linksets from BSPrimLinkable""
Found that the vehicle movement problem was not caused by these physics changes. This reverts commit c45659863d8821a48a32e5b687c7b2a6d90b0300.
Diffstat (limited to '')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs32
1 files changed, 25 insertions, 7 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
index 1fbcfcc..2f392da 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrimLinkable.cs
@@ -200,20 +200,38 @@ public class BSPrimLinkable : BSPrimDisplaced
200 } 200 }
201 201
202 // Called after a simulation step to post a collision with this object. 202 // Called after a simulation step to post a collision with this object.
203 // This returns 'true' if the collision has been queued and the SendCollisions call must
204 // be made at the end of the simulation step.
203 public override bool Collide(uint collidingWith, BSPhysObject collidee, 205 public override bool Collide(uint collidingWith, BSPhysObject collidee,
204 OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth) 206 OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth)
205 { 207 {
206 // prims in the same linkset cannot collide with each other 208 bool ret = false;
207 BSPrimLinkable convCollidee = collidee as BSPrimLinkable; 209 // Ask the linkset if it wants to handle the collision
208 if (convCollidee != null && (this.Linkset.LinksetID == convCollidee.Linkset.LinksetID)) 210 if (!Linkset.HandleCollide(collidingWith, collidee, contactPoint, contactNormal, pentrationDepth))
209 { 211 {
210 return false; 212 // The linkset didn't handle it so pass the collision through normal processing
213 ret = base.Collide(collidingWith, collidee, contactPoint, contactNormal, pentrationDepth);
211 } 214 }
215 return ret;
216 }
212 217
213 // TODO: handle collisions of other objects with with children of linkset. 218 // A linkset reports any collision on any part of the linkset.
214 // This is a problem for LinksetCompound since the children are packed into the root. 219 public long SomeCollisionSimulationStep = 0;
220 public override bool HasSomeCollision
221 {
222 get
223 {
224 return (SomeCollisionSimulationStep == PhysScene.SimulationStep) || base.IsColliding;
225 }
226 set
227 {
228 if (value)
229 SomeCollisionSimulationStep = PhysScene.SimulationStep;
230 else
231 SomeCollisionSimulationStep = 0;
215 232
216 return base.Collide(collidingWith, collidee, contactPoint, contactNormal, pentrationDepth); 233 base.HasSomeCollision = value;
234 }
217 } 235 }
218} 236}
219} 237}