aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin
diff options
context:
space:
mode:
authorRobert Adams2013-07-23 09:09:25 -0700
committerRobert Adams2013-07-23 09:09:25 -0700
commitaec8d1e6be43422b0f93de47d6e46cc3e17399cc (patch)
tree075e7af60883ef035092554dcc91cbd05bf33e55 /OpenSim/Region/Physics/BulletSPlugin
parentRevert "Revert "BulletSim: Add logic to linksets to change physical propertie... (diff)
downloadopensim-SC_OLD-aec8d1e6be43422b0f93de47d6e46cc3e17399cc.zip
opensim-SC_OLD-aec8d1e6be43422b0f93de47d6e46cc3e17399cc.tar.gz
opensim-SC_OLD-aec8d1e6be43422b0f93de47d6e46cc3e17399cc.tar.bz2
opensim-SC_OLD-aec8d1e6be43422b0f93de47d6e46cc3e17399cc.tar.xz
BulletSim: Turn on center-of-mass calculation by default.
Reduce object density by factor of 100 to bring physical mass computations into a range better suited for Bullet.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSParam.cs8
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs4
2 files changed, 7 insertions, 5 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
index dcf1e83..0bdb5f1 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
@@ -461,8 +461,9 @@ public static class BSParam
461 (s) => { return MaxAddForceMagnitude; }, 461 (s) => { return MaxAddForceMagnitude; },
462 (s,v) => { MaxAddForceMagnitude = v; MaxAddForceMagnitudeSquared = v * v; } ), 462 (s,v) => { MaxAddForceMagnitude = v; MaxAddForceMagnitudeSquared = v * v; } ),
463 // Density is passed around as 100kg/m3. This scales that to 1kg/m3. 463 // Density is passed around as 100kg/m3. This scales that to 1kg/m3.
464 // Reduce by power of 100 because Bullet doesn't seem to handle objects with large mass very well
464 new ParameterDefn<float>("DensityScaleFactor", "Conversion for simulator/viewer density (100kg/m3) to physical density (1kg/m3)", 465 new ParameterDefn<float>("DensityScaleFactor", "Conversion for simulator/viewer density (100kg/m3) to physical density (1kg/m3)",
465 0.01f ), 466 0.0001f ),
466 467
467 new ParameterDefn<float>("PID_D", "Derivitive factor for motion smoothing", 468 new ParameterDefn<float>("PID_D", "Derivitive factor for motion smoothing",
468 2200f ), 469 2200f ),
@@ -607,8 +608,9 @@ public static class BSParam
607 0.0f ), 608 0.0f ),
608 new ParameterDefn<float>("VehicleRestitution", "Bouncyness factor for vehicles (0.0 - 1.0)", 609 new ParameterDefn<float>("VehicleRestitution", "Bouncyness factor for vehicles (0.0 - 1.0)",
609 0.0f ), 610 0.0f ),
611 // Turn off fudge with DensityScaleFactor = 0.0001. Value used to be 0.2f;
610 new ParameterDefn<float>("VehicleGroundGravityFudge", "Factor to multiply gravity if a ground vehicle is probably on the ground (0.0 - 1.0)", 612 new ParameterDefn<float>("VehicleGroundGravityFudge", "Factor to multiply gravity if a ground vehicle is probably on the ground (0.0 - 1.0)",
611 0.2f ), 613 1.0f ),
612 new ParameterDefn<float>("VehicleAngularBankingTimescaleFudge", "Factor to multiple angular banking timescale. Tune to increase realism.", 614 new ParameterDefn<float>("VehicleAngularBankingTimescaleFudge", "Factor to multiple angular banking timescale. Tune to increase realism.",
613 60.0f ), 615 60.0f ),
614 new ParameterDefn<bool>("VehicleEnableLinearDeflection", "Turn on/off vehicle linear deflection effect", 616 new ParameterDefn<bool>("VehicleEnableLinearDeflection", "Turn on/off vehicle linear deflection effect",
@@ -701,7 +703,7 @@ public static class BSParam
701 new ParameterDefn<float>("LinksetImplementation", "Type of linkset implementation (0=Constraint, 1=Compound, 2=Manual)", 703 new ParameterDefn<float>("LinksetImplementation", "Type of linkset implementation (0=Constraint, 1=Compound, 2=Manual)",
702 (float)BSLinkset.LinksetImplementation.Compound ), 704 (float)BSLinkset.LinksetImplementation.Compound ),
703 new ParameterDefn<bool>("LinksetOffsetCenterOfMass", "If 'true', compute linkset center-of-mass and offset linkset position to account for same", 705 new ParameterDefn<bool>("LinksetOffsetCenterOfMass", "If 'true', compute linkset center-of-mass and offset linkset position to account for same",
704 false ), 706 true ),
705 new ParameterDefn<bool>("LinkConstraintUseFrameOffset", "For linksets built with constraints, enable frame offsetFor linksets built with constraints, enable frame offset.", 707 new ParameterDefn<bool>("LinkConstraintUseFrameOffset", "For linksets built with constraints, enable frame offsetFor linksets built with constraints, enable frame offset.",
706 false ), 708 false ),
707 new ParameterDefn<bool>("LinkConstraintEnableTransMotor", "Whether to enable translational motor on linkset constraints", 709 new ParameterDefn<bool>("LinkConstraintEnableTransMotor", "Whether to enable translational motor on linkset constraints",
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index fdb2925..e92a1d2 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -440,8 +440,8 @@ public class BSPrim : BSPhysObject
440 Gravity = ComputeGravity(Buoyancy); 440 Gravity = ComputeGravity(Buoyancy);
441 PhysScene.PE.SetGravity(PhysBody, Gravity); 441 PhysScene.PE.SetGravity(PhysBody, Gravity);
442 442
443 OMV.Vector3 currentScale = PhysScene.PE.GetLocalScaling(PhysShape.physShapeInfo); // DEBUG DEBUG 443 // OMV.Vector3 currentScale = PhysScene.PE.GetLocalScaling(PhysShape.physShapeInfo); // DEBUG DEBUG
444 DetailLog("{0},BSPrim.UpdateMassProperties,currentScale{1},shape={2}", LocalID, currentScale, PhysShape.physShapeInfo); // DEBUG DEBUG 444 // DetailLog("{0},BSPrim.UpdateMassProperties,currentScale{1},shape={2}", LocalID, currentScale, PhysShape.physShapeInfo); // DEBUG DEBUG
445 445
446 Inertia = PhysScene.PE.CalculateLocalInertia(PhysShape.physShapeInfo, physMass); 446 Inertia = PhysScene.PE.CalculateLocalInertia(PhysShape.physShapeInfo, physMass);
447 PhysScene.PE.SetMassProps(PhysBody, physMass, Inertia); 447 PhysScene.PE.SetMassProps(PhysBody, physMass, Inertia);