diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 51 |
1 files changed, 16 insertions, 35 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 5087882..b9cd3fc 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; } |
@@ -590,18 +588,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
590 | set | 588 | set |
591 | { | 589 | { |
592 | m_bodyRot = value; | 590 | m_bodyRot = value; |
593 | // m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, m_bodyRot); | ||
594 | if (PhysicsActor != null) | 591 | if (PhysicsActor != null) |
595 | { | 592 | { |
596 | try | 593 | try |
597 | { | 594 | { |
598 | PhysicsActor.Orientation = value; | 595 | PhysicsActor.Orientation = m_bodyRot; |
599 | } | 596 | } |
600 | catch (Exception e) | 597 | catch (Exception e) |
601 | { | 598 | { |
602 | m_log.Error("[SCENE PRESENCE]: Orientation " + e.Message); | 599 | m_log.Error("[SCENE PRESENCE]: Orientation " + e.Message); |
603 | } | 600 | } |
604 | } | 601 | } |
602 | // m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, m_bodyRot); | ||
605 | } | 603 | } |
606 | } | 604 | } |
607 | 605 | ||
@@ -2182,25 +2180,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2182 | StandUp(); | 2180 | StandUp(); |
2183 | } | 2181 | } |
2184 | 2182 | ||
2185 | // if (!String.IsNullOrEmpty(sitAnimation)) | ||
2186 | // { | ||
2187 | // m_nextSitAnimation = sitAnimation; | ||
2188 | // } | ||
2189 | // else | ||
2190 | // { | ||
2191 | m_nextSitAnimation = "SIT"; | ||
2192 | // } | ||
2193 | |||
2194 | //SceneObjectPart part = m_scene.GetSceneObjectPart(targetID); | ||
2195 | SceneObjectPart part = FindNextAvailableSitTarget(targetID); | 2183 | SceneObjectPart part = FindNextAvailableSitTarget(targetID); |
2196 | 2184 | ||
2197 | if (part != null) | 2185 | if (part != null) |
2198 | { | 2186 | { |
2199 | if (!String.IsNullOrEmpty(part.SitAnimation)) | ||
2200 | { | ||
2201 | m_nextSitAnimation = part.SitAnimation; | ||
2202 | } | ||
2203 | |||
2204 | m_requestedSitTargetID = part.LocalId; | 2187 | m_requestedSitTargetID = part.LocalId; |
2205 | m_requestedSitTargetUUID = targetID; | 2188 | m_requestedSitTargetUUID = targetID; |
2206 | 2189 | ||
@@ -2323,18 +2306,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2323 | 2306 | ||
2324 | public void HandleAgentSit(IClientAPI remoteClient, UUID agentID) | 2307 | public void HandleAgentSit(IClientAPI remoteClient, UUID agentID) |
2325 | { | 2308 | { |
2326 | if (!String.IsNullOrEmpty(m_nextSitAnimation)) | ||
2327 | { | ||
2328 | HandleAgentSit(remoteClient, agentID, m_nextSitAnimation); | ||
2329 | } | ||
2330 | else | ||
2331 | { | ||
2332 | HandleAgentSit(remoteClient, agentID, "SIT"); | ||
2333 | } | ||
2334 | } | ||
2335 | |||
2336 | public void HandleAgentSit(IClientAPI remoteClient, UUID agentID, string sitAnimation) | ||
2337 | { | ||
2338 | SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID); | 2309 | SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID); |
2339 | 2310 | ||
2340 | if (part != null) | 2311 | if (part != null) |
@@ -2407,7 +2378,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2407 | 2378 | ||
2408 | Velocity = Vector3.Zero; | 2379 | Velocity = Vector3.Zero; |
2409 | RemoveFromPhysicalScene(); | 2380 | RemoveFromPhysicalScene(); |
2410 | 2381 | ||
2382 | String sitAnimation = "SIT"; | ||
2383 | if (!String.IsNullOrEmpty(part.SitAnimation)) | ||
2384 | { | ||
2385 | sitAnimation = part.SitAnimation; | ||
2386 | } | ||
2411 | Animator.TrySetMovementAnimation(sitAnimation); | 2387 | Animator.TrySetMovementAnimation(sitAnimation); |
2412 | SendAvatarDataToAllAgents(); | 2388 | SendAvatarDataToAllAgents(); |
2413 | } | 2389 | } |
@@ -2531,10 +2507,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
2531 | m_lastSize = Appearance.AvatarSize; | 2507 | m_lastSize = Appearance.AvatarSize; |
2532 | SendAvatarDataToAllAgents(); | 2508 | SendAvatarDataToAllAgents(); |
2533 | } | 2509 | } |
2510 | // Throw away duplicate or insignificant updates | ||
2511 | else if ( | ||
2512 | // If the velocity has become zero, send it no matter what. | ||
2513 | (Velocity != m_lastVelocity && Velocity == Vector3.Zero) | ||
2514 | // otherwise, if things have changed reasonably, send the update | ||
2515 | || (!Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) | ||
2516 | || !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) | ||
2517 | || !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE))) | ||
2534 | 2518 | ||
2535 | else if (!Rotation.ApproxEquals(m_lastRotation, ROTATION_TOLERANCE) || | ||
2536 | !Velocity.ApproxEquals(m_lastVelocity, VELOCITY_TOLERANCE) || | ||
2537 | !m_pos.ApproxEquals(m_lastPosition, POSITION_TOLERANCE)) | ||
2538 | { | 2519 | { |
2539 | SendTerseUpdateToAllClients(); | 2520 | SendTerseUpdateToAllClients(); |
2540 | 2521 | ||