From 713287707595061d7ce343db73edf3462d2d29fc Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 29 Oct 2009 01:46:58 -0700 Subject: * Log progress messages when loading OAR files with a lot of assets * Change the PhysicsCollision callback for objects to send full contact point information. This will be used to calculate the collision plane for avatars * Send the physics engine velocity in terse updates, not the current force being applied to the avatar. This should fix several issues including crouching through the floor and walking through walls --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index cf1c394..3d41666 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -1817,7 +1817,7 @@ if (m_shape != null) { } CollisionEventUpdate a = (CollisionEventUpdate)e; - Dictionary collissionswith = a.m_objCollisionList; + Dictionary collissionswith = a.m_objCollisionList; List thisHitColliders = new List(); List endedColliders = new List(); List startedColliders = new List(); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 1ea4585..91044be 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2367,9 +2367,11 @@ namespace OpenSim.Region.Framework.Scenes if (m_isChildAgent == false) { + Vector3 velocity = m_physicsActor.Velocity; + // Throw away duplicate or insignificant updates if (!m_bodyRot.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || - !m_velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || + !velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) { @@ -2378,7 +2380,7 @@ namespace OpenSim.Region.Framework.Scenes // Update the "last" values m_lastPosition = m_pos; m_lastRotation = m_bodyRot; - m_lastVelocity = m_velocity; + m_lastVelocity = velocity; m_lastTerseSent = Environment.TickCount; } @@ -2411,7 +2413,7 @@ namespace OpenSim.Region.Framework.Scenes //m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity); remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_regionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, - pos, m_velocity, Vector3.Zero, m_bodyRot, Vector4.UnitW, m_uuid, null, GetUpdatePriority(remoteClient))); + pos, m_physicsActor.Velocity, Vector3.Zero, m_bodyRot, Vector4.UnitW, m_uuid, null, GetUpdatePriority(remoteClient))); m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS); m_scene.StatsReporter.AddAgentUpdates(1); @@ -3355,15 +3357,17 @@ namespace OpenSim.Region.Framework.Scenes // as of this comment the interval is set in AddToPhysicalScene UpdateMovementAnimations(); + CollisionEventUpdate collisionData = (CollisionEventUpdate)e; + Dictionary coldata = collisionData.m_objCollisionList; + if (m_invulnerable) return; - CollisionEventUpdate collisionData = (CollisionEventUpdate)e; - Dictionary coldata = collisionData.m_objCollisionList; + float starthealth = Health; uint killerObj = 0; foreach (uint localid in coldata.Keys) { - if (coldata[localid] <= 0.10f || m_invulnerable) + if (coldata[localid].PenetrationDepth <= 0.10f || m_invulnerable) continue; //if (localid == 0) //continue; @@ -3373,9 +3377,9 @@ namespace OpenSim.Region.Framework.Scenes if (part != null && part.ParentGroup.Damage != -1.0f) Health -= part.ParentGroup.Damage; else - Health -= coldata[localid] * 5; + Health -= coldata[localid].PenetrationDepth * 5.0f; - if (Health <= 0) + if (Health <= 0.0f) { if (localid != 0) killerObj = localid; -- cgit v1.1