diff options
author | Robert Adams | 2013-07-30 15:23:33 -0700 |
---|---|---|
committer | Robert Adams | 2013-07-30 15:23:33 -0700 |
commit | 0d189165a83bb97f243a1f29cfa6896936ca6db0 (patch) | |
tree | efbe0bba730c57150f1d02841a8e55949cafdbed /OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | |
parent | BulletSim: test method for debugging of extended physics script operations. (diff) | |
download | opensim-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/BSLinkset.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs index 960c0b4..7f94666 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs | |||
@@ -309,16 +309,18 @@ public abstract class BSLinkset | |||
309 | } | 309 | } |
310 | ); | 310 | ); |
311 | } | 311 | } |
312 | public virtual void ComputeLocalInertia(OMV.Vector3 inertiaFactor) | 312 | public virtual void ComputeAndSetLocalInertia(OMV.Vector3 inertiaFactor, float linksetMass) |
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, linksetMass); |
319 | member.Inertia = inertia * inertiaFactor; | 319 | member.Inertia = inertia * inertiaFactor; |
320 | m_physicsScene.PE.SetMassProps(member.PhysBody, member.Mass, member.Inertia); | 320 | m_physicsScene.PE.SetMassProps(member.PhysBody, linksetMass, member.Inertia); |
321 | m_physicsScene.PE.UpdateInertiaTensor(member.PhysBody); | 321 | m_physicsScene.PE.UpdateInertiaTensor(member.PhysBody); |
322 | DetailLog("{0},BSLinkset.ComputeAndSetLocalInertia,m.mass={1}, inertia={2}", member.LocalID, linksetMass, member.Inertia); | ||
323 | |||
322 | } | 324 | } |
323 | return false; // 'false' says to continue looping | 325 | return false; // 'false' says to continue looping |
324 | } | 326 | } |
@@ -334,6 +336,16 @@ public abstract class BSLinkset | |||
334 | } | 336 | } |
335 | ); | 337 | ); |
336 | } | 338 | } |
339 | public virtual void AddToPhysicalCollisionFlags(CollisionFlags collFlags) | ||
340 | { | ||
341 | ForEachMember((member) => | ||
342 | { | ||
343 | if (member.PhysBody.HasPhysicalBody) | ||
344 | m_physicsScene.PE.AddToCollisionFlags(member.PhysBody, collFlags); | ||
345 | return false; // 'false' says to continue looping | ||
346 | } | ||
347 | ); | ||
348 | } | ||
337 | public virtual void RemoveFromPhysicalCollisionFlags(CollisionFlags collFlags) | 349 | public virtual void RemoveFromPhysicalCollisionFlags(CollisionFlags collFlags) |
338 | { | 350 | { |
339 | ForEachMember((member) => | 351 | ForEachMember((member) => |