diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Animation')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | 36 |
1 files changed, 18 insertions, 18 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 | } |