diff options
author | KittoFlora | 2009-11-25 08:03:09 +0100 |
---|---|---|
committer | KittoFlora | 2009-11-25 08:03:09 +0100 |
commit | 32c464ad1f43cbee9492108c1bec7f874a20cd47 (patch) | |
tree | dd224e11c97317403f04b6747c87b2682c1bab75 /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | Merge branch 'tests' of kitto@tor.k-grid.com:/home/kitto/opensim into caremin... (diff) | |
download | opensim-SC_OLD-32c464ad1f43cbee9492108c1bec7f874a20cd47.zip opensim-SC_OLD-32c464ad1f43cbee9492108c1bec7f874a20cd47.tar.gz opensim-SC_OLD-32c464ad1f43cbee9492108c1bec7f874a20cd47.tar.bz2 opensim-SC_OLD-32c464ad1f43cbee9492108c1bec7f874a20cd47.tar.xz |
Fixed animation sequencing: SitHere, Falling, Stand/Walk etc. Login Init
Av Animation at Stand.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 4e5fee1..a65b84b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -90,6 +90,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
90 | /// issue #1716 | 90 | /// issue #1716 |
91 | /// </summary> | 91 | /// </summary> |
92 | // private static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.1f, 0.0f, 0.3f); | 92 | // private static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.1f, 0.0f, 0.3f); |
93 | // Value revised by KF 091121 by comparison with SL. | ||
93 | private static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.0f, 0.0f, 0.418f); | 94 | private static readonly Vector3 SIT_TARGET_ADJUSTMENT = new Vector3(0.0f, 0.0f, 0.418f); |
94 | 95 | ||
95 | public UUID currentParcelUUID = UUID.Zero; | 96 | public UUID currentParcelUUID = UUID.Zero; |
@@ -205,6 +206,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
205 | private bool m_followCamAuto; | 206 | private bool m_followCamAuto; |
206 | 207 | ||
207 | private int m_movementUpdateCount; | 208 | private int m_movementUpdateCount; |
209 | private int m_lastColCount = -1; //KF: Look for Collision chnages | ||
210 | private int m_updateCount = 0; //KF: Update Anims for a while | ||
211 | private static readonly int UPDATE_COUNT = 10; // how many frames to update for | ||
208 | 212 | ||
209 | private const int NumMovementsBetweenRayCast = 5; | 213 | private const int NumMovementsBetweenRayCast = 5; |
210 | 214 | ||
@@ -662,9 +666,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
662 | 666 | ||
663 | AdjustKnownSeeds(); | 667 | AdjustKnownSeeds(); |
664 | 668 | ||
665 | // TODO: I think, this won't send anything, as we are still a child here... | 669 | Animator.TrySetMovementAnimation("STAND"); |
666 | Animator.TrySetMovementAnimation("STAND"); | ||
667 | |||
668 | // we created a new ScenePresence (a new child agent) in a fresh region. | 670 | // we created a new ScenePresence (a new child agent) in a fresh region. |
669 | // Request info about all the (root) agents in this region | 671 | // Request info about all the (root) agents in this region |
670 | // Note: This won't send data *to* other clients in that region (children don't send) | 672 | // Note: This won't send data *to* other clients in that region (children don't send) |
@@ -1018,7 +1020,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1018 | { | 1020 | { |
1019 | AbsolutePosition = AbsolutePosition + new Vector3(0f, 0f, (1.56f / 6f)); | 1021 | AbsolutePosition = AbsolutePosition + new Vector3(0f, 0f, (1.56f / 6f)); |
1020 | } | 1022 | } |
1021 | 1023 | ||
1024 | m_updateCount = UPDATE_COUNT; //KF: Trigger Anim updates to catch falling anim. | ||
1025 | |||
1022 | ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, | 1026 | ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId, |
1023 | AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient))); | 1027 | AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient))); |
1024 | } | 1028 | } |
@@ -1266,9 +1270,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1266 | 1270 | ||
1267 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) != 0) | 1271 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_SIT_ON_GROUND) != 0) |
1268 | { | 1272 | { |
1269 | // TODO: This doesn't prevent the user from walking yet. | 1273 | m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick. |
1270 | // Setting parent ID would fix this, if we knew what value | ||
1271 | // to use. Or we could add a m_isSitting variable. | ||
1272 | Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); | 1274 | Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); |
1273 | } | 1275 | } |
1274 | 1276 | ||
@@ -1926,7 +1928,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1926 | 1928 | ||
1927 | public void SitAltitudeCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance) | 1929 | public void SitAltitudeCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance) |
1928 | { | 1930 | { |
1929 | // Console.WriteLine("[RAYCASTRESULT]: Hit={0}, Point={1}, ID={2}, Dist={3}", hitYN, collisionPoint, localid, distance); | ||
1930 | if(hitYN) | 1931 | if(hitYN) |
1931 | { | 1932 | { |
1932 | // m_pos = Av offset from prim center to make look like on center | 1933 | // m_pos = Av offset from prim center to make look like on center |
@@ -2964,6 +2965,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2964 | m_updateflag = true; | 2965 | m_updateflag = true; |
2965 | Velocity = force; | 2966 | Velocity = force; |
2966 | m_isNudging = false; | 2967 | m_isNudging = false; |
2968 | m_updateCount = UPDATE_COUNT; //KF: Update anims to pickup "STAND" | ||
2967 | } | 2969 | } |
2968 | } | 2970 | } |
2969 | } | 2971 | } |
@@ -3015,19 +3017,29 @@ namespace OpenSim.Region.Framework.Scenes | |||
3015 | // Event called by the physics plugin to tell the avatar about a collision. | 3017 | // Event called by the physics plugin to tell the avatar about a collision. |
3016 | private void PhysicsCollisionUpdate(EventArgs e) | 3018 | private void PhysicsCollisionUpdate(EventArgs e) |
3017 | { | 3019 | { |
3020 | if (m_updateCount > 0) //KF: Update Anims for a short period. Many Anim | ||
3021 | { // changes are very asynchronous. | ||
3022 | Animator.UpdateMovementAnimations(); | ||
3023 | m_updateCount--; | ||
3024 | } | ||
3025 | |||
3018 | if (e == null) | 3026 | if (e == null) |
3019 | return; | 3027 | return; |
3020 | 3028 | ||
3021 | //if ((Math.Abs(Velocity.X) > 0.1e-9f) || (Math.Abs(Velocity.Y) > 0.1e-9f)) | ||
3022 | // The Physics Scene will send updates every 500 ms grep: m_physicsActor.SubscribeEvents( | 3029 | // The Physics Scene will send updates every 500 ms grep: m_physicsActor.SubscribeEvents( |
3023 | // as of this comment the interval is set in AddToPhysicalScene | 3030 | // as of this comment the interval is set in AddToPhysicalScene |
3024 | Animator.UpdateMovementAnimations(); | 3031 | |
3025 | |||
3026 | CollisionEventUpdate collisionData = (CollisionEventUpdate)e; | 3032 | CollisionEventUpdate collisionData = (CollisionEventUpdate)e; |
3027 | Dictionary<uint, ContactPoint> coldata = collisionData.m_objCollisionList; | 3033 | Dictionary<uint, ContactPoint> coldata = collisionData.m_objCollisionList; |
3028 | 3034 | ||
3029 | CollisionPlane = Vector4.UnitW; | 3035 | CollisionPlane = Vector4.UnitW; |
3030 | 3036 | ||
3037 | if (m_lastColCount != coldata.Count) | ||
3038 | { | ||
3039 | m_updateCount = 10; | ||
3040 | m_lastColCount = coldata.Count; | ||
3041 | } | ||
3042 | |||
3031 | if (coldata.Count != 0) | 3043 | if (coldata.Count != 0) |
3032 | { | 3044 | { |
3033 | switch (Animator.CurrentMovementAnimation) | 3045 | switch (Animator.CurrentMovementAnimation) |