aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics
diff options
context:
space:
mode:
authorRobert Adams2013-07-22 12:07:42 -0700
committerRobert Adams2013-07-22 12:07:42 -0700
commit84d0699761b8da546f9faef084240d7b15f16321 (patch)
tree3710604cbb3d3db2d7207ca85abcd9bb8cc87e51 /OpenSim/Region/Physics
parentBulletSim: Add logic to linksets to change physical properties for (diff)
downloadopensim-SC-84d0699761b8da546f9faef084240d7b15f16321.zip
opensim-SC-84d0699761b8da546f9faef084240d7b15f16321.tar.gz
opensim-SC-84d0699761b8da546f9faef084240d7b15f16321.tar.bz2
opensim-SC-84d0699761b8da546f9faef084240d7b15f16321.tar.xz
Revert "BulletSim: Add logic to linksets to change physical properties for"
The changes don't seem to be ready for prime time. This reverts commit b44f0e1a00eba7f76401692322e48a3b23a81164.
Diffstat (limited to 'OpenSim/Region/Physics')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSActors.cs6
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs24
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs36
3 files changed, 7 insertions, 59 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActors.cs b/OpenSim/Region/Physics/BulletSPlugin/BSActors.cs
index e0ccc50..fff63e4 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSActors.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSActors.cs
@@ -69,7 +69,7 @@ public class BSActorCollection
69 { 69 {
70 lock (m_actors) 70 lock (m_actors)
71 { 71 {
72 ForEachActor(a => a.Dispose()); 72 Release();
73 m_actors.Clear(); 73 m_actors.Clear();
74 } 74 }
75 } 75 }
@@ -98,6 +98,10 @@ public class BSActorCollection
98 { 98 {
99 ForEachActor(a => a.SetEnabled(enabl)); 99 ForEachActor(a => a.SetEnabled(enabl));
100 } 100 }
101 public void Release()
102 {
103 ForEachActor(a => a.Dispose());
104 }
101 public void Refresh() 105 public void Refresh()
102 { 106 {
103 ForEachActor(a => a.Refresh()); 107 ForEachActor(a => a.Refresh());
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
index 960c0b4..78c0af7 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(OMV.Vector3 inertiaFactor) 312 public virtual void ComputeLocalInertia()
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 * inertiaFactor; 319 member.Inertia = inertia * BSParam.VehicleInertiaFactor;
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,26 +324,6 @@ 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 }
347 // ================================================================ 327 // ================================================================
348 protected virtual float ComputeLinksetMass() 328 protected virtual float ComputeLinksetMass()
349 { 329 {
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
index 33ae5a5..3668456 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinksetCompound.cs
@@ -44,42 +44,6 @@ public sealed class BSLinksetCompound : BSLinkset
44 { 44 {
45 } 45 }
46 46
47 // ================================================================
48 // Changing the physical property of the linkset only needs to change the root
49 public override void SetPhysicalFriction(float friction)
50 {
51 if (LinksetRoot.PhysBody.HasPhysicalBody)
52 m_physicsScene.PE.SetFriction(LinksetRoot.PhysBody, friction);
53 }
54 public override void SetPhysicalRestitution(float restitution)
55 {
56 if (LinksetRoot.PhysBody.HasPhysicalBody)
57 m_physicsScene.PE.SetRestitution(LinksetRoot.PhysBody, restitution);
58 }
59 public override void SetPhysicalGravity(OMV.Vector3 gravity)
60 {
61 if (LinksetRoot.PhysBody.HasPhysicalBody)
62 m_physicsScene.PE.SetGravity(LinksetRoot.PhysBody, gravity);
63 }
64 public override void ComputeLocalInertia(OMV.Vector3 inertiaFactor)
65 {
66 OMV.Vector3 inertia = m_physicsScene.PE.CalculateLocalInertia(LinksetRoot.PhysShape.physShapeInfo, LinksetRoot.Mass);
67 LinksetRoot.Inertia = inertia * inertiaFactor;
68 m_physicsScene.PE.SetMassProps(LinksetRoot.PhysBody, LinksetRoot.Mass, LinksetRoot.Inertia);
69 m_physicsScene.PE.UpdateInertiaTensor(LinksetRoot.PhysBody);
70 }
71 public override void SetPhysicalCollisionFlags(CollisionFlags collFlags)
72 {
73 if (LinksetRoot.PhysBody.HasPhysicalBody)
74 m_physicsScene.PE.SetCollisionFlags(LinksetRoot.PhysBody, collFlags);
75 }
76 public override void RemoveFromPhysicalCollisionFlags(CollisionFlags collFlags)
77 {
78 if (LinksetRoot.PhysBody.HasPhysicalBody)
79 m_physicsScene.PE.RemoveFromCollisionFlags(LinksetRoot.PhysBody, collFlags);
80 }
81 // ================================================================
82
83 // When physical properties are changed the linkset needs to recalculate 47 // When physical properties are changed the linkset needs to recalculate
84 // its internal properties. 48 // its internal properties.
85 public override void Refresh(BSPrimLinkable requestor) 49 public override void Refresh(BSPrimLinkable requestor)