diff options
author | Robert Adams | 2017-10-13 12:00:07 -0700 |
---|---|---|
committer | Robert Adams | 2017-10-13 12:00:07 -0700 |
commit | df3759e09998bd05c2a09c79c38ada66fa6ec785 (patch) | |
tree | caa970ca92255d54bcd80f36d0536c53b959a73e | |
parent | remove a dead line of code (diff) | |
download | opensim-SC_OLD-df3759e09998bd05c2a09c79c38ada66fa6ec785.zip opensim-SC_OLD-df3759e09998bd05c2a09c79c38ada66fa6ec785.tar.gz opensim-SC_OLD-df3759e09998bd05c2a09c79c38ada66fa6ec785.tar.bz2 opensim-SC_OLD-df3759e09998bd05c2a09c79c38ada66fa6ec785.tar.xz |
BulletSim: Add parameter "[BulletSim]AvatarWalkVelocityFactor=1.0" to
adjust the walking speed passed from the simulator. Default is 1.0f so
there should be no change for regions who do not change the factor.
The adjustment for walking speed and AlwaysRun speed should be in the
simulator and not the physics engines (who all assume TargetVelocity.set
is only used for avatar walking/running) but that would require tweaking
all the phyiscs engines.
-rw-r--r-- | OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs | 14 | ||||
-rwxr-xr-x | OpenSim/Region/PhysicsModules/BulletS/BSParam.cs | 3 |
2 files changed, 13 insertions, 4 deletions
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs index 7faee70..d182c34 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs | |||
@@ -460,13 +460,19 @@ public sealed class BSCharacter : BSPhysObject | |||
460 | set | 460 | set |
461 | { | 461 | { |
462 | DetailLog("{0},BSCharacter.setTargetVelocity,call,vel={1}", LocalID, value); | 462 | DetailLog("{0},BSCharacter.setTargetVelocity,call,vel={1}", LocalID, value); |
463 | base.m_targetVelocity = value; | ||
464 | OMV.Vector3 targetVel = value; | 463 | OMV.Vector3 targetVel = value; |
465 | if (_setAlwaysRun && !_flying) | 464 | if (!_flying) |
466 | targetVel *= new OMV.Vector3(BSParam.AvatarAlwaysRunFactor, BSParam.AvatarAlwaysRunFactor, 1f); | 465 | { |
466 | if (_setAlwaysRun) | ||
467 | targetVel *= new OMV.Vector3(BSParam.AvatarAlwaysRunFactor, BSParam.AvatarAlwaysRunFactor, 1f); | ||
468 | else | ||
469 | if (BSParam.AvatarWalkVelocityFactor != 1f) | ||
470 | targetVel *= new OMV.Vector3(BSParam.AvatarWalkVelocityFactor, BSParam.AvatarWalkVelocityFactor, 1f); | ||
471 | } | ||
472 | base.m_targetVelocity = targetVel; | ||
467 | 473 | ||
468 | if (m_moveActor != null) | 474 | if (m_moveActor != null) |
469 | m_moveActor.SetVelocityAndTarget(RawVelocity, targetVel, false /* inTaintTime */); | 475 | m_moveActor.SetVelocityAndTarget(RawVelocity, base.m_targetVelocity, false /* inTaintTime */); |
470 | } | 476 | } |
471 | } | 477 | } |
472 | // Directly setting velocity means this is what the user really wants now. | 478 | // Directly setting velocity means this is what the user really wants now. |
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs b/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs index fcda92c..495f752 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs | |||
@@ -135,6 +135,7 @@ public static class BSParam | |||
135 | public static bool AvatarToAvatarCollisionsByDefault { get; private set; } | 135 | public static bool AvatarToAvatarCollisionsByDefault { get; private set; } |
136 | public static float AvatarFriction { get; private set; } | 136 | public static float AvatarFriction { get; private set; } |
137 | public static float AvatarStandingFriction { get; private set; } | 137 | public static float AvatarStandingFriction { get; private set; } |
138 | public static float AvatarWalkVelocityFactor { get; private set; } | ||
138 | public static float AvatarAlwaysRunFactor { get; private set; } | 139 | public static float AvatarAlwaysRunFactor { get; private set; } |
139 | public static float AvatarDensity { get; private set; } | 140 | public static float AvatarDensity { get; private set; } |
140 | public static float AvatarRestitution { get; private set; } | 141 | public static float AvatarRestitution { get; private set; } |
@@ -604,6 +605,8 @@ public static class BSParam | |||
604 | 0.2f ), | 605 | 0.2f ), |
605 | new ParameterDefn<float>("AvatarStandingFriction", "Avatar friction when standing. Changed on avatar recreation.", | 606 | new ParameterDefn<float>("AvatarStandingFriction", "Avatar friction when standing. Changed on avatar recreation.", |
606 | 0.95f ), | 607 | 0.95f ), |
608 | new ParameterDefn<float>("AvatarWalkVelocityFactor", "Speed multiplier if avatar is walking", | ||
609 | 1.0f ), | ||
607 | new ParameterDefn<float>("AvatarAlwaysRunFactor", "Speed multiplier if avatar is set to always run", | 610 | new ParameterDefn<float>("AvatarAlwaysRunFactor", "Speed multiplier if avatar is set to always run", |
608 | 1.3f ), | 611 | 1.3f ), |
609 | // For historical reasons, density is reported * 100 | 612 | // For historical reasons, density is reported * 100 |