diff options
author | John Hurliman | 2009-10-29 01:46:58 -0700 |
---|---|---|
committer | John Hurliman | 2009-10-29 01:46:58 -0700 |
commit | 713287707595061d7ce343db73edf3462d2d29fc (patch) | |
tree | a70f73db1603cf233893645293ca0a0ca715c4cb /OpenSim/Region/Framework | |
parent | Small performance tweaks to code called by the heartbeat loop (diff) | |
download | opensim-SC-713287707595061d7ce343db73edf3462d2d29fc.zip opensim-SC-713287707595061d7ce343db73edf3462d2d29fc.tar.gz opensim-SC-713287707595061d7ce343db73edf3462d2d29fc.tar.bz2 opensim-SC-713287707595061d7ce343db73edf3462d2d29fc.tar.xz |
* 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
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 20 |
2 files changed, 13 insertions, 9 deletions
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) { | |||
1817 | } | 1817 | } |
1818 | 1818 | ||
1819 | CollisionEventUpdate a = (CollisionEventUpdate)e; | 1819 | CollisionEventUpdate a = (CollisionEventUpdate)e; |
1820 | Dictionary<uint, float> collissionswith = a.m_objCollisionList; | 1820 | Dictionary<uint, ContactPoint> collissionswith = a.m_objCollisionList; |
1821 | List<uint> thisHitColliders = new List<uint>(); | 1821 | List<uint> thisHitColliders = new List<uint>(); |
1822 | List<uint> endedColliders = new List<uint>(); | 1822 | List<uint> endedColliders = new List<uint>(); |
1823 | List<uint> startedColliders = new List<uint>(); | 1823 | List<uint> startedColliders = new List<uint>(); |
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 | |||
2367 | 2367 | ||
2368 | if (m_isChildAgent == false) | 2368 | if (m_isChildAgent == false) |
2369 | { | 2369 | { |
2370 | Vector3 velocity = m_physicsActor.Velocity; | ||
2371 | |||
2370 | // Throw away duplicate or insignificant updates | 2372 | // Throw away duplicate or insignificant updates |
2371 | if (!m_bodyRot.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || | 2373 | if (!m_bodyRot.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || |
2372 | !m_velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || | 2374 | !velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || |
2373 | !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || | 2375 | !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) || |
2374 | Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) | 2376 | Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE) |
2375 | { | 2377 | { |
@@ -2378,7 +2380,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2378 | // Update the "last" values | 2380 | // Update the "last" values |
2379 | m_lastPosition = m_pos; | 2381 | m_lastPosition = m_pos; |
2380 | m_lastRotation = m_bodyRot; | 2382 | m_lastRotation = m_bodyRot; |
2381 | m_lastVelocity = m_velocity; | 2383 | m_lastVelocity = velocity; |
2382 | m_lastTerseSent = Environment.TickCount; | 2384 | m_lastTerseSent = Environment.TickCount; |
2383 | } | 2385 | } |
2384 | 2386 | ||
@@ -2411,7 +2413,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2411 | //m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity); | 2413 | //m_log.DebugFormat("[SCENEPRESENCE]: TerseUpdate: Pos={0} Rot={1} Vel={2}", m_pos, m_bodyRot, m_velocity); |
2412 | 2414 | ||
2413 | remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_regionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, | 2415 | remoteClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_regionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, |
2414 | pos, m_velocity, Vector3.Zero, m_bodyRot, Vector4.UnitW, m_uuid, null, GetUpdatePriority(remoteClient))); | 2416 | pos, m_physicsActor.Velocity, Vector3.Zero, m_bodyRot, Vector4.UnitW, m_uuid, null, GetUpdatePriority(remoteClient))); |
2415 | 2417 | ||
2416 | m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS); | 2418 | m_scene.StatsReporter.AddAgentTime(Environment.TickCount - m_perfMonMS); |
2417 | m_scene.StatsReporter.AddAgentUpdates(1); | 2419 | m_scene.StatsReporter.AddAgentUpdates(1); |
@@ -3355,15 +3357,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
3355 | // as of this comment the interval is set in AddToPhysicalScene | 3357 | // as of this comment the interval is set in AddToPhysicalScene |
3356 | UpdateMovementAnimations(); | 3358 | UpdateMovementAnimations(); |
3357 | 3359 | ||
3360 | CollisionEventUpdate collisionData = (CollisionEventUpdate)e; | ||
3361 | Dictionary<uint, ContactPoint> coldata = collisionData.m_objCollisionList; | ||
3362 | |||
3358 | if (m_invulnerable) | 3363 | if (m_invulnerable) |
3359 | return; | 3364 | return; |
3360 | CollisionEventUpdate collisionData = (CollisionEventUpdate)e; | 3365 | |
3361 | Dictionary<uint, float> coldata = collisionData.m_objCollisionList; | ||
3362 | float starthealth = Health; | 3366 | float starthealth = Health; |
3363 | uint killerObj = 0; | 3367 | uint killerObj = 0; |
3364 | foreach (uint localid in coldata.Keys) | 3368 | foreach (uint localid in coldata.Keys) |
3365 | { | 3369 | { |
3366 | if (coldata[localid] <= 0.10f || m_invulnerable) | 3370 | if (coldata[localid].PenetrationDepth <= 0.10f || m_invulnerable) |
3367 | continue; | 3371 | continue; |
3368 | //if (localid == 0) | 3372 | //if (localid == 0) |
3369 | //continue; | 3373 | //continue; |
@@ -3373,9 +3377,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3373 | if (part != null && part.ParentGroup.Damage != -1.0f) | 3377 | if (part != null && part.ParentGroup.Damage != -1.0f) |
3374 | Health -= part.ParentGroup.Damage; | 3378 | Health -= part.ParentGroup.Damage; |
3375 | else | 3379 | else |
3376 | Health -= coldata[localid] * 5; | 3380 | Health -= coldata[localid].PenetrationDepth * 5.0f; |
3377 | 3381 | ||
3378 | if (Health <= 0) | 3382 | if (Health <= 0.0f) |
3379 | { | 3383 | { |
3380 | if (localid != 0) | 3384 | if (localid != 0) |
3381 | killerObj = localid; | 3385 | killerObj = localid; |