aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
diff options
context:
space:
mode:
authorRobert Adams2013-07-16 10:02:14 -0700
committerRobert Adams2013-07-22 10:27:24 -0700
commitb44f0e1a00eba7f76401692322e48a3b23a81164 (patch)
tree96e44a80c97f35571116f120adf0e4d9c679b42e /OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
parentBulletSim: change BSDynamics to expect to be passed a BSPrimLinkable (diff)
downloadopensim-SC-b44f0e1a00eba7f76401692322e48a3b23a81164.zip
opensim-SC-b44f0e1a00eba7f76401692322e48a3b23a81164.tar.gz
opensim-SC-b44f0e1a00eba7f76401692322e48a3b23a81164.tar.bz2
opensim-SC-b44f0e1a00eba7f76401692322e48a3b23a81164.tar.xz
BulletSim: Add logic to linksets to change physical properties for
whole linkset. Override physical property setting for BSLinksetCompound as there are not children to the compound spape.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs24
1 files changed, 22 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
index 78c0af7..960c0b4 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
@@ -309,14 +309,14 @@ public abstract class BSLinkset
309 } 309 }
310 ); 310 );
311 } 311 }
312 public virtual void ComputeLocalInertia() 312 public virtual void ComputeLocalInertia(OMV.Vector3 inertiaFactor)
313 { 313 {
314 ForEachMember((member) => 314 ForEachMember((member) =>
315 { 315 {
316 if (member.PhysBody.HasPhysicalBody) 316 if (member.PhysBody.HasPhysicalBody)
317 { 317 {
318 OMV.Vector3 inertia = m_physicsScene.PE.CalculateLocalInertia(member.PhysShape.physShapeInfo, member.Mass); 318 OMV.Vector3 inertia = m_physicsScene.PE.CalculateLocalInertia(member.PhysShape.physShapeInfo, member.Mass);
319 member.Inertia = inertia * BSParam.VehicleInertiaFactor; 319 member.Inertia = inertia * inertiaFactor;
320 m_physicsScene.PE.SetMassProps(member.PhysBody, member.Mass, member.Inertia); 320 m_physicsScene.PE.SetMassProps(member.PhysBody, member.Mass, member.Inertia);
321 m_physicsScene.PE.UpdateInertiaTensor(member.PhysBody); 321 m_physicsScene.PE.UpdateInertiaTensor(member.PhysBody);
322 } 322 }
@@ -324,6 +324,26 @@ public abstract class BSLinkset
324 } 324 }
325 ); 325 );
326 } 326 }
327 public virtual void SetPhysicalCollisionFlags(CollisionFlags collFlags)
328 {
329 ForEachMember((member) =>
330 {
331 if (member.PhysBody.HasPhysicalBody)
332 m_physicsScene.PE.SetCollisionFlags(member.PhysBody, collFlags);
333 return false; // 'false' says to continue looping
334 }
335 );
336 }
337 public virtual void RemoveFromPhysicalCollisionFlags(CollisionFlags collFlags)
338 {
339 ForEachMember((member) =>
340 {
341 if (member.PhysBody.HasPhysicalBody)
342 m_physicsScene.PE.RemoveFromCollisionFlags(member.PhysBody, collFlags);
343 return false; // 'false' says to continue looping
344 }
345 );
346 }
327 // ================================================================ 347 // ================================================================
328 protected virtual float ComputeLinksetMass() 348 protected virtual float ComputeLinksetMass()
329 { 349 {