aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
diff options
context:
space:
mode:
authorRobert Adams2013-07-30 15:23:33 -0700
committerRobert Adams2013-07-30 15:23:33 -0700
commit0d189165a83bb97f243a1f29cfa6896936ca6db0 (patch)
treeefbe0bba730c57150f1d02841a8e55949cafdbed /OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
parentBulletSim: test method for debugging of extended physics script operations. (diff)
downloadopensim-SC_OLD-0d189165a83bb97f243a1f29cfa6896936ca6db0.zip
opensim-SC_OLD-0d189165a83bb97f243a1f29cfa6896936ca6db0.tar.gz
opensim-SC_OLD-0d189165a83bb97f243a1f29cfa6896936ca6db0.tar.bz2
opensim-SC_OLD-0d189165a83bb97f243a1f29cfa6896936ca6db0.tar.xz
BulletSim: distribute vehicle physical settings to all members of
a linkset. Enables constraint based linksets. Rename some internal variables to clarify whether values world or vehicle relative.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
index 33ae5a5..6359046 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
@@ -61,11 +61,11 @@ public sealed class BSLinksetCompound : BSLinkset
61 if (LinksetRoot.PhysBody.HasPhysicalBody) 61 if (LinksetRoot.PhysBody.HasPhysicalBody)
62 m_physicsScene.PE.SetGravity(LinksetRoot.PhysBody, gravity); 62 m_physicsScene.PE.SetGravity(LinksetRoot.PhysBody, gravity);
63 } 63 }
64 public override void ComputeLocalInertia(OMV.Vector3 inertiaFactor) 64 public override void ComputeAndSetLocalInertia(OMV.Vector3 inertiaFactor, float linksetMass)
65 { 65 {
66 OMV.Vector3 inertia = m_physicsScene.PE.CalculateLocalInertia(LinksetRoot.PhysShape.physShapeInfo, LinksetRoot.Mass); 66 OMV.Vector3 inertia = m_physicsScene.PE.CalculateLocalInertia(LinksetRoot.PhysShape.physShapeInfo, linksetMass);
67 LinksetRoot.Inertia = inertia * inertiaFactor; 67 LinksetRoot.Inertia = inertia * inertiaFactor;
68 m_physicsScene.PE.SetMassProps(LinksetRoot.PhysBody, LinksetRoot.Mass, LinksetRoot.Inertia); 68 m_physicsScene.PE.SetMassProps(LinksetRoot.PhysBody, linksetMass, LinksetRoot.Inertia);
69 m_physicsScene.PE.UpdateInertiaTensor(LinksetRoot.PhysBody); 69 m_physicsScene.PE.UpdateInertiaTensor(LinksetRoot.PhysBody);
70 } 70 }
71 public override void SetPhysicalCollisionFlags(CollisionFlags collFlags) 71 public override void SetPhysicalCollisionFlags(CollisionFlags collFlags)
@@ -73,6 +73,11 @@ public sealed class BSLinksetCompound : BSLinkset
73 if (LinksetRoot.PhysBody.HasPhysicalBody) 73 if (LinksetRoot.PhysBody.HasPhysicalBody)
74 m_physicsScene.PE.SetCollisionFlags(LinksetRoot.PhysBody, collFlags); 74 m_physicsScene.PE.SetCollisionFlags(LinksetRoot.PhysBody, collFlags);
75 } 75 }
76 public override void AddToPhysicalCollisionFlags(CollisionFlags collFlags)
77 {
78 if (LinksetRoot.PhysBody.HasPhysicalBody)
79 m_physicsScene.PE.AddToCollisionFlags(LinksetRoot.PhysBody, collFlags);
80 }
76 public override void RemoveFromPhysicalCollisionFlags(CollisionFlags collFlags) 81 public override void RemoveFromPhysicalCollisionFlags(CollisionFlags collFlags)
77 { 82 {
78 if (LinksetRoot.PhysBody.HasPhysicalBody) 83 if (LinksetRoot.PhysBody.HasPhysicalBody)