aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
diff options
context:
space:
mode:
authorRobert Adams2012-12-21 13:35:44 -0800
committerRobert Adams2012-12-21 13:35:44 -0800
commitae4d932e7f00e781db9c9cdd5c29efc51e2425fb (patch)
treeb03beb291cd35d4227fb82baf04ce14512b859eb /OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
parentBulletSim: small fix to avatar movement motor use which keeps avatar from fly... (diff)
downloadopensim-SC-ae4d932e7f00e781db9c9cdd5c29efc51e2425fb.zip
opensim-SC-ae4d932e7f00e781db9c9cdd5c29efc51e2425fb.tar.gz
opensim-SC-ae4d932e7f00e781db9c9cdd5c29efc51e2425fb.tar.bz2
opensim-SC-ae4d932e7f00e781db9c9cdd5c29efc51e2425fb.tar.xz
BulletSim: Move all the parameter variables, tables and get and fetch logic to a separate, static class for easier addition and to remove all that bulk from the BSScene class.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs30
1 files changed, 15 insertions, 15 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
index 57c5898..7bde1c1 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
@@ -88,8 +88,8 @@ public sealed class BSCharacter : BSPhysObject
88 // Old versions of ScenePresence passed only the height. If width and/or depth are zero, 88 // Old versions of ScenePresence passed only the height. If width and/or depth are zero,
89 // replace with the default values. 89 // replace with the default values.
90 _size = size; 90 _size = size;
91 if (_size.X == 0f) _size.X = PhysicsScene.Params.avatarCapsuleDepth; 91 if (_size.X == 0f) _size.X = BSParam.AvatarCapsuleDepth;
92 if (_size.Y == 0f) _size.Y = PhysicsScene.Params.avatarCapsuleWidth; 92 if (_size.Y == 0f) _size.Y = BSParam.AvatarCapsuleWidth;
93 93
94 // A motor to control the acceleration and deceleration of the avatar movement. 94 // A motor to control the acceleration and deceleration of the avatar movement.
95 // _velocityMotor = new BSVMotor("BSCharacter.Velocity", 3f, 5f, BSMotor.InfiniteVector, 1f); 95 // _velocityMotor = new BSVMotor("BSCharacter.Velocity", 3f, 5f, BSMotor.InfiniteVector, 1f);
@@ -108,8 +108,8 @@ public sealed class BSCharacter : BSPhysObject
108 _velocity = OMV.Vector3.Zero; 108 _velocity = OMV.Vector3.Zero;
109 _appliedVelocity = OMV.Vector3.Zero; 109 _appliedVelocity = OMV.Vector3.Zero;
110 _buoyancy = ComputeBuoyancyFromFlying(isFlying); 110 _buoyancy = ComputeBuoyancyFromFlying(isFlying);
111 _currentFriction = PhysicsScene.Params.avatarStandingFriction; 111 _currentFriction = BSParam.AvatarStandingFriction;
112 _avatarDensity = PhysicsScene.Params.avatarDensity; 112 _avatarDensity = BSParam.AvatarDensity;
113 113
114 // The dimensions of the avatar capsule are kept in the scale. 114 // The dimensions of the avatar capsule are kept in the scale.
115 // Physics creates a unit capsule which is scaled by the physics engine. 115 // Physics creates a unit capsule which is scaled by the physics engine.
@@ -161,14 +161,14 @@ public sealed class BSCharacter : BSPhysObject
161 // Needs to be reset especially when an avatar is recreated after crossing a region boundry. 161 // Needs to be reset especially when an avatar is recreated after crossing a region boundry.
162 Flying = _flying; 162 Flying = _flying;
163 163
164 BulletSimAPI.SetRestitution2(PhysBody.ptr, PhysicsScene.Params.avatarRestitution); 164 BulletSimAPI.SetRestitution2(PhysBody.ptr, BSParam.AvatarRestitution);
165 BulletSimAPI.SetMargin2(PhysShape.ptr, PhysicsScene.Params.collisionMargin); 165 BulletSimAPI.SetMargin2(PhysShape.ptr, PhysicsScene.Params.collisionMargin);
166 BulletSimAPI.SetLocalScaling2(PhysShape.ptr, Scale); 166 BulletSimAPI.SetLocalScaling2(PhysShape.ptr, Scale);
167 BulletSimAPI.SetContactProcessingThreshold2(PhysBody.ptr, PhysicsScene.Params.contactProcessingThreshold); 167 BulletSimAPI.SetContactProcessingThreshold2(PhysBody.ptr, BSParam.ContactProcessingThreshold);
168 if (PhysicsScene.Params.ccdMotionThreshold > 0f) 168 if (BSParam.CcdMotionThreshold > 0f)
169 { 169 {
170 BulletSimAPI.SetCcdMotionThreshold2(PhysBody.ptr, PhysicsScene.Params.ccdMotionThreshold); 170 BulletSimAPI.SetCcdMotionThreshold2(PhysBody.ptr, BSParam.CcdMotionThreshold);
171 BulletSimAPI.SetCcdSweptSphereRadius2(PhysBody.ptr, PhysicsScene.Params.ccdSweptSphereRadius); 171 BulletSimAPI.SetCcdSweptSphereRadius2(PhysBody.ptr, BSParam.CcdSweptSphereRadius);
172 } 172 }
173 173
174 UpdatePhysicalMassProperties(RawMass); 174 UpdatePhysicalMassProperties(RawMass);
@@ -208,8 +208,8 @@ public sealed class BSCharacter : BSPhysObject
208 _size = value; 208 _size = value;
209 // Old versions of ScenePresence passed only the height. If width and/or depth are zero, 209 // Old versions of ScenePresence passed only the height. If width and/or depth are zero,
210 // replace with the default values. 210 // replace with the default values.
211 if (_size.X == 0f) _size.X = PhysicsScene.Params.avatarCapsuleDepth; 211 if (_size.X == 0f) _size.X = BSParam.AvatarCapsuleDepth;
212 if (_size.Y == 0f) _size.Y = PhysicsScene.Params.avatarCapsuleWidth; 212 if (_size.Y == 0f) _size.Y = BSParam.AvatarCapsuleWidth;
213 213
214 ComputeAvatarScale(_size); 214 ComputeAvatarScale(_size);
215 ComputeAvatarVolumeAndMass(); 215 ComputeAvatarVolumeAndMass();
@@ -468,18 +468,18 @@ public sealed class BSCharacter : BSPhysObject
468 // to keep the avatar from slipping around 468 // to keep the avatar from slipping around
469 if (_velocity.Length() == 0) 469 if (_velocity.Length() == 0)
470 { 470 {
471 if (_currentFriction != PhysicsScene.Params.avatarStandingFriction) 471 if (_currentFriction != BSParam.AvatarStandingFriction)
472 { 472 {
473 _currentFriction = PhysicsScene.Params.avatarStandingFriction; 473 _currentFriction = BSParam.AvatarStandingFriction;
474 if (PhysBody.HasPhysicalBody) 474 if (PhysBody.HasPhysicalBody)
475 BulletSimAPI.SetFriction2(PhysBody.ptr, _currentFriction); 475 BulletSimAPI.SetFriction2(PhysBody.ptr, _currentFriction);
476 } 476 }
477 } 477 }
478 else 478 else
479 { 479 {
480 if (_currentFriction != PhysicsScene.Params.avatarFriction) 480 if (_currentFriction != BSParam.AvatarFriction)
481 { 481 {
482 _currentFriction = PhysicsScene.Params.avatarFriction; 482 _currentFriction = BSParam.AvatarFriction;
483 if (PhysBody.HasPhysicalBody) 483 if (PhysBody.HasPhysicalBody)
484 BulletSimAPI.SetFriction2(PhysBody.ptr, _currentFriction); 484 BulletSimAPI.SetFriction2(PhysBody.ptr, _currentFriction);
485 } 485 }