diff options
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) => |