From ec6347f987cc1e42761ff9bd4832da4f999401f0 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 20 Apr 2012 03:17:36 +0100 Subject: ubitODE - again avatar/terrain collision. Reduce new viewers interpolators efects reporting null velocity and aceleration when stopped near the right position, where they can still have instantanius large values that can get magnified by interpolators, specially using diferent timing estimation. --- OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs') diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs index ec4be58..f4aa231 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs @@ -862,12 +862,12 @@ namespace OpenSim.Region.Physics.OdePlugin float depth = terrainheight - chrminZ; if (!flying) { - vec.Z = -vel.Z * PID_D * 1.5f + depth * PID_P * 60; + vec.Z = -vel.Z * PID_D * 1.5f + depth * PID_P * 50; } else - vec.Z = depth * PID_P * 60; + vec.Z = depth * PID_P * 50; - if (depth < 0.2f) + if (depth < 0.1f) { m_iscolliding = true; m_colliderfilter = 2; @@ -1009,9 +1009,17 @@ namespace OpenSim.Region.Physics.OdePlugin // update our local ideia of position velocity and aceleration _position = localpos; - _acceleration = _velocity; // previus velocity - _velocity = vel; - _acceleration = (vel - _acceleration) / timeStep; + if (_zeroFlag) + { + _velocity = Vector3.Zero; + _acceleration = Vector3.Zero; + } + else + { + _acceleration = _velocity; // previus velocity + _velocity = vel; + _acceleration = (vel - _acceleration) / timeStep; + } } -- cgit v1.1 From e0f81e24000df3a969cd313d008194d8226272ff Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 23 Apr 2012 01:47:11 +0100 Subject: ubitODE - several changes... --- OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs') diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs index f4aa231..6ffcb9e 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs @@ -686,6 +686,9 @@ namespace OpenSim.Region.Physics.OdePlugin Body = d.BodyCreate(_parent_scene.world); + _zeroFlag = false; + m_pidControllerActive = true; + d.BodySetAutoDisableFlag(Body, false); d.BodySetPosition(Body, npositionX, npositionY, npositionZ); -- cgit v1.1