aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
diff options
context:
space:
mode:
authorRobert Adams2012-12-24 08:56:02 -0800
committerRobert Adams2012-12-24 08:56:02 -0800
commit80cee1b85a646045c02e2bb675056d532ce2fe27 (patch)
treedc9347a2eeb3241cdd30f50d448b630ce5d5c4f9 /OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
parent* Update BulletSimN terrain implementation to default to Heightfield, it's le... (diff)
downloadopensim-SC_OLD-80cee1b85a646045c02e2bb675056d532ce2fe27.zip
opensim-SC_OLD-80cee1b85a646045c02e2bb675056d532ce2fe27.tar.gz
opensim-SC_OLD-80cee1b85a646045c02e2bb675056d532ce2fe27.tar.bz2
opensim-SC_OLD-80cee1b85a646045c02e2bb675056d532ce2fe27.tar.xz
BulletSim: Fix single physical prim reporting its mass as zero.
Properly return root mass as mass of just the root prim rather than the mass of the linkset. SOG has the logic to add the masses together to get the linkset mass. Update TODO list.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
index 8e059ee..bf0545a 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
@@ -174,7 +174,7 @@ public sealed class BSCharacter : BSPhysObject
174 BulletSimAPI.SetCcdSweptSphereRadius2(PhysBody.ptr, BSParam.CcdSweptSphereRadius); 174 BulletSimAPI.SetCcdSweptSphereRadius2(PhysBody.ptr, BSParam.CcdSweptSphereRadius);
175 } 175 }
176 176
177 UpdatePhysicalMassProperties(RawMass); 177 UpdatePhysicalMassProperties(RawMass, false);
178 178
179 // Make so capsule does not fall over 179 // Make so capsule does not fall over
180 BulletSimAPI.SetAngularFactorV2(PhysBody.ptr, OMV.Vector3.Zero); 180 BulletSimAPI.SetAngularFactorV2(PhysBody.ptr, OMV.Vector3.Zero);
@@ -224,7 +224,7 @@ public sealed class BSCharacter : BSPhysObject
224 if (PhysBody.HasPhysicalBody && PhysShape.HasPhysicalShape) 224 if (PhysBody.HasPhysicalBody && PhysShape.HasPhysicalShape)
225 { 225 {
226 BulletSimAPI.SetLocalScaling2(PhysShape.ptr, Scale); 226 BulletSimAPI.SetLocalScaling2(PhysShape.ptr, Scale);
227 UpdatePhysicalMassProperties(RawMass); 227 UpdatePhysicalMassProperties(RawMass, true);
228 // Make sure this change appears as a property update event 228 // Make sure this change appears as a property update event
229 BulletSimAPI.PushUpdate2(PhysBody.ptr); 229 BulletSimAPI.PushUpdate2(PhysBody.ptr);
230 } 230 }
@@ -390,7 +390,7 @@ public sealed class BSCharacter : BSPhysObject
390 public override float RawMass { 390 public override float RawMass {
391 get {return _mass; } 391 get {return _mass; }
392 } 392 }
393 public override void UpdatePhysicalMassProperties(float physMass) 393 public override void UpdatePhysicalMassProperties(float physMass, bool inWorld)
394 { 394 {
395 OMV.Vector3 localInertia = BulletSimAPI.CalculateLocalInertia2(PhysShape.ptr, physMass); 395 OMV.Vector3 localInertia = BulletSimAPI.CalculateLocalInertia2(PhysShape.ptr, physMass);
396 BulletSimAPI.SetMassProps2(PhysBody.ptr, physMass, localInertia); 396 BulletSimAPI.SetMassProps2(PhysBody.ptr, physMass, localInertia);
@@ -772,8 +772,9 @@ public sealed class BSCharacter : BSPhysObject
772 // the motor can be turned off. Set the velocity to zero so the zero motion is sent to the viewer. 772 // the motor can be turned off. Set the velocity to zero so the zero motion is sent to the viewer.
773 if (_velocityMotor.TargetValue.ApproxEquals(OMV.Vector3.Zero, 0.01f) && _velocityMotor.ErrorIsZero) 773 if (_velocityMotor.TargetValue.ApproxEquals(OMV.Vector3.Zero, 0.01f) && _velocityMotor.ErrorIsZero)
774 { 774 {
775 stepVelocity = OMV.Vector3.Zero;
776 _velocityMotor.Enabled = false; 775 _velocityMotor.Enabled = false;
776 stepVelocity = OMV.Vector3.Zero;
777 ZeroMotion(true);
777 DetailLog("{0},BSCharacter.UpdateProperties,taint,disableVelocityMotor,m={1}", LocalID, _velocityMotor); 778 DetailLog("{0},BSCharacter.UpdateProperties,taint,disableVelocityMotor,m={1}", LocalID, _velocityMotor);
778 } 779 }
779 780