From 8452c0a8702ccf7ea045740dd829c69a6f509845 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 7 Jan 2013 16:05:02 -0800 Subject: BulletSim: add function to push avatar up when hitting stairs. It looks like BulletSim and ODE rely on penetration correction to cause the avatar to move up and thus allowing walking up stairs. Object penetration was minimized for walking and flying (so one doesn't go through walls) and this stopped stairs from working. This commit introduces avatar movement code to check for collisions at the feet while walking and attempts to raise the avatar for the steps. Not yet perfect but movement is better. --- OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSParam.cs') diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs index b9bd0bf..23d573f 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs @@ -75,6 +75,9 @@ public static class BSParam public static float AvatarCapsuleDepth { get; private set; } public static float AvatarCapsuleHeight { get; private set; } public static float AvatarContactProcessingThreshold { get; private set; } + public static float AvatarStepHeight { get; private set; } + public static float AvatarStepApproachFactor { get; private set; } + public static float AvatarStepForceFactor { get; private set; } public static float VehicleAngularDamping { get; private set; } @@ -403,6 +406,21 @@ public static class BSParam (s,cf,p,v) => { AvatarContactProcessingThreshold = cf.GetFloat(p, v); }, (s) => { return AvatarContactProcessingThreshold; }, (s,p,l,v) => { s.UpdateParameterObject((x)=>{AvatarContactProcessingThreshold=x;}, p, l, v); } ), + new ParameterDefn("AvatarStepHeight", "Height of a step obstacle to consider step correction", + 0.3f, + (s,cf,p,v) => { AvatarStepHeight = cf.GetFloat(p, v); }, + (s) => { return AvatarStepHeight; }, + (s,p,l,v) => { AvatarStepHeight = v; } ), + new ParameterDefn("AvatarStepApproachFactor", "Factor to control angle of approach to step (0=straight on)", + 0.6f, + (s,cf,p,v) => { AvatarStepApproachFactor = cf.GetFloat(p, v); }, + (s) => { return AvatarStepApproachFactor; }, + (s,p,l,v) => { AvatarStepApproachFactor = v; } ), + new ParameterDefn("AvatarStepForceFactor", "Controls the amount of force up applied to step up onto a step", + 2.0f, + (s,cf,p,v) => { AvatarStepForceFactor = cf.GetFloat(p, v); }, + (s) => { return AvatarStepForceFactor; }, + (s,p,l,v) => { AvatarStepForceFactor = v; } ), new ParameterDefn("VehicleAngularDamping", "Factor to damp vehicle angular movement per second (0.0 - 1.0)", 0.95f, -- cgit v1.1