diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index de3380aa1b..75ccf1aee8 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -812,7 +812,10 @@ namespace OpenSim.Region.Environment.Scenes } if (m_physicsActor == null) + { AddToPhysicalScene(); + + } m_pos += m_parentPosition + new LLVector3(0.0f, 0.0f, 2.0f*m_sitAvatarHeight); m_parentPosition = new LLVector3(); @@ -820,6 +823,12 @@ namespace OpenSim.Region.Environment.Scenes m_parentID = 0; SendFullUpdateToAllClients(); + + if (m_physicsActor != null) + { + SetHeight(m_avHeight); + + } } SetMovementAnimation(Animations.AnimsLLUUID["STAND"], 1); diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 6bd27064e9..aa74509b78 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -112,11 +112,11 @@ namespace OpenSim.Region.Physics.OdePlugin if (System.Environment.OSVersion.Platform == PlatformID.Unix) { m_foundDebian = true; - m_tensor = 1000000f; + m_tensor = 2000000f; } else { - m_tensor = 1000000f; + m_tensor = 1300000f; } m_StandUpRotation = @@ -366,7 +366,17 @@ namespace OpenSim.Region.Physics.OdePlugin /// private void AvatarGeomAndBodyCreation(float npositionX, float npositionY, float npositionZ, float tensor) { - + + if (System.Environment.OSVersion.Platform == PlatformID.Unix) + { + m_foundDebian = true; + m_tensor = 2000000f; + } + else + { + m_tensor = 550000f; + } + int dAMotorEuler = 1; Shell = d.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH); d.MassSetCapsuleTotal(out ShellMass, m_mass, 2, CAPSULE_RADIUS, CAPSULE_LENGTH); @@ -561,7 +571,8 @@ namespace OpenSim.Region.Physics.OdePlugin // If the PID Controller isn't active then we set our force // calculating base velocity to the current position - + PID_D = 2200.0f; + PID_P = 900.0f; if (m_pidControllerActive == false) { @@ -599,8 +610,8 @@ namespace OpenSim.Region.Physics.OdePlugin // Prim to avatar collisions d.Vector3 pos = d.BodyGetPosition(Body); - vec.X = (_target_velocity.X - vel.X) * (PID_D) + (_zeroPosition.X - pos.X) * PID_P; - vec.Y = (_target_velocity.Y - vel.Y)*(PID_D) + (_zeroPosition.Y - pos.Y)*PID_P; + vec.X = (_target_velocity.X - vel.X) * (PID_D) + (_zeroPosition.X - pos.X) * (PID_P * 2); + vec.Y = (_target_velocity.Y - vel.Y)*(PID_D) + (_zeroPosition.Y - pos.Y)* (PID_P * 2); if (flying) { vec.Z = (_target_velocity.Z - vel.Z) * (PID_D) + (_zeroPosition.Z - pos.Z) * PID_P; @@ -612,12 +623,25 @@ namespace OpenSim.Region.Physics.OdePlugin { m_pidControllerActive = true; _zeroFlag = false; - if (m_iscolliding || flying) + if (m_iscolliding && !flying) { // We're flying and colliding with something - vec.X = ((_target_velocity.X/movementdivisor) - vel.X)*PID_D; - vec.Y = ((_target_velocity.Y/movementdivisor) - vel.Y)*PID_D; + vec.X = ((_target_velocity.X / movementdivisor) - vel.X) * (PID_D); + vec.Y = ((_target_velocity.Y / movementdivisor) - vel.Y) * (PID_D); } + else if (m_iscolliding && flying) + { + // We're flying and colliding with something + vec.X = ((_target_velocity.X/movementdivisor) - vel.X)*(PID_D / 16); + vec.Y = ((_target_velocity.Y/movementdivisor) - vel.Y)*(PID_D / 16); + } + else if (!m_iscolliding && flying) + { + // We're flying and colliding with something + vec.X = ((_target_velocity.X / movementdivisor) - vel.X) * (PID_D/6); + vec.Y = ((_target_velocity.Y / movementdivisor) - vel.Y) * (PID_D/6); + } + if (m_iscolliding && !flying && _target_velocity.Z > 0.0f) { // We're colliding with something and we're not flying but we're moving diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index e22b2a1579..610d4de165 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -338,7 +338,7 @@ namespace OpenSim.Region.Physics.OdePlugin { //This is disabled at the moment only because it needs more tweaking //It will eventually be uncommented - /* + if (contacts[i].depth >= 1.00f) { //MainLog.Instance.Debug("PHYSICS",contacts[i].depth.ToString()); @@ -350,6 +350,8 @@ namespace OpenSim.Region.Physics.OdePlugin (p1.PhysicsActorType == (int) ActorTypes.Agent && p2.PhysicsActorType == (int) ActorTypes.Prim)) { + //contacts[i].depth = contacts[i].depth * 4.15f; + /* if (p2.PhysicsActorType == (int) ActorTypes.Agent) { p2.CollidingObj = true; @@ -380,8 +382,9 @@ namespace OpenSim.Region.Physics.OdePlugin //contacts[i].depth = 0.0000000f; } + */ } - */ + // If you interpenetrate a prim with another prim if (p1.PhysicsActorType == (int) ActorTypes.Prim && p2.PhysicsActorType == (int) ActorTypes.Prim)