diff options
author | Kitto Flora | 2010-09-02 21:51:19 +0000 |
---|---|---|
committer | Kitto Flora | 2010-09-02 21:51:19 +0000 |
commit | 16814dd8f18b51f5dd8841ae341847e117bb83b3 (patch) | |
tree | 46f1322936eb959292a320636c4a6f27be379d9e /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/ca... (diff) | |
download | opensim-SC-16814dd8f18b51f5dd8841ae341847e117bb83b3.zip opensim-SC-16814dd8f18b51f5dd8841ae341847e117bb83b3.tar.gz opensim-SC-16814dd8f18b51f5dd8841ae341847e117bb83b3.tar.bz2 opensim-SC-16814dd8f18b51f5dd8841ae341847e117bb83b3.tar.xz |
Fixes to JUMP system.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 66 |
1 files changed, 44 insertions, 22 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index cd80eb0..f682ee5 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1471,6 +1471,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1471 | if (actor.Flying != oldflying) | 1471 | if (actor.Flying != oldflying) |
1472 | update_movementflag = true; | 1472 | update_movementflag = true; |
1473 | 1473 | ||
1474 | if (m_animator.m_jumping) // add for jumping | ||
1475 | update_movementflag = true; | ||
1476 | |||
1474 | if (q != m_bodyRot) | 1477 | if (q != m_bodyRot) |
1475 | { | 1478 | { |
1476 | m_bodyRot = q; | 1479 | m_bodyRot = q; |
@@ -2580,6 +2583,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2580 | // m_log.Info("[AGENT]: Stop FLying"); | 2583 | // m_log.Info("[AGENT]: Stop FLying"); |
2581 | //} | 2584 | //} |
2582 | } | 2585 | } |
2586 | /* This jumping section removed to SPA | ||
2583 | else if (!actor.Flying && actor.IsColliding) | 2587 | else if (!actor.Flying && actor.IsColliding) |
2584 | { | 2588 | { |
2585 | if (direc.Z > 2.0f) | 2589 | if (direc.Z > 2.0f) |
@@ -2592,12 +2596,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2592 | { | 2596 | { |
2593 | direc.Z *= 0.1f; // prejump | 2597 | direc.Z *= 0.1f; // prejump |
2594 | } | 2598 | } |
2595 | /* Animations are controlled via GetMovementAnimation() in ScenePresenceAnimator.cs | 2599 | / * Animations are controlled via GetMovementAnimation() in ScenePresenceAnimator.cs |
2596 | Animator.TrySetMovementAnimation("PREJUMP"); | 2600 | Animator.TrySetMovementAnimation("PREJUMP"); |
2597 | Animator.TrySetMovementAnimation("JUMP"); | 2601 | Animator.TrySetMovementAnimation("JUMP"); |
2598 | */ | 2602 | * / |
2599 | } | 2603 | } |
2600 | } | 2604 | } */ |
2601 | } | 2605 | } |
2602 | 2606 | ||
2603 | // TODO: Add the force instead of only setting it to support multiple forces per frame? | 2607 | // TODO: Add the force instead of only setting it to support multiple forces per frame? |
@@ -3543,28 +3547,46 @@ namespace OpenSim.Region.Framework.Scenes | |||
3543 | /// </summary> | 3547 | /// </summary> |
3544 | public override void UpdateMovement() | 3548 | public override void UpdateMovement() |
3545 | { | 3549 | { |
3546 | if (m_forceToApply.HasValue) | 3550 | if (Animator!=null) // add for jumping |
3547 | { | 3551 | { // add for jumping |
3552 | // if (!m_animator.m_jumping) // add for jumping | ||
3553 | // { // add for jumping | ||
3548 | 3554 | ||
3549 | Vector3 force = m_forceToApply.Value; | 3555 | if (m_forceToApply.HasValue) // this section realigned |
3550 | m_updateflag = true; | 3556 | { |
3551 | Velocity = force; | ||
3552 | 3557 | ||
3553 | m_forceToApply = null; | 3558 | Vector3 force = m_forceToApply.Value; |
3554 | } | 3559 | m_updateflag = true; |
3555 | else | 3560 | if (m_animator.m_jumping) force.Z = m_animator.m_jumpVelocity; // add for jumping |
3556 | { | 3561 | Velocity = force; |
3557 | if (m_isNudging) | 3562 | //Console.WriteLine("UM1 {0}", Velocity); |
3558 | { | 3563 | m_forceToApply = null; |
3559 | Vector3 force = Vector3.Zero; | 3564 | } |
3565 | else | ||
3566 | { | ||
3567 | if (m_isNudging) | ||
3568 | { | ||
3569 | Vector3 force = Vector3.Zero; | ||
3570 | |||
3571 | m_updateflag = true; | ||
3572 | if (m_animator.m_jumping) force.Z = m_animator.m_jumpVelocity; // add for jumping | ||
3573 | Velocity = force; | ||
3574 | //Console.WriteLine("UM2 {0}", Velocity); | ||
3575 | m_isNudging = false; | ||
3576 | m_updateCount = UPDATE_COUNT; //KF: Update anims to pickup "STAND" | ||
3577 | } | ||
3578 | else // add for jumping | ||
3579 | { // add for jumping | ||
3580 | Vector3 force = Vector3.Zero; // add for jumping | ||
3581 | if (m_animator.m_jumping) force.Z = m_animator.m_jumpVelocity; // add for jumping | ||
3582 | //Console.WriteLine("UM3 {0}", Velocity); | ||
3583 | Velocity = force; // add for jumping | ||
3584 | } | ||
3560 | 3585 | ||
3561 | m_updateflag = true; | 3586 | } |
3562 | Velocity = force; | 3587 | // } // end realign |
3563 | m_isNudging = false; | 3588 | } // add for jumping |
3564 | m_updateCount = UPDATE_COUNT; //KF: Update anims to pickup "STAND" | 3589 | } // add for jumping |
3565 | } | ||
3566 | } | ||
3567 | } | ||
3568 | 3590 | ||
3569 | /// <summary> | 3591 | /// <summary> |
3570 | /// Adds a physical representation of the avatar to the Physics plugin | 3592 | /// Adds a physical representation of the avatar to the Physics plugin |