From 3a7c8d1f3265941105f9d7a5edc4f82057099a83 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sat, 8 Feb 2014 16:11:43 -0800 Subject: BulletSim: the minimum vehicle velocity was set too low so moving slow was getting zeroed too easily. Added VehicleMinVelocity parameter. --- OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs | 7 ++++++- OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs index 7b98f9d..0722d70 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSDynamics.cs @@ -1011,8 +1011,13 @@ namespace OpenSim.Region.Physics.BulletSPlugin VDetailLog("{0}, MoveLinear,clampMax,origVelW={1},lenSq={2},maxVelSq={3},,newVelW={4}", ControllingPrim.LocalID, origVelW, newVelocityLengthSq, BSParam.VehicleMaxLinearVelocitySquared, VehicleVelocity); } - else if (newVelocityLengthSq < 0.001f) + else if (newVelocityLengthSq < BSParam.VehicleMinLinearVelocitySquared) + { + Vector3 origVelW = VehicleVelocity; // DEBUG DEBUG + VDetailLog("{0}, MoveLinear,clampMin,origVelW={1},lenSq={2}", + ControllingPrim.LocalID, origVelW, newVelocityLengthSq); VehicleVelocity = Vector3.Zero; + } VDetailLog("{0}, MoveLinear,done,isColl={1},newVel={2}", ControllingPrim.LocalID, ControllingPrim.HasSomeCollision, VehicleVelocity ); diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs index d993e6a..860193f 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs @@ -147,6 +147,8 @@ public static class BSParam // Vehicle parameters public static float VehicleMaxLinearVelocity { get; private set; } public static float VehicleMaxLinearVelocitySquared { get; private set; } + public static float VehicleMinLinearVelocity { get; private set; } + public static float VehicleMinLinearVelocitySquared { get; private set; } public static float VehicleMaxAngularVelocity { get; private set; } public static float VehicleMaxAngularVelocitySq { get; private set; } public static float VehicleAngularDamping { get; private set; } @@ -598,6 +600,10 @@ public static class BSParam 1000.0f, (s) => { return (float)VehicleMaxLinearVelocity; }, (s,v) => { VehicleMaxLinearVelocity = v; VehicleMaxLinearVelocitySquared = v * v; } ), + new ParameterDefn("VehicleMinLinearVelocity", "Maximum velocity magnitude that can be assigned to a vehicle", + 0.001f, + (s) => { return (float)VehicleMinLinearVelocity; }, + (s,v) => { VehicleMinLinearVelocity = v; VehicleMinLinearVelocitySquared = v * v; } ), new ParameterDefn("VehicleMaxAngularVelocity", "Maximum rotational velocity magnitude that can be assigned to a vehicle", 12.0f, (s) => { return (float)VehicleMaxAngularVelocity; }, -- cgit v1.1