aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorMelanie2012-01-07 18:11:21 +0000
committerMelanie2012-01-07 18:11:21 +0000
commit4bf2e19898c64060f05535d21711ccb0ff2c31cd (patch)
tree75447b09329bc66eec4191d1c02e7782cb780d67 /OpenSim/Region/Framework
parentFix threat level setting on osNpcPlayAnimation (diff)
parentFix threat level setting on osNpcPlayAnimation (diff)
downloadopensim-SC-4bf2e19898c64060f05535d21711ccb0ff2c31cd.zip
opensim-SC-4bf2e19898c64060f05535d21711ccb0ff2c31cd.tar.gz
opensim-SC-4bf2e19898c64060f05535d21711ccb0ff2c31cd.tar.bz2
opensim-SC-4bf2e19898c64060f05535d21711ccb0ff2c31cd.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs36
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs6
2 files changed, 22 insertions, 20 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index eda085f..3584cda 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -61,11 +61,12 @@ namespace OpenSim.Region.Framework.Scenes.Animation
61 public bool m_jumping = false; 61 public bool m_jumping = false;
62 public float m_jumpVelocity = 0f; 62 public float m_jumpVelocity = 0f;
63// private int m_landing = 0; 63// private int m_landing = 0;
64 public bool Falling 64
65 { 65 /// <summary>
66 get { return m_falling; } 66 /// Is the avatar falling?
67 } 67 /// </summary>
68 private bool m_falling = false; 68 public bool Falling { get; private set; }
69
69 private float m_fallHeight; 70 private float m_fallHeight;
70 71
71 /// <value> 72 /// <value>
@@ -223,7 +224,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
223 m_animTickFall = 0; 224 m_animTickFall = 0;
224 m_animTickJump = 0; 225 m_animTickJump = 0;
225 m_jumping = false; 226 m_jumping = false;
226 m_falling = true; 227 Falling = false;
227 m_jumpVelocity = 0f; 228 m_jumpVelocity = 0f;
228 actor.Selected = false; 229 actor.Selected = false;
229 m_fallHeight = actor.Position.Z; // save latest flying height 230 m_fallHeight = actor.Position.Z; // save latest flying height
@@ -238,10 +239,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation
238 } 239 }
239 else if (move.Z < 0f) 240 else if (move.Z < 0f)
240 { 241 {
241 if (actor != null && actor.IsColliding) 242 if (actor != null && actor.IsColliding)
242 {
243 return "LAND"; 243 return "LAND";
244 }
245 else 244 else
246 return "HOVER_DOWN"; 245 return "HOVER_DOWN";
247 } 246 }
@@ -260,7 +259,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation
260 float fallElapsed = (float)(Environment.TickCount - m_animTickFall); 259 float fallElapsed = (float)(Environment.TickCount - m_animTickFall);
261 float fallVelocity = (actor != null) ? actor.Velocity.Z : 0.0f; 260 float fallVelocity = (actor != null) ? actor.Velocity.Z : 0.0f;
262 261
263 if (!m_jumping && (fallVelocity < -3.0f) ) m_falling = true; 262 if (!m_jumping && (fallVelocity < -3.0f))
263 Falling = true;
264 264
265 if (m_animTickFall == 0 || (fallVelocity >= 0.0f)) 265 if (m_animTickFall == 0 || (fallVelocity >= 0.0f))
266 { 266 {
@@ -290,20 +290,20 @@ namespace OpenSim.Region.Framework.Scenes.Animation
290 // Start jumping, prejump 290 // Start jumping, prejump
291 m_animTickFall = 0; 291 m_animTickFall = 0;
292 m_jumping = true; 292 m_jumping = true;
293 m_falling = false; 293 Falling = false;
294 actor.Selected = true; // borrowed for jumping flag 294 actor.Selected = true; // borrowed for jumping flag
295 m_animTickJump = Environment.TickCount; 295 m_animTickJump = Environment.TickCount;
296 m_jumpVelocity = 0.35f; 296 m_jumpVelocity = 0.35f;
297 return "PREJUMP"; 297 return "PREJUMP";
298 } 298 }
299 299
300 if(m_jumping) 300 if (m_jumping)
301 { 301 {
302 if ( (jumptime > (JUMP_PERIOD * 1.5f)) && actor.IsColliding) 302 if ((jumptime > (JUMP_PERIOD * 1.5f)) && actor.IsColliding)
303 { 303 {
304 // end jumping 304 // end jumping
305 m_jumping = false; 305 m_jumping = false;
306 m_falling = false; 306 Falling = false;
307 actor.Selected = false; // borrowed for jumping flag 307 actor.Selected = false; // borrowed for jumping flag
308 m_jumpVelocity = 0f; 308 m_jumpVelocity = 0f;
309 m_animTickFall = Environment.TickCount; 309 m_animTickFall = Environment.TickCount;
@@ -330,7 +330,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
330 330
331 if (CurrentMovementAnimation == "FALLDOWN") 331 if (CurrentMovementAnimation == "FALLDOWN")
332 { 332 {
333 m_falling = false; 333 Falling = false;
334 m_animTickFall = Environment.TickCount; 334 m_animTickFall = Environment.TickCount;
335 // TODO: SOFT_LAND support 335 // TODO: SOFT_LAND support
336 float fallHeight = m_fallHeight - actor.Position.Z; 336 float fallHeight = m_fallHeight - actor.Position.Z;
@@ -364,7 +364,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
364 if (move.X != 0f || move.Y != 0f) 364 if (move.X != 0f || move.Y != 0f)
365 { 365 {
366 m_fallHeight = actor.Position.Z; // save latest flying height 366 m_fallHeight = actor.Position.Z; // save latest flying height
367 m_falling = false; 367 Falling = false;
368 // Walking / crouchwalking / running 368 // Walking / crouchwalking / running
369 if (move.Z < 0f) 369 if (move.Z < 0f)
370 return "CROUCHWALK"; 370 return "CROUCHWALK";
@@ -375,7 +375,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
375 } 375 }
376 else if (!m_jumping) 376 else if (!m_jumping)
377 { 377 {
378 m_falling = false; 378 Falling = false;
379 // Not walking 379 // Not walking
380 if (move.Z < 0) 380 if (move.Z < 0)
381 return "CROUCH"; 381 return "CROUCH";
@@ -388,7 +388,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
388 } 388 }
389 #endregion Ground Movement 389 #endregion Ground Movement
390 390
391 m_falling = false; 391 Falling = false;
392 392
393 return CurrentMovementAnimation; 393 return CurrentMovementAnimation;
394 } 394 }
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index a301ccb..1232d0c 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1282,8 +1282,8 @@ namespace OpenSim.Region.Framework.Scenes
1282 public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) 1282 public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData)
1283 { 1283 {
1284// m_log.DebugFormat( 1284// m_log.DebugFormat(
1285// "[SCENE PRESENCE]: In {0} received agent update from {1}", 1285// "[SCENE PRESENCE]: In {0} received agent update from {1}, flags {2}",
1286// Scene.RegionInfo.RegionName, remoteClient.Name); 1286// Scene.RegionInfo.RegionName, remoteClient.Name, agentData.ControlFlags);
1287 1287
1288 if (IsChildAgent) 1288 if (IsChildAgent)
1289 { 1289 {
@@ -2323,6 +2323,8 @@ namespace OpenSim.Region.Framework.Scenes
2323 /// <param name="vec">The vector in which to move. This is relative to the rotation argument</param> 2323 /// <param name="vec">The vector in which to move. This is relative to the rotation argument</param>
2324 public void AddNewMovement(Vector3 vec) 2324 public void AddNewMovement(Vector3 vec)
2325 { 2325 {
2326// m_log.DebugFormat("[SCENE PRESENCE]: Adding new movement {0} for {1}", vec, Name);
2327
2326 Vector3 direc = vec * Rotation; 2328 Vector3 direc = vec * Rotation;
2327 direc.Normalize(); 2329 direc.Normalize();
2328 2330