diff options
author | Robert Adams | 2013-07-22 12:09:17 -0700 |
---|---|---|
committer | Robert Adams | 2013-07-22 12:09:17 -0700 |
commit | c45659863d8821a48a32e5b687c7b2a6d90b0300 (patch) | |
tree | ab9dcd8912dd1b339e70e6de22784d1db90fb9f3 /OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | |
parent | Revert "BulletSim: only create vehicle prim actor when vehicles are enabled." (diff) | |
download | opensim-SC_OLD-c45659863d8821a48a32e5b687c7b2a6d90b0300.zip opensim-SC_OLD-c45659863d8821a48a32e5b687c7b2a6d90b0300.tar.gz opensim-SC_OLD-c45659863d8821a48a32e5b687c7b2a6d90b0300.tar.bz2 opensim-SC_OLD-c45659863d8821a48a32e5b687c7b2a6d90b0300.tar.xz |
Revert "BulletSim: move collision processing for linksets from BSPrimLinkable"
The changes don't seem to be ready for prime time.
This reverts commit b4c3a791aa55390bff071b3fe4bbe70c1d252703.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | 75 |
1 files changed, 1 insertions, 74 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs index 78c0af7..ad8e10f 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | |||
@@ -203,33 +203,6 @@ public abstract class BSLinkset | |||
203 | return ret; | 203 | return ret; |
204 | } | 204 | } |
205 | 205 | ||
206 | // Called after a simulation step to post a collision with this object. | ||
207 | // Return 'true' if linkset processed the collision. 'false' says the linkset didn't have | ||
208 | // anything to add for the collision and it should be passed through normal processing. | ||
209 | // Default processing for a linkset. | ||
210 | public virtual bool HandleCollide(uint collidingWith, BSPhysObject collidee, | ||
211 | OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth) | ||
212 | { | ||
213 | bool ret = false; | ||
214 | |||
215 | // prims in the same linkset cannot collide with each other | ||
216 | BSPrimLinkable convCollidee = collidee as BSPrimLinkable; | ||
217 | if (convCollidee != null && (LinksetID == convCollidee.Linkset.LinksetID)) | ||
218 | { | ||
219 | // By returning 'true', we tell the caller the collision has been 'handled' so it won't | ||
220 | // do anything about this collision and thus, effectivily, ignoring the collision. | ||
221 | ret = true; | ||
222 | } | ||
223 | else | ||
224 | { | ||
225 | // Not a collision between members of the linkset. Must be a real collision. | ||
226 | // So the linkset root can know if there is a collision anywhere in the linkset. | ||
227 | LinksetRoot.SomeCollisionSimulationStep = m_physicsScene.SimulationStep; | ||
228 | } | ||
229 | |||
230 | return ret; | ||
231 | } | ||
232 | |||
233 | // I am the root of a linkset and a new child is being added | 206 | // I am the root of a linkset and a new child is being added |
234 | // Called while LinkActivity is locked. | 207 | // Called while LinkActivity is locked. |
235 | protected abstract void AddChildToLinkset(BSPrimLinkable child); | 208 | protected abstract void AddChildToLinkset(BSPrimLinkable child); |
@@ -278,53 +251,6 @@ public abstract class BSLinkset | |||
278 | public abstract bool RemoveDependencies(BSPrimLinkable child); | 251 | public abstract bool RemoveDependencies(BSPrimLinkable child); |
279 | 252 | ||
280 | // ================================================================ | 253 | // ================================================================ |
281 | // Some physical setting happen to all members of the linkset | ||
282 | public virtual void SetPhysicalFriction(float friction) | ||
283 | { | ||
284 | ForEachMember((member) => | ||
285 | { | ||
286 | if (member.PhysBody.HasPhysicalBody) | ||
287 | m_physicsScene.PE.SetFriction(member.PhysBody, friction); | ||
288 | return false; // 'false' says to continue looping | ||
289 | } | ||
290 | ); | ||
291 | } | ||
292 | public virtual void SetPhysicalRestitution(float restitution) | ||
293 | { | ||
294 | ForEachMember((member) => | ||
295 | { | ||
296 | if (member.PhysBody.HasPhysicalBody) | ||
297 | m_physicsScene.PE.SetRestitution(member.PhysBody, restitution); | ||
298 | return false; // 'false' says to continue looping | ||
299 | } | ||
300 | ); | ||
301 | } | ||
302 | public virtual void SetPhysicalGravity(OMV.Vector3 gravity) | ||
303 | { | ||
304 | ForEachMember((member) => | ||
305 | { | ||
306 | if (member.PhysBody.HasPhysicalBody) | ||
307 | m_physicsScene.PE.SetGravity(member.PhysBody, gravity); | ||
308 | return false; // 'false' says to continue looping | ||
309 | } | ||
310 | ); | ||
311 | } | ||
312 | public virtual void ComputeLocalInertia() | ||
313 | { | ||
314 | ForEachMember((member) => | ||
315 | { | ||
316 | if (member.PhysBody.HasPhysicalBody) | ||
317 | { | ||
318 | OMV.Vector3 inertia = m_physicsScene.PE.CalculateLocalInertia(member.PhysShape.physShapeInfo, member.Mass); | ||
319 | member.Inertia = inertia * BSParam.VehicleInertiaFactor; | ||
320 | m_physicsScene.PE.SetMassProps(member.PhysBody, member.Mass, member.Inertia); | ||
321 | m_physicsScene.PE.UpdateInertiaTensor(member.PhysBody); | ||
322 | } | ||
323 | return false; // 'false' says to continue looping | ||
324 | } | ||
325 | ); | ||
326 | } | ||
327 | // ================================================================ | ||
328 | protected virtual float ComputeLinksetMass() | 254 | protected virtual float ComputeLinksetMass() |
329 | { | 255 | { |
330 | float mass = LinksetRoot.RawMass; | 256 | float mass = LinksetRoot.RawMass; |
@@ -385,5 +311,6 @@ public abstract class BSLinkset | |||
385 | if (m_physicsScene.PhysicsLogging.Enabled) | 311 | if (m_physicsScene.PhysicsLogging.Enabled) |
386 | m_physicsScene.DetailLog(msg, args); | 312 | m_physicsScene.DetailLog(msg, args); |
387 | } | 313 | } |
314 | |||
388 | } | 315 | } |
389 | } | 316 | } |