diff options
author | Robert Adams | 2013-01-20 22:35:42 -0800 |
---|---|---|
committer | Robert Adams | 2013-01-20 23:09:54 -0800 |
commit | 52b341e2e24384395fddc7d32fd66358f5062468 (patch) | |
tree | a0b28ec5b79004b1a556db78d835e486b8040632 /OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | |
parent | BulletSim: fix problem of avatar sliding very slowly occasionally after stopp... (diff) | |
download | opensim-SC-52b341e2e24384395fddc7d32fd66358f5062468.zip opensim-SC-52b341e2e24384395fddc7d32fd66358f5062468.tar.gz opensim-SC-52b341e2e24384395fddc7d32fd66358f5062468.tar.bz2 opensim-SC-52b341e2e24384395fddc7d32fd66358f5062468.tar.xz |
BulletSim: More aggressive as setting character velocity to zero
when should be standing.
Modify angular force routines to be the same pattern as linear force routines.
BulletSim vehicle turning is scaled like SL and is DIFFERENT THAN ODE!!
Fix some bugs in BSMotor dealing with the motor going to zero.
Add a bunch of parameters: MaxLinearVelocity, MaxAngularVelocity,
MaxAddForceMagnitude, VehicleMaxLinearVelocity, VehicleMaxAngularVelocity,
and most of the values are defaulted to values that are larger
than in SL.
Use the new parameters in BSPrim, BSCharacter and BSDynamic.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSParam.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs index 3e80aa4..6a92365 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | |||
@@ -45,6 +45,9 @@ public static class BSParam | |||
45 | 45 | ||
46 | public static float MinimumObjectMass { get; private set; } | 46 | public static float MinimumObjectMass { get; private set; } |
47 | public static float MaximumObjectMass { get; private set; } | 47 | public static float MaximumObjectMass { get; private set; } |
48 | public static float MaxLinearVelocity { get; private set; } | ||
49 | public static float MaxAngularVelocity { get; private set; } | ||
50 | public static float MaxAddForceMagnitude { get; private set; } | ||
48 | 51 | ||
49 | public static float LinearDamping { get; private set; } | 52 | public static float LinearDamping { get; private set; } |
50 | public static float AngularDamping { get; private set; } | 53 | public static float AngularDamping { get; private set; } |
@@ -79,6 +82,8 @@ public static class BSParam | |||
79 | public static float AvatarStepApproachFactor { get; private set; } | 82 | public static float AvatarStepApproachFactor { get; private set; } |
80 | public static float AvatarStepForceFactor { get; private set; } | 83 | public static float AvatarStepForceFactor { get; private set; } |
81 | 84 | ||
85 | public static float VehicleMaxLinearVelocity { get; private set; } | ||
86 | public static float VehicleMaxAngularVelocity { get; private set; } | ||
82 | public static float VehicleAngularDamping { get; private set; } | 87 | public static float VehicleAngularDamping { get; private set; } |
83 | public static float VehicleDebuggingEnabled { get; private set; } | 88 | public static float VehicleDebuggingEnabled { get; private set; } |
84 | 89 | ||
@@ -103,7 +108,6 @@ public static class BSParam | |||
103 | public const float MaxDensity = 22587f; | 108 | public const float MaxDensity = 22587f; |
104 | public const float MinRestitution = 0f; | 109 | public const float MinRestitution = 0f; |
105 | public const float MaxRestitution = 1f; | 110 | public const float MaxRestitution = 1f; |
106 | public const float MaxAddForceMagnitude = 20f; | ||
107 | 111 | ||
108 | // =========================================================================== | 112 | // =========================================================================== |
109 | public delegate void ParamUser(BSScene scene, IConfig conf, string paramName, float val); | 113 | public delegate void ParamUser(BSScene scene, IConfig conf, string paramName, float val); |
@@ -247,6 +251,22 @@ public static class BSParam | |||
247 | (s,cf,p,v) => { MaximumObjectMass = cf.GetFloat(p, v); }, | 251 | (s,cf,p,v) => { MaximumObjectMass = cf.GetFloat(p, v); }, |
248 | (s) => { return (float)MaximumObjectMass; }, | 252 | (s) => { return (float)MaximumObjectMass; }, |
249 | (s,p,l,v) => { MaximumObjectMass = v; } ), | 253 | (s,p,l,v) => { MaximumObjectMass = v; } ), |
254 | new ParameterDefn("MaxLinearVelocity", "Maximum velocity magnitude that can be assigned to an object", | ||
255 | 1000.0f, | ||
256 | (s,cf,p,v) => { MaxLinearVelocity = cf.GetFloat(p, v); }, | ||
257 | (s) => { return (float)MaxLinearVelocity; }, | ||
258 | (s,p,l,v) => { MaxLinearVelocity = v; } ), | ||
259 | new ParameterDefn("MaxAngularVelocity", "Maximum rotational velocity magnitude that can be assigned to an object", | ||
260 | 1000.0f, | ||
261 | (s,cf,p,v) => { MaxAngularVelocity = cf.GetFloat(p, v); }, | ||
262 | (s) => { return (float)MaxAngularVelocity; }, | ||
263 | (s,p,l,v) => { MaxAngularVelocity = v; } ), | ||
264 | // LL documentation says thie number should be 20f | ||
265 | new ParameterDefn("MaxAddForceMagnitude", "Maximum force that can be applied by llApplyImpulse (SL says 20f)", | ||
266 | 200.0f, | ||
267 | (s,cf,p,v) => { MaxAddForceMagnitude = cf.GetFloat(p, v); }, | ||
268 | (s) => { return (float)MaxAddForceMagnitude; }, | ||
269 | (s,p,l,v) => { MaxAddForceMagnitude = v; } ), | ||
250 | 270 | ||
251 | new ParameterDefn("PID_D", "Derivitive factor for motion smoothing", | 271 | new ParameterDefn("PID_D", "Derivitive factor for motion smoothing", |
252 | 2200f, | 272 | 2200f, |
@@ -423,6 +443,16 @@ public static class BSParam | |||
423 | (s) => { return AvatarStepForceFactor; }, | 443 | (s) => { return AvatarStepForceFactor; }, |
424 | (s,p,l,v) => { AvatarStepForceFactor = v; } ), | 444 | (s,p,l,v) => { AvatarStepForceFactor = v; } ), |
425 | 445 | ||
446 | new ParameterDefn("VehicleMaxLinearVelocity", "Maximum velocity magnitude that can be assigned to a vehicle", | ||
447 | 1000.0f, | ||
448 | (s,cf,p,v) => { VehicleMaxLinearVelocity = cf.GetFloat(p, v); }, | ||
449 | (s) => { return (float)VehicleMaxLinearVelocity; }, | ||
450 | (s,p,l,v) => { VehicleMaxLinearVelocity = v; } ), | ||
451 | new ParameterDefn("VehicleMaxAngularVelocity", "Maximum rotational velocity magnitude that can be assigned to a vehicle", | ||
452 | 12.0f, | ||
453 | (s,cf,p,v) => { VehicleMaxAngularVelocity = cf.GetFloat(p, v); }, | ||
454 | (s) => { return (float)VehicleMaxAngularVelocity; }, | ||
455 | (s,p,l,v) => { VehicleMaxAngularVelocity = v; } ), | ||
426 | new ParameterDefn("VehicleAngularDamping", "Factor to damp vehicle angular movement per second (0.0 - 1.0)", | 456 | new ParameterDefn("VehicleAngularDamping", "Factor to damp vehicle angular movement per second (0.0 - 1.0)", |
427 | 0.95f, | 457 | 0.95f, |
428 | (s,cf,p,v) => { VehicleAngularDamping = cf.GetFloat(p, v); }, | 458 | (s,cf,p,v) => { VehicleAngularDamping = cf.GetFloat(p, v); }, |