From 52b341e2e24384395fddc7d32fd66358f5062468 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sun, 20 Jan 2013 22:35:42 -0800 Subject: 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. --- OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | 32 ++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (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 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 public static float MinimumObjectMass { get; private set; } public static float MaximumObjectMass { get; private set; } + public static float MaxLinearVelocity { get; private set; } + public static float MaxAngularVelocity { get; private set; } + public static float MaxAddForceMagnitude { get; private set; } public static float LinearDamping { get; private set; } public static float AngularDamping { get; private set; } @@ -79,6 +82,8 @@ public static class BSParam public static float AvatarStepApproachFactor { get; private set; } public static float AvatarStepForceFactor { get; private set; } + public static float VehicleMaxLinearVelocity { get; private set; } + public static float VehicleMaxAngularVelocity { get; private set; } public static float VehicleAngularDamping { get; private set; } public static float VehicleDebuggingEnabled { get; private set; } @@ -103,7 +108,6 @@ public static class BSParam public const float MaxDensity = 22587f; public const float MinRestitution = 0f; public const float MaxRestitution = 1f; - public const float MaxAddForceMagnitude = 20f; // =========================================================================== public delegate void ParamUser(BSScene scene, IConfig conf, string paramName, float val); @@ -247,6 +251,22 @@ public static class BSParam (s,cf,p,v) => { MaximumObjectMass = cf.GetFloat(p, v); }, (s) => { return (float)MaximumObjectMass; }, (s,p,l,v) => { MaximumObjectMass = v; } ), + new ParameterDefn("MaxLinearVelocity", "Maximum velocity magnitude that can be assigned to an object", + 1000.0f, + (s,cf,p,v) => { MaxLinearVelocity = cf.GetFloat(p, v); }, + (s) => { return (float)MaxLinearVelocity; }, + (s,p,l,v) => { MaxLinearVelocity = v; } ), + new ParameterDefn("MaxAngularVelocity", "Maximum rotational velocity magnitude that can be assigned to an object", + 1000.0f, + (s,cf,p,v) => { MaxAngularVelocity = cf.GetFloat(p, v); }, + (s) => { return (float)MaxAngularVelocity; }, + (s,p,l,v) => { MaxAngularVelocity = v; } ), + // LL documentation says thie number should be 20f + new ParameterDefn("MaxAddForceMagnitude", "Maximum force that can be applied by llApplyImpulse (SL says 20f)", + 200.0f, + (s,cf,p,v) => { MaxAddForceMagnitude = cf.GetFloat(p, v); }, + (s) => { return (float)MaxAddForceMagnitude; }, + (s,p,l,v) => { MaxAddForceMagnitude = v; } ), new ParameterDefn("PID_D", "Derivitive factor for motion smoothing", 2200f, @@ -423,6 +443,16 @@ public static class BSParam (s) => { return AvatarStepForceFactor; }, (s,p,l,v) => { AvatarStepForceFactor = v; } ), + new ParameterDefn("VehicleMaxLinearVelocity", "Maximum velocity magnitude that can be assigned to a vehicle", + 1000.0f, + (s,cf,p,v) => { VehicleMaxLinearVelocity = cf.GetFloat(p, v); }, + (s) => { return (float)VehicleMaxLinearVelocity; }, + (s,p,l,v) => { VehicleMaxLinearVelocity = v; } ), + new ParameterDefn("VehicleMaxAngularVelocity", "Maximum rotational velocity magnitude that can be assigned to a vehicle", + 12.0f, + (s,cf,p,v) => { VehicleMaxAngularVelocity = cf.GetFloat(p, v); }, + (s) => { return (float)VehicleMaxAngularVelocity; }, + (s,p,l,v) => { VehicleMaxAngularVelocity = v; } ), new ParameterDefn("VehicleAngularDamping", "Factor to damp vehicle angular movement per second (0.0 - 1.0)", 0.95f, (s,cf,p,v) => { VehicleAngularDamping = cf.GetFloat(p, v); }, -- cgit v1.1 From 3f6698a595593edc4027ff58cbebf947a6b5ac1f Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 21 Jan 2013 09:19:09 -0800 Subject: BulletSim: remove unused MaxTaintsToProcessPerStep parameter --- OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (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 6a92365..2b4488a 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs @@ -236,11 +236,7 @@ public static class BSParam (s,cf,p,v) => { s.m_maxUpdatesPerFrame = cf.GetInt(p, (int)v); }, (s) => { return (float)s.m_maxUpdatesPerFrame; }, (s,p,l,v) => { s.m_maxUpdatesPerFrame = (int)v; } ), - new ParameterDefn("MaxTaintsToProcessPerStep", "Number of update taints to process before each simulation step", - 500f, - (s,cf,p,v) => { s.m_taintsToProcessPerStep = cf.GetInt(p, (int)v); }, - (s) => { return (float)s.m_taintsToProcessPerStep; }, - (s,p,l,v) => { s.m_taintsToProcessPerStep = (int)v; } ), + new ParameterDefn("MinObjectMass", "Minimum object mass (0.0001)", 0.0001f, (s,cf,p,v) => { MinimumObjectMass = cf.GetFloat(p, v); }, @@ -261,9 +257,9 @@ public static class BSParam (s,cf,p,v) => { MaxAngularVelocity = cf.GetFloat(p, v); }, (s) => { return (float)MaxAngularVelocity; }, (s,p,l,v) => { MaxAngularVelocity = v; } ), - // LL documentation says thie number should be 20f + // LL documentation says thie number should be 20f for llApplyImpulse and 200f for llRezObject new ParameterDefn("MaxAddForceMagnitude", "Maximum force that can be applied by llApplyImpulse (SL says 20f)", - 200.0f, + 20000.0f, (s,cf,p,v) => { MaxAddForceMagnitude = cf.GetFloat(p, v); }, (s) => { return (float)MaxAddForceMagnitude; }, (s,p,l,v) => { MaxAddForceMagnitude = v; } ), -- cgit v1.1 From 80b1e32bfa00a2d3354f0d7e0df83a5b0b3e2c49 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Mon, 21 Jan 2013 23:43:24 -0800 Subject: BulletSim: Tweeks to vehicle motion. Pass through old angular velocity making for smoother transitions. Remove some old kludges for angular motion (damping and rotvel suppression). --- OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 2b4488a..da7438a 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs @@ -450,7 +450,7 @@ public static class BSParam (s) => { return (float)VehicleMaxAngularVelocity; }, (s,p,l,v) => { VehicleMaxAngularVelocity = v; } ), new ParameterDefn("VehicleAngularDamping", "Factor to damp vehicle angular movement per second (0.0 - 1.0)", - 0.95f, + 0.0f, (s,cf,p,v) => { VehicleAngularDamping = cf.GetFloat(p, v); }, (s) => { return VehicleAngularDamping; }, (s,p,l,v) => { VehicleAngularDamping = v; } ), -- cgit v1.1 From a5e9c665f08059fef16d0b0875697cb08e16351e Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Wed, 23 Jan 2013 09:09:17 -0800 Subject: BulletSim: center-of-gravity linkset changes. Not working yet. Conflicts: OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs --- OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (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 da7438a..9460daf 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs @@ -645,11 +645,8 @@ public static class BSParam entries.Add(new PhysParameterEntry(pd.name, pd.desc)); } - // make the list in alphabetical order for estetic reasons - entries.Sort(delegate(PhysParameterEntry ppe1, PhysParameterEntry ppe2) - { - return ppe1.name.CompareTo(ppe2.name); - }); + // make the list alphabetical for estetic reasons + entries.Sort((ppe1, ppe2) => { return ppe1.name.CompareTo(ppe2.name); }); SettableParameters = entries.ToArray(); } -- cgit v1.1