diff options
author | UbitUmarov | 2014-07-20 20:20:59 +0100 |
---|---|---|
committer | UbitUmarov | 2014-07-20 20:20:59 +0100 |
commit | 719880a6ff3a784ddb9db7bb6a646a78c691bad3 (patch) | |
tree | 7df6eba19c855c5685bfacece726168ca90a2bf8 /OpenSim/Region | |
parent | another change to standup (diff) | |
download | opensim-SC-719880a6ff3a784ddb9db7bb6a646a78c691bad3.zip opensim-SC-719880a6ff3a784ddb9db7bb6a646a78c691bad3.tar.gz opensim-SC-719880a6ff3a784ddb9db7bb6a646a78c691bad3.tar.bz2 opensim-SC-719880a6ff3a784ddb9db7bb6a646a78c691bad3.tar.xz |
make sittarget camera relative to root prim
Please enter the commit message for your changes. Lines starting
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a5c2e0d..93bcef2 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2631,6 +2631,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2631 | if (part == null) | 2631 | if (part == null) |
2632 | return; | 2632 | return; |
2633 | 2633 | ||
2634 | |||
2634 | if (PhysicsActor != null) | 2635 | if (PhysicsActor != null) |
2635 | m_sitAvatarHeight = PhysicsActor.Size.Z * 0.5f; | 2636 | m_sitAvatarHeight = PhysicsActor.Size.Z * 0.5f; |
2636 | 2637 | ||
@@ -2638,23 +2639,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2638 | 2639 | ||
2639 | if (part.IsSitTargetSet && part.SitTargetAvatar == UUID.Zero) | 2640 | if (part.IsSitTargetSet && part.SitTargetAvatar == UUID.Zero) |
2640 | { | 2641 | { |
2641 | // m_log.DebugFormat( | ||
2642 | // "[SCENE PRESENCE]: Sitting {0} on {1} {2} because sit target is set and unoccupied", | ||
2643 | // Name, part.Name, part.LocalId); | ||
2644 | |||
2645 | offset = part.SitTargetPosition; | 2642 | offset = part.SitTargetPosition; |
2646 | sitOrientation = part.SitTargetOrientation; | 2643 | sitOrientation = part.SitTargetOrientation; |
2647 | 2644 | ||
2648 | if (!part.IsRoot) | ||
2649 | { | ||
2650 | // m_log.DebugFormat("Old sit orient {0}", sitOrientation); | ||
2651 | sitOrientation = part.RotationOffset * sitOrientation; | ||
2652 | // m_log.DebugFormat("New sit orient {0}", sitOrientation); | ||
2653 | // m_log.DebugFormat("Old sit offset {0}", offset); | ||
2654 | offset = offset * part.RotationOffset; | ||
2655 | // m_log.DebugFormat("New sit offset {0}", offset); | ||
2656 | } | ||
2657 | |||
2658 | canSit = true; | 2645 | canSit = true; |
2659 | } | 2646 | } |
2660 | else | 2647 | else |
@@ -2691,9 +2678,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
2691 | cameraEyeOffset = part.GetCameraEyeOffset(); | 2678 | cameraEyeOffset = part.GetCameraEyeOffset(); |
2692 | forceMouselook = part.GetForceMouselook(); | 2679 | forceMouselook = part.GetForceMouselook(); |
2693 | 2680 | ||
2694 | // An viewer expects to specify sit positions as offsets to the root prim, even if a child prim is | 2681 | if (!part.IsRoot) |
2695 | // being sat upon. | 2682 | { |
2696 | offset += part.OffsetPosition; | 2683 | sitOrientation = part.RotationOffset * sitOrientation; |
2684 | offset = offset * part.RotationOffset; | ||
2685 | cameraAtOffset = cameraAtOffset * part.RotationOffset; | ||
2686 | cameraEyeOffset = cameraEyeOffset * part.RotationOffset; | ||
2687 | |||
2688 | offset += part.OffsetPosition; | ||
2689 | cameraAtOffset += part.OffsetPosition; | ||
2690 | cameraEyeOffset += part.OffsetPosition; | ||
2691 | } | ||
2692 | |||
2697 | 2693 | ||
2698 | ControllingClient.SendSitResponse( | 2694 | ControllingClient.SendSitResponse( |
2699 | part.ParentGroup.UUID, offset, sitOrientation, false, cameraAtOffset, cameraEyeOffset, forceMouselook); | 2695 | part.ParentGroup.UUID, offset, sitOrientation, false, cameraAtOffset, cameraEyeOffset, forceMouselook); |
@@ -2826,7 +2822,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2826 | { | 2822 | { |
2827 | Orientation = part.RotationOffset * Orientation; | 2823 | Orientation = part.RotationOffset * Orientation; |
2828 | offset = offset * part.RotationOffset; | 2824 | offset = offset * part.RotationOffset; |
2825 | cameraAtOffset = cameraAtOffset * part.RotationOffset; | ||
2826 | cameraEyeOffset = cameraEyeOffset * part.RotationOffset; | ||
2827 | |||
2829 | offset += part.OffsetPosition; | 2828 | offset += part.OffsetPosition; |
2829 | cameraAtOffset += part.OffsetPosition; | ||
2830 | cameraEyeOffset += part.OffsetPosition; | ||
2830 | } | 2831 | } |
2831 | 2832 | ||
2832 | m_pos = offset; | 2833 | m_pos = offset; |