diff options
author | Melanie Thielker | 2009-02-17 04:16:42 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-02-17 04:16:42 +0000 |
commit | 31307849342c36c133b5cb8039296116c5456136 (patch) | |
tree | 1922584dea8426a8d81873d4d68b552e9761add2 /OpenSim/Region/Framework | |
parent | Small change on dealing with ODE physics, so that this warning doesn't happen... (diff) | |
download | opensim-SC-31307849342c36c133b5cb8039296116c5456136.zip opensim-SC-31307849342c36c133b5cb8039296116c5456136.tar.gz opensim-SC-31307849342c36c133b5cb8039296116c5456136.tar.bz2 opensim-SC-31307849342c36c133b5cb8039296116c5456136.tar.xz |
Re-add the objectID field to the anim pack, that was deemed unneccessary
and dropped nonths ago, because it is required to get smooth region
crossings with AO running. Without it, in some corner cases, anims will
continue to run in an unstoppable state.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Animation.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/AnimationSet.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 29 |
3 files changed, 35 insertions, 22 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation.cs b/OpenSim/Region/Framework/Scenes/Animation.cs index cb0afa7..6f0681c 100644 --- a/OpenSim/Region/Framework/Scenes/Animation.cs +++ b/OpenSim/Region/Framework/Scenes/Animation.cs | |||
@@ -45,14 +45,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
45 | set { sequenceNum = value; } | 45 | set { sequenceNum = value; } |
46 | } | 46 | } |
47 | 47 | ||
48 | private UUID objectID; | ||
49 | public UUID ObjectID | ||
50 | { | ||
51 | get { return objectID; } | ||
52 | set { objectID = value; } | ||
53 | } | ||
54 | |||
48 | public Animation() | 55 | public Animation() |
49 | { | 56 | { |
50 | } | 57 | } |
51 | 58 | ||
52 | public Animation(UUID animID, int sequenceNum) | 59 | public Animation(UUID animID, int sequenceNum, UUID objectID) |
53 | { | 60 | { |
54 | this.animID = animID; | 61 | this.animID = animID; |
55 | this.sequenceNum = sequenceNum; | 62 | this.sequenceNum = sequenceNum; |
63 | this.objectID = objectID; | ||
56 | } | 64 | } |
57 | } | 65 | } |
58 | } | 66 | } |
diff --git a/OpenSim/Region/Framework/Scenes/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/AnimationSet.cs index 49bcda8..864e599 100644 --- a/OpenSim/Region/Framework/Scenes/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/AnimationSet.cs | |||
@@ -60,13 +60,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
60 | return false; | 60 | return false; |
61 | } | 61 | } |
62 | 62 | ||
63 | public bool Add(UUID animID, int sequenceNum) | 63 | public bool Add(UUID animID, int sequenceNum, UUID objectID) |
64 | { | 64 | { |
65 | lock (m_animations) | 65 | lock (m_animations) |
66 | { | 66 | { |
67 | if (!HasAnimation(animID)) | 67 | if (!HasAnimation(animID)) |
68 | { | 68 | { |
69 | m_animations.Add(new Animation(animID, sequenceNum)); | 69 | m_animations.Add(new Animation(animID, sequenceNum, objectID)); |
70 | return true; | 70 | return true; |
71 | } | 71 | } |
72 | } | 72 | } |
@@ -106,11 +106,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
106 | /// The default animation is reserved for "main" animations | 106 | /// The default animation is reserved for "main" animations |
107 | /// that are mutually exclusive, e.g. flying and sitting. | 107 | /// that are mutually exclusive, e.g. flying and sitting. |
108 | /// </summary> | 108 | /// </summary> |
109 | public bool SetDefaultAnimation(UUID animID, int sequenceNum) | 109 | public bool SetDefaultAnimation(UUID animID, int sequenceNum, UUID objectID) |
110 | { | 110 | { |
111 | if (m_defaultAnimation.AnimID != animID) | 111 | if (m_defaultAnimation.AnimID != animID) |
112 | { | 112 | { |
113 | m_defaultAnimation = new Animation(animID, sequenceNum); | 113 | m_defaultAnimation = new Animation(animID, sequenceNum, objectID); |
114 | return true; | 114 | return true; |
115 | } | 115 | } |
116 | return false; | 116 | return false; |
@@ -118,27 +118,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
118 | 118 | ||
119 | protected bool ResetDefaultAnimation() | 119 | protected bool ResetDefaultAnimation() |
120 | { | 120 | { |
121 | return TrySetDefaultAnimation("STAND", 1); | 121 | return TrySetDefaultAnimation("STAND", 1, UUID.Zero); |
122 | } | 122 | } |
123 | 123 | ||
124 | /// <summary> | 124 | /// <summary> |
125 | /// Set the animation as the default animation if it's known | 125 | /// Set the animation as the default animation if it's known |
126 | /// </summary> | 126 | /// </summary> |
127 | public bool TrySetDefaultAnimation(string anim, int sequenceNum) | 127 | public bool TrySetDefaultAnimation(string anim, int sequenceNum, UUID objectID) |
128 | { | 128 | { |
129 | if (Animations.AnimsUUID.ContainsKey(anim)) | 129 | if (Animations.AnimsUUID.ContainsKey(anim)) |
130 | { | 130 | { |
131 | return SetDefaultAnimation(Animations.AnimsUUID[anim], sequenceNum); | 131 | return SetDefaultAnimation(Animations.AnimsUUID[anim], sequenceNum, objectID); |
132 | } | 132 | } |
133 | return false; | 133 | return false; |
134 | } | 134 | } |
135 | 135 | ||
136 | public void GetArrays(out UUID[] animIDs, out int[] sequenceNums) | 136 | public void GetArrays(out UUID[] animIDs, out int[] sequenceNums, out UUID[] objectIDs) |
137 | { | 137 | { |
138 | lock (m_animations) | 138 | lock (m_animations) |
139 | { | 139 | { |
140 | animIDs = new UUID[m_animations.Count + 1]; | 140 | animIDs = new UUID[m_animations.Count + 1]; |
141 | sequenceNums = new int[m_animations.Count + 1]; | 141 | sequenceNums = new int[m_animations.Count + 1]; |
142 | objectIDs = new UUID[m_animations.Count + 1]; | ||
142 | 143 | ||
143 | animIDs[0] = m_defaultAnimation.AnimID; | 144 | animIDs[0] = m_defaultAnimation.AnimID; |
144 | sequenceNums[0] = m_defaultAnimation.SequenceNum; | 145 | sequenceNums[0] = m_defaultAnimation.SequenceNum; |
@@ -147,6 +148,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
147 | { | 148 | { |
148 | animIDs[i + 1] = m_animations[i].AnimID; | 149 | animIDs[i + 1] = m_animations[i].AnimID; |
149 | sequenceNums[i + 1] = m_animations[i].SequenceNum; | 150 | sequenceNums[i + 1] = m_animations[i].SequenceNum; |
151 | objectIDs[i + i] = m_animations[i].ObjectID; | ||
150 | } | 152 | } |
151 | } | 153 | } |
152 | } | 154 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index fc3166a..a488f59 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1754,18 +1754,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
1754 | } | 1754 | } |
1755 | } | 1755 | } |
1756 | 1756 | ||
1757 | public void AddAnimation(UUID animID) | 1757 | public void AddAnimation(UUID animID, UUID objectID) |
1758 | { | 1758 | { |
1759 | if (m_isChildAgent) | 1759 | if (m_isChildAgent) |
1760 | return; | 1760 | return; |
1761 | 1761 | ||
1762 | if (m_animations.Add(animID, m_controllingClient.NextAnimationSequenceNumber)) | 1762 | if (m_animations.Add(animID, m_controllingClient.NextAnimationSequenceNumber, objectID)) |
1763 | { | 1763 | { |
1764 | SendAnimPack(); | 1764 | SendAnimPack(); |
1765 | } | 1765 | } |
1766 | } | 1766 | } |
1767 | 1767 | ||
1768 | public void AddAnimation(string name) | 1768 | public void AddAnimation(string name, UUID objectID) |
1769 | { | 1769 | { |
1770 | if (m_isChildAgent) | 1770 | if (m_isChildAgent) |
1771 | return; | 1771 | return; |
@@ -1774,7 +1774,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1774 | if (animID == UUID.Zero) | 1774 | if (animID == UUID.Zero) |
1775 | return; | 1775 | return; |
1776 | 1776 | ||
1777 | AddAnimation(animID); | 1777 | AddAnimation(animID, objectID); |
1778 | } | 1778 | } |
1779 | 1779 | ||
1780 | public void RemoveAnimation(UUID animID) | 1780 | public void RemoveAnimation(UUID animID) |
@@ -1804,13 +1804,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1804 | { | 1804 | { |
1805 | UUID[] animIDs; | 1805 | UUID[] animIDs; |
1806 | int[] sequenceNums; | 1806 | int[] sequenceNums; |
1807 | m_animations.GetArrays( out animIDs, out sequenceNums ); | 1807 | UUID[] objectIDs; |
1808 | m_animations.GetArrays( out animIDs, out sequenceNums, out objectIDs); | ||
1808 | return animIDs; | 1809 | return animIDs; |
1809 | } | 1810 | } |
1810 | 1811 | ||
1811 | public void HandleStartAnim(IClientAPI remoteClient, UUID animID) | 1812 | public void HandleStartAnim(IClientAPI remoteClient, UUID animID) |
1812 | { | 1813 | { |
1813 | AddAnimation(animID); | 1814 | AddAnimation(animID, UUID.Zero); |
1814 | } | 1815 | } |
1815 | 1816 | ||
1816 | public void HandleStopAnim(IClientAPI remoteClient, UUID animID) | 1817 | public void HandleStopAnim(IClientAPI remoteClient, UUID animID) |
@@ -1826,7 +1827,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1826 | { | 1827 | { |
1827 | //m_log.DebugFormat("Updating movement animation to {0}", anim); | 1828 | //m_log.DebugFormat("Updating movement animation to {0}", anim); |
1828 | 1829 | ||
1829 | if (m_animations.TrySetDefaultAnimation(anim, m_controllingClient.NextAnimationSequenceNumber)) | 1830 | if (m_animations.TrySetDefaultAnimation(anim, m_controllingClient.NextAnimationSequenceNumber, UUID.Zero)) |
1830 | { | 1831 | { |
1831 | SendAnimPack(); | 1832 | SendAnimPack(); |
1832 | } | 1833 | } |
@@ -2284,13 +2285,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2284 | /// </summary> | 2285 | /// </summary> |
2285 | /// <param name="animations"></param> | 2286 | /// <param name="animations"></param> |
2286 | /// <param name="seqs"></param> | 2287 | /// <param name="seqs"></param> |
2287 | public void SendAnimPack(UUID[] animations, int[] seqs) | 2288 | public void SendAnimPack(UUID[] animations, int[] seqs, UUID[] objectIDs) |
2288 | { | 2289 | { |
2289 | if (m_isChildAgent) | 2290 | if (m_isChildAgent) |
2290 | return; | 2291 | return; |
2291 | 2292 | ||
2292 | m_scene.Broadcast( | 2293 | m_scene.Broadcast( |
2293 | delegate(IClientAPI client) { client.SendAnimations(animations, seqs, m_controllingClient.AgentId); }); | 2294 | delegate(IClientAPI client) { client.SendAnimations(animations, seqs, m_controllingClient.AgentId, objectIDs); }); |
2294 | } | 2295 | } |
2295 | 2296 | ||
2296 | public void SendAnimPackToClient(IClientAPI client) | 2297 | public void SendAnimPackToClient(IClientAPI client) |
@@ -2299,10 +2300,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2299 | return; | 2300 | return; |
2300 | UUID[] animIDs; | 2301 | UUID[] animIDs; |
2301 | int[] sequenceNums; | 2302 | int[] sequenceNums; |
2303 | UUID[] objectIDs; | ||
2302 | 2304 | ||
2303 | m_animations.GetArrays(out animIDs, out sequenceNums); | 2305 | m_animations.GetArrays(out animIDs, out sequenceNums, out objectIDs); |
2304 | 2306 | ||
2305 | client.SendAnimations(animIDs, sequenceNums, m_controllingClient.AgentId); | 2307 | client.SendAnimations(animIDs, sequenceNums, m_controllingClient.AgentId, objectIDs); |
2306 | } | 2308 | } |
2307 | 2309 | ||
2308 | /// <summary> | 2310 | /// <summary> |
@@ -2317,10 +2319,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2317 | 2319 | ||
2318 | UUID[] animIDs; | 2320 | UUID[] animIDs; |
2319 | int[] sequenceNums; | 2321 | int[] sequenceNums; |
2322 | UUID[] objectIDs; | ||
2320 | 2323 | ||
2321 | m_animations.GetArrays(out animIDs, out sequenceNums); | 2324 | m_animations.GetArrays(out animIDs, out sequenceNums, out objectIDs); |
2322 | 2325 | ||
2323 | SendAnimPack(animIDs, sequenceNums); | 2326 | SendAnimPack(animIDs, sequenceNums, objectIDs); |
2324 | } | 2327 | } |
2325 | 2328 | ||
2326 | #endregion | 2329 | #endregion |