aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorMelanie2012-05-13 01:25:03 +0100
committerMelanie2012-05-13 01:25:03 +0100
commitfe029cf4e8fc0940d887329a823e66e0c29bd92e (patch)
tree7c2ae75849307cda30da96b6300ee30295610b42 /OpenSim/Region/Framework/Scenes
parentMerge branch 'avination' into careminster (diff)
parentubitODE fix force in case of mlinear motor offset present (diff)
downloadopensim-SC-fe029cf4e8fc0940d887329a823e66e0c29bd92e.zip
opensim-SC-fe029cf4e8fc0940d887329a823e66e0c29bd92e.tar.gz
opensim-SC-fe029cf4e8fc0940d887329a823e66e0c29bd92e.tar.bz2
opensim-SC-fe029cf4e8fc0940d887329a823e66e0c29bd92e.tar.xz
Merge branch 'avination' into careminster
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs20
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs8
-rw-r--r--OpenSim/Region/Framework/Scenes/SimStatsReporter.cs9
3 files changed, 33 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index 14ae287..9ddac19 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -79,13 +79,13 @@ namespace OpenSim.Region.Framework.Scenes.Animation
79 m_scenePresence = sp; 79 m_scenePresence = sp;
80 CurrentMovementAnimation = "CROUCH"; 80 CurrentMovementAnimation = "CROUCH";
81 } 81 }
82 82
83 public void AddAnimation(UUID animID, UUID objectID) 83 public void AddAnimation(UUID animID, UUID objectID)
84 { 84 {
85 if (m_scenePresence.IsChildAgent) 85 if (m_scenePresence.IsChildAgent)
86 return; 86 return;
87 87
88// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} for {1}", animID, m_scenePresence.Name); 88 // m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} for {1}", animID, m_scenePresence.Name);
89 89
90 if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID)) 90 if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID))
91 SendAnimPack(); 91 SendAnimPack();
@@ -117,6 +117,22 @@ namespace OpenSim.Region.Framework.Scenes.Animation
117 SendAnimPack(); 117 SendAnimPack();
118 } 118 }
119 119
120 public void avnChangeAnim(UUID animID, bool addRemove, bool sendPack)
121 {
122 if (m_scenePresence.IsChildAgent)
123 return;
124
125 if (animID != UUID.Zero)
126 {
127 if (addRemove)
128 m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, UUID.Zero);
129 else
130 m_animations.Remove(animID);
131 }
132 if(sendPack)
133 SendAnimPack();
134 }
135
120 // Called from scripts 136 // Called from scripts
121 public void RemoveAnimation(string name) 137 public void RemoveAnimation(string name)
122 { 138 {
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 99ad685..1a8caae 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -789,6 +789,7 @@ namespace OpenSim.Region.Framework.Scenes
789 ControllingClient.OnSetAlwaysRun += HandleSetAlwaysRun; 789 ControllingClient.OnSetAlwaysRun += HandleSetAlwaysRun;
790 ControllingClient.OnStartAnim += HandleStartAnim; 790 ControllingClient.OnStartAnim += HandleStartAnim;
791 ControllingClient.OnStopAnim += HandleStopAnim; 791 ControllingClient.OnStopAnim += HandleStopAnim;
792 ControllingClient.OnChangeAnim += avnHandleChangeAnim;
792 ControllingClient.OnForceReleaseControls += HandleForceReleaseControls; 793 ControllingClient.OnForceReleaseControls += HandleForceReleaseControls;
793 ControllingClient.OnAutoPilotGo += MoveToTarget; 794 ControllingClient.OnAutoPilotGo += MoveToTarget;
794 795
@@ -2437,6 +2438,13 @@ namespace OpenSim.Region.Framework.Scenes
2437 Animator.RemoveAnimation(animID); 2438 Animator.RemoveAnimation(animID);
2438 } 2439 }
2439 2440
2441 public void avnHandleChangeAnim(UUID animID, bool addRemove,bool sendPack)
2442 {
2443 Animator.avnChangeAnim(animID, addRemove, sendPack);
2444 }
2445
2446
2447
2440 /// <summary> 2448 /// <summary>
2441 /// Rotate the avatar to the given rotation and apply a movement in the given relative vector 2449 /// Rotate the avatar to the given rotation and apply a movement in the given relative vector
2442 /// </summary> 2450 /// </summary>
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 94f1b15..a4afd47 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -264,8 +264,12 @@ namespace OpenSim.Region.Framework.Scenes
264 float targetframetime = 1100.0f / (float)m_nominalReportedFps; 264 float targetframetime = 1100.0f / (float)m_nominalReportedFps;
265 265
266 float sparetime; 266 float sparetime;
267 if (TotalFrameTime > targetframetime ) 267 float sleeptime;
268 if (TotalFrameTime > targetframetime)
269 {
268 sparetime = 0; 270 sparetime = 0;
271 sleeptime = 0;
272 }
269 else 273 else
270 { 274 {
271 sparetime = m_frameMS - m_physicsMS - m_agentMS; 275 sparetime = m_frameMS - m_physicsMS - m_agentMS;
@@ -274,6 +278,7 @@ namespace OpenSim.Region.Framework.Scenes
274 sparetime = 0; 278 sparetime = 0;
275 else if (sparetime > TotalFrameTime) 279 else if (sparetime > TotalFrameTime)
276 sparetime = TotalFrameTime; 280 sparetime = TotalFrameTime;
281 sleeptime = m_sleeptimeMS * perframe;
277 } 282 }
278 283
279 // other MS is actually simulation time 284 // other MS is actually simulation time
@@ -363,7 +368,7 @@ namespace OpenSim.Region.Framework.Scenes
363 sb[21].StatValue = sparetime; 368 sb[21].StatValue = sparetime;
364 369
365 sb[22].StatID = (uint)Stats.SimSleepTime; 370 sb[22].StatID = (uint)Stats.SimSleepTime;
366 sb[22].StatValue = m_sleeptimeMS * perframe; 371 sb[22].StatValue = sleeptime;
367 372
368 for (int i = 0; i < 23; i++) 373 for (int i = 0; i < 23; i++)
369 { 374 {