aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
diff options
context:
space:
mode:
authorRobert Adams2012-11-01 10:53:55 -0700
committerRobert Adams2012-11-03 21:15:22 -0700
commitf53b4e7a21f62a84e237c4ce8d2806124c3a76d2 (patch)
tree1a815eafa4cec6e930b527fe81985b37f25f006a /OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
parentBulletSim: Remove use of shapeData in ShapeCollection and rely on the availab... (diff)
downloadopensim-SC_OLD-f53b4e7a21f62a84e237c4ce8d2806124c3a76d2.zip
opensim-SC_OLD-f53b4e7a21f62a84e237c4ce8d2806124c3a76d2.tar.gz
opensim-SC_OLD-f53b4e7a21f62a84e237c4ce8d2806124c3a76d2.tar.bz2
opensim-SC_OLD-f53b4e7a21f62a84e237c4ce8d2806124c3a76d2.tar.xz
BulletSim: Add RawPosition and RawOrientation to BSPhysObject and rename MassRaw to RawMass. Fix BSShapeCollection to use Raw* for creating the body to eliminate exception from referencing the physical body before it has been created.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
index f56851f..9e0f499 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSLinkset.cs
@@ -106,7 +106,7 @@ public abstract class BSLinkset
106 PhysicsScene = scene; 106 PhysicsScene = scene;
107 LinksetRoot = parent; 107 LinksetRoot = parent;
108 m_children = new HashSet<BSPhysObject>(); 108 m_children = new HashSet<BSPhysObject>();
109 m_mass = parent.MassRaw; 109 m_mass = parent.RawMass;
110 } 110 }
111 111
112 // Link to a linkset where the child knows the parent. 112 // Link to a linkset where the child knows the parent.
@@ -242,14 +242,14 @@ public abstract class BSLinkset
242 // ================================================================ 242 // ================================================================
243 protected virtual float ComputeLinksetMass() 243 protected virtual float ComputeLinksetMass()
244 { 244 {
245 float mass = LinksetRoot.MassRaw; 245 float mass = LinksetRoot.RawMass;
246 if (HasAnyChildren) 246 if (HasAnyChildren)
247 { 247 {
248 lock (m_linksetActivityLock) 248 lock (m_linksetActivityLock)
249 { 249 {
250 foreach (BSPhysObject bp in m_children) 250 foreach (BSPhysObject bp in m_children)
251 { 251 {
252 mass += bp.MassRaw; 252 mass += bp.RawMass;
253 } 253 }
254 } 254 }
255 } 255 }
@@ -261,13 +261,13 @@ public abstract class BSLinkset
261 OMV.Vector3 com; 261 OMV.Vector3 com;
262 lock (m_linksetActivityLock) 262 lock (m_linksetActivityLock)
263 { 263 {
264 com = LinksetRoot.Position * LinksetRoot.MassRaw; 264 com = LinksetRoot.Position * LinksetRoot.RawMass;
265 float totalMass = LinksetRoot.MassRaw; 265 float totalMass = LinksetRoot.RawMass;
266 266
267 foreach (BSPhysObject bp in m_children) 267 foreach (BSPhysObject bp in m_children)
268 { 268 {
269 com += bp.Position * bp.MassRaw; 269 com += bp.Position * bp.RawMass;
270 totalMass += bp.MassRaw; 270 totalMass += bp.RawMass;
271 } 271 }
272 if (totalMass != 0f) 272 if (totalMass != 0f)
273 com /= totalMass; 273 com /= totalMass;
@@ -285,7 +285,7 @@ public abstract class BSLinkset
285 285
286 foreach (BSPhysObject bp in m_children) 286 foreach (BSPhysObject bp in m_children)
287 { 287 {
288 com += bp.Position * bp.MassRaw; 288 com += bp.Position * bp.RawMass;
289 } 289 }
290 com /= (m_children.Count + 1); 290 com /= (m_children.Count + 1);
291 } 291 }