diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 45 |
1 files changed, 12 insertions, 33 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a9195f7..f024f52 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -216,8 +216,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
216 | 216 | ||
217 | private Quaternion m_headrotation = Quaternion.Identity; | 217 | private Quaternion m_headrotation = Quaternion.Identity; |
218 | 218 | ||
219 | private string m_nextSitAnimation = String.Empty; | ||
220 | |||
221 | //PauPaw:Proper PID Controler for autopilot************ | 219 | //PauPaw:Proper PID Controler for autopilot************ |
222 | public bool MovingToTarget { get; private set; } | 220 | public bool MovingToTarget { get; private set; } |
223 | public Vector3 MoveToPositionTarget { get; private set; } | 221 | public Vector3 MoveToPositionTarget { get; private set; } |
@@ -591,18 +589,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
591 | set | 589 | set |
592 | { | 590 | { |
593 | m_bodyRot = value; | 591 | m_bodyRot = value; |
594 | // m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, m_bodyRot); | ||
595 | if (PhysicsActor != null) | 592 | if (PhysicsActor != null) |
596 | { | 593 | { |
597 | try | 594 | try |
598 | { | 595 | { |
599 | PhysicsActor.Orientation = value; | 596 | PhysicsActor.Orientation = m_bodyRot; |
600 | } | 597 | } |
601 | catch (Exception e) | 598 | catch (Exception e) |
602 | { | 599 | { |
603 | m_log.Error("[SCENE PRESENCE]: Orientation " + e.Message); | 600 | m_log.Error("[SCENE PRESENCE]: Orientation " + e.Message); |
604 | } | 601 | } |
605 | } | 602 | } |
603 | // m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, m_bodyRot); | ||
606 | } | 604 | } |
607 | } | 605 | } |
608 | 606 | ||
@@ -2199,28 +2197,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
2199 | 2197 | ||
2200 | if (ParentID != 0) | 2198 | if (ParentID != 0) |
2201 | { | 2199 | { |
2200 | if (ParentPart.UUID == targetID) | ||
2201 | return; // already sitting here, ignore | ||
2202 | |||
2202 | StandUp(); | 2203 | StandUp(); |
2203 | } | 2204 | } |
2204 | 2205 | ||
2205 | // if (!String.IsNullOrEmpty(sitAnimation)) | ||
2206 | // { | ||
2207 | // m_nextSitAnimation = sitAnimation; | ||
2208 | // } | ||
2209 | // else | ||
2210 | // { | ||
2211 | m_nextSitAnimation = "SIT"; | ||
2212 | // } | ||
2213 | |||
2214 | //SceneObjectPart part = m_scene.GetSceneObjectPart(targetID); | ||
2215 | SceneObjectPart part = FindNextAvailableSitTarget(targetID); | 2206 | SceneObjectPart part = FindNextAvailableSitTarget(targetID); |
2216 | 2207 | ||
2217 | if (part != null) | 2208 | if (part != null) |
2218 | { | 2209 | { |
2219 | if (!String.IsNullOrEmpty(part.SitAnimation)) | ||
2220 | { | ||
2221 | m_nextSitAnimation = part.SitAnimation; | ||
2222 | } | ||
2223 | |||
2224 | m_requestedSitTargetID = part.LocalId; | 2210 | m_requestedSitTargetID = part.LocalId; |
2225 | m_requestedSitTargetUUID = targetID; | 2211 | m_requestedSitTargetUUID = targetID; |
2226 | 2212 | ||
@@ -2341,18 +2327,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2341 | 2327 | ||
2342 | public void HandleAgentSit(IClientAPI remoteClient, UUID agentID) | 2328 | public void HandleAgentSit(IClientAPI remoteClient, UUID agentID) |
2343 | { | 2329 | { |
2344 | if (!String.IsNullOrEmpty(m_nextSitAnimation)) | ||
2345 | { | ||
2346 | HandleAgentSit(remoteClient, agentID, m_nextSitAnimation); | ||
2347 | } | ||
2348 | else | ||
2349 | { | ||
2350 | HandleAgentSit(remoteClient, agentID, "SIT"); | ||
2351 | } | ||
2352 | } | ||
2353 | |||
2354 | public void HandleAgentSit(IClientAPI remoteClient, UUID agentID, string sitAnimation) | ||
2355 | { | ||
2356 | SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID); | 2330 | SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID); |
2357 | 2331 | ||
2358 | if (part != null) | 2332 | if (part != null) |
@@ -2425,7 +2399,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2425 | 2399 | ||
2426 | Velocity = Vector3.Zero; | 2400 | Velocity = Vector3.Zero; |
2427 | RemoveFromPhysicalScene(); | 2401 | RemoveFromPhysicalScene(); |
2428 | 2402 | ||
2403 | String sitAnimation = "SIT"; | ||
2404 | if (!String.IsNullOrEmpty(part.SitAnimation)) | ||
2405 | { | ||
2406 | sitAnimation = part.SitAnimation; | ||
2407 | } | ||
2429 | Animator.TrySetMovementAnimation(sitAnimation); | 2408 | Animator.TrySetMovementAnimation(sitAnimation); |
2430 | SendAvatarDataToAllAgents(); | 2409 | SendAvatarDataToAllAgents(); |
2431 | } | 2410 | } |
@@ -2455,7 +2434,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2455 | 2434 | ||
2456 | public void HandleStopAnim(IClientAPI remoteClient, UUID animID) | 2435 | public void HandleStopAnim(IClientAPI remoteClient, UUID animID) |
2457 | { | 2436 | { |
2458 | Animator.RemoveAnimation(animID); | 2437 | Animator.RemoveAnimation(animID, false); |
2459 | } | 2438 | } |
2460 | 2439 | ||
2461 | public void avnHandleChangeAnim(UUID animID, bool addRemove,bool sendPack) | 2440 | public void avnHandleChangeAnim(UUID animID, bool addRemove,bool sendPack) |