aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRobert Adams2012-03-18 11:53:53 -0700
committerRobert Adams2012-03-23 13:15:17 -0700
commitde24feb275ddd1c7e7c0b04900718a9000b8d49b (patch)
treeee2076519f9dfb19851593a38eef3f3cd5759ab0
parentBulletSim: set buoyancy in only one place (diff)
downloadopensim-SC-de24feb275ddd1c7e7c0b04900718a9000b8d49b.zip
opensim-SC-de24feb275ddd1c7e7c0b04900718a9000b8d49b.tar.gz
opensim-SC-de24feb275ddd1c7e7c0b04900718a9000b8d49b.tar.bz2
opensim-SC-de24feb275ddd1c7e7c0b04900718a9000b8d49b.tar.xz
BulletSim: Add AvatarRestitution parameter. Centralize computation of buoyancy for flying. Tweek avatar default friction and resititution
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs9
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs3
-rw-r--r--bin/OpenSimDefaults.ini3
3 files changed, 11 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
index e816b61..1a61431 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
@@ -94,7 +94,7 @@ public class BSCharacter : PhysicsActor
94 _flying = isFlying; 94 _flying = isFlying;
95 _orientation = Quaternion.Identity; 95 _orientation = Quaternion.Identity;
96 _velocity = Vector3.Zero; 96 _velocity = Vector3.Zero;
97 _buoyancy = isFlying ? 1f : 0f; 97 _buoyancy = ComputeBuoyancyFromFlying(isFlying);
98 _scale = new Vector3(1f, 1f, 1f); 98 _scale = new Vector3(1f, 1f, 1f);
99 _density = _scene.Params.avatarDensity; 99 _density = _scene.Params.avatarDensity;
100 ComputeAvatarVolumeAndMass(); // set _avatarVolume and _mass based on capsule size, _density and _scale 100 ComputeAvatarVolumeAndMass(); // set _avatarVolume and _mass based on capsule size, _density and _scale
@@ -110,7 +110,7 @@ public class BSCharacter : PhysicsActor
110 shapeData.Buoyancy = _buoyancy; 110 shapeData.Buoyancy = _buoyancy;
111 shapeData.Static = ShapeData.numericFalse; 111 shapeData.Static = ShapeData.numericFalse;
112 shapeData.Friction = _scene.Params.avatarFriction; 112 shapeData.Friction = _scene.Params.avatarFriction;
113 shapeData.Restitution = _scene.Params.defaultRestitution; 113 shapeData.Restitution = _scene.Params.avatarRestitution;
114 114
115 // do actual create at taint time 115 // do actual create at taint time
116 _scene.TaintedObject(delegate() 116 _scene.TaintedObject(delegate()
@@ -261,9 +261,12 @@ public class BSCharacter : PhysicsActor
261 set { 261 set {
262 _flying = value; 262 _flying = value;
263 // simulate flying by changing the effect of gravity 263 // simulate flying by changing the effect of gravity
264 this.Buoyancy(_flying ? 1f : 0f); 264 this.Buoyancy(ComputeBuoyancyFromFlying(_flying));
265 } 265 }
266 } 266 }
267 private float ComputeBuoyancyFromFlying(bool ifFlying) {
268 return ifFlying ? 1f : 0f;
269 }
267 public override bool 270 public override bool
268 SetAlwaysRun { 271 SetAlwaysRun {
269 get { return _setAlwaysRun; } 272 get { return _setAlwaysRun; }
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 977dcbe..9b12b4f 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -235,6 +235,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters
235 parms.terrainHitFraction = 0.8f; 235 parms.terrainHitFraction = 0.8f;
236 parms.terrainRestitution = 0f; 236 parms.terrainRestitution = 0f;
237 parms.avatarFriction = 0.5f; 237 parms.avatarFriction = 0.5f;
238 parms.avatarRestitution = 0.0f;
238 parms.avatarDensity = 60f; 239 parms.avatarDensity = 60f;
239 parms.avatarCapsuleRadius = 0.37f; 240 parms.avatarCapsuleRadius = 0.37f;
240 parms.avatarCapsuleHeight = 1.5f; // 2.140599f 241 parms.avatarCapsuleHeight = 1.5f; // 2.140599f
@@ -279,7 +280,9 @@ public class BSScene : PhysicsScene, IPhysicsParameters
279 parms.terrainHitFraction = pConfig.GetFloat("TerrainHitFraction", parms.terrainHitFraction); 280 parms.terrainHitFraction = pConfig.GetFloat("TerrainHitFraction", parms.terrainHitFraction);
280 parms.terrainRestitution = pConfig.GetFloat("TerrainRestitution", parms.terrainRestitution); 281 parms.terrainRestitution = pConfig.GetFloat("TerrainRestitution", parms.terrainRestitution);
281 parms.avatarFriction = pConfig.GetFloat("AvatarFriction", parms.avatarFriction); 282 parms.avatarFriction = pConfig.GetFloat("AvatarFriction", parms.avatarFriction);
283 parms.avatarRestitution = pConfig.GetFloat("AvatarRestitution", parms.avatarRestitution);
282 parms.avatarDensity = pConfig.GetFloat("AvatarDensity", parms.avatarDensity); 284 parms.avatarDensity = pConfig.GetFloat("AvatarDensity", parms.avatarDensity);
285 parms.avatarRestitution = pConfig.GetFloat("AvatarRestitution", parms.avatarRestitution);
283 parms.avatarCapsuleRadius = pConfig.GetFloat("AvatarCapsuleRadius", parms.avatarCapsuleRadius); 286 parms.avatarCapsuleRadius = pConfig.GetFloat("AvatarCapsuleRadius", parms.avatarCapsuleRadius);
284 parms.avatarCapsuleHeight = pConfig.GetFloat("AvatarCapsuleHeight", parms.avatarCapsuleHeight); 287 parms.avatarCapsuleHeight = pConfig.GetFloat("AvatarCapsuleHeight", parms.avatarCapsuleHeight);
285 } 288 }
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index 1216bce..a31e6f4 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -846,7 +846,8 @@
846 TerrainFriction = 0.50 846 TerrainFriction = 0.50
847 TerrainHitFriction = 0.8 847 TerrainHitFriction = 0.8
848 TerrainRestitution = 0 848 TerrainRestitution = 0
849 AvatarFriction = 0.5 849 AvatarFriction = 0.2
850 AvatarRestitution = 0.0
850 AvatarDensity = 60.0 851 AvatarDensity = 60.0
851 AvatarCapsuleRadius = 0.37 852 AvatarCapsuleRadius = 0.37
852 AvatarCapsuleHeight = 1.5 853 AvatarCapsuleHeight = 1.5