BulletSim: reduce avatar walking stopped threshold.

Add parameter for setting the walking stopped threshold.

This fixes the slight jump when an avatar stops walking.
0.7.6-extended
Robert Adams 2013-09-20 09:23:12 -07:00 committed by Justin Clark-Casey (justincc)
parent 3ba1d5259a
commit 2c856f2a60
2 changed files with 4 additions and 0 deletions

View File

@ -128,6 +128,7 @@ public class BSActorAvatarMove : BSActor
BSMotor.Infinite, // decay time scale BSMotor.Infinite, // decay time scale
1f // efficiency 1f // efficiency
); );
m_velocityMotor.ErrorZeroThreshold = BSParam.AvatarStopZeroThreshold;
// _velocityMotor.PhysicsScene = PhysicsScene; // DEBUG DEBUG so motor will output detail log messages. // _velocityMotor.PhysicsScene = PhysicsScene; // DEBUG DEBUG so motor will output detail log messages.
SetVelocityAndTarget(m_controllingPrim.RawVelocity, m_controllingPrim.TargetVelocity, true /* inTaintTime */); SetVelocityAndTarget(m_controllingPrim.RawVelocity, m_controllingPrim.TargetVelocity, true /* inTaintTime */);

View File

@ -134,6 +134,7 @@ public static class BSParam
public static float AvatarHeightMidFudge { get; private set; } public static float AvatarHeightMidFudge { get; private set; }
public static float AvatarHeightHighFudge { get; private set; } public static float AvatarHeightHighFudge { get; private set; }
public static float AvatarContactProcessingThreshold { get; private set; } public static float AvatarContactProcessingThreshold { get; private set; }
public static float AvatarStopZeroThreshold { get; private set; }
public static int AvatarJumpFrames { get; private set; } public static int AvatarJumpFrames { get; private set; }
public static float AvatarBelowGroundUpCorrectionMeters { get; private set; } public static float AvatarBelowGroundUpCorrectionMeters { get; private set; }
public static float AvatarStepHeight { get; private set; } public static float AvatarStepHeight { get; private set; }
@ -575,6 +576,8 @@ public static class BSParam
0.1f ), 0.1f ),
new ParameterDefn<float>("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions", new ParameterDefn<float>("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions",
0.1f ), 0.1f ),
new ParameterDefn<float>("AvatarStopZeroThreshold", "Movement velocity below which avatar is assumed to be stopped",
0.1f ),
new ParameterDefn<float>("AvatarBelowGroundUpCorrectionMeters", "Meters to move avatar up if it seems to be below ground", new ParameterDefn<float>("AvatarBelowGroundUpCorrectionMeters", "Meters to move avatar up if it seems to be below ground",
1.0f ), 1.0f ),
new ParameterDefn<int>("AvatarJumpFrames", "Number of frames to allow jump forces. Changes jump height.", new ParameterDefn<int>("AvatarJumpFrames", "Number of frames to allow jump forces. Changes jump height.",