aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorMW2008-11-04 16:39:28 +0000
committerMW2008-11-04 16:39:28 +0000
commit1c2a0c78d9a7feb96dd1366755d588d03b92fd36 (patch)
tree0a2bc8edb2f5e6261dd090df26271bf5c58ee81c /OpenSim/Region/Environment/Scenes/ScenePresence.cs
parentfix: ArchiveReadRequest.URIFetch stumbles over absent content length field (diff)
downloadopensim-SC_OLD-1c2a0c78d9a7feb96dd1366755d588d03b92fd36.zip
opensim-SC_OLD-1c2a0c78d9a7feb96dd1366755d588d03b92fd36.tar.gz
opensim-SC_OLD-1c2a0c78d9a7feb96dd1366755d588d03b92fd36.tar.bz2
opensim-SC_OLD-1c2a0c78d9a7feb96dd1366755d588d03b92fd36.tar.xz
Added a (xmlIgnored) SitAnimation property to SceneObjectPart. That allows the setting of the name of the animation to be used when a avatar sits on that object. At some point in the future this should be persisted.
So basically simplifies what a lsl script that detects a avatar sitting on a prim, then stopping the sit animation and playing a custom animation, does. Also added another ScenePresence.HandleAgentRequestSit() method , that accepts the name of the sit animation. So that modules can override the animation used, when they are doing a server controlled sit. Started some work on making the stand pose be played as soon as a user logs into a region. Rather than them starting with their arms stretched. This still needs more work
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs60
1 files changed, 58 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index d75d8a9..1466778 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -97,6 +97,8 @@ namespace OpenSim.Region.Environment.Scenes
97 private uint m_requestedSitTargetID = 0; 97 private uint m_requestedSitTargetID = 0;
98 private UUID m_requestedSitTargetUUID = UUID.Zero; 98 private UUID m_requestedSitTargetUUID = UUID.Zero;
99 99
100 private bool m_startAnimationSet = false;
101
100 private Vector3 m_requestedSitOffset = new Vector3(); 102 private Vector3 m_requestedSitOffset = new Vector3();
101 103
102 private Vector3 m_LastFinitePos = new Vector3(); 104 private Vector3 m_LastFinitePos = new Vector3();
@@ -172,6 +174,8 @@ namespace OpenSim.Region.Environment.Scenes
172 private Vector3 m_autoPilotTarget = Vector3.Zero; 174 private Vector3 m_autoPilotTarget = Vector3.Zero;
173 private bool m_sitAtAutoTarget = false; 175 private bool m_sitAtAutoTarget = false;
174 176
177 private string m_nextSitAnimation = String.Empty;
178
175 // Agent's Draw distance. 179 // Agent's Draw distance.
176 protected float m_DrawDistance = 0f; 180 protected float m_DrawDistance = 0f;
177 181
@@ -1323,17 +1327,52 @@ namespace OpenSim.Region.Environment.Scenes
1323 { 1327 {
1324 StandUp(); 1328 StandUp();
1325 } 1329 }
1330 m_nextSitAnimation = "SIT";
1326 1331
1327 //SceneObjectPart part = m_scene.GetSceneObjectPart(targetID); 1332 //SceneObjectPart part = m_scene.GetSceneObjectPart(targetID);
1328 SceneObjectPart part = FindNextAvailableSitTarget(targetID); 1333 SceneObjectPart part = FindNextAvailableSitTarget(targetID);
1329 1334
1330 if (part != null) 1335 if (part != null)
1331 { 1336 {
1337 if (!String.IsNullOrEmpty(part.SitAnimation))
1338 {
1339 m_nextSitAnimation = part.SitAnimation;
1340 }
1332 m_requestedSitTargetID = part.LocalId; 1341 m_requestedSitTargetID = part.LocalId;
1333 m_requestedSitOffset = offset; 1342 m_requestedSitOffset = offset;
1334 } 1343 }
1335 else 1344 else
1336 { 1345 {
1346
1347 m_log.Warn("Sit requested on unknown object: " + targetID.ToString());
1348 }
1349 SendSitResponse(remoteClient, targetID, offset);
1350 }
1351
1352 public void HandleAgentRequestSit(IClientAPI remoteClient, UUID agentID, UUID targetID, Vector3 offset, string sitAnimation)
1353 {
1354 if (m_parentID != 0)
1355 {
1356 StandUp();
1357 }
1358 if (!String.IsNullOrEmpty(sitAnimation))
1359 {
1360 m_nextSitAnimation = sitAnimation;
1361 }
1362 else
1363 {
1364 m_nextSitAnimation = "SIT";
1365 }
1366
1367 //SceneObjectPart part = m_scene.GetSceneObjectPart(targetID);
1368 SceneObjectPart part = FindNextAvailableSitTarget(targetID);
1369 if (part != null)
1370 {
1371 m_requestedSitTargetID = part.LocalId;
1372 m_requestedSitOffset = offset;
1373 }
1374 else
1375 {
1337 m_log.Warn("Sit requested on unknown object: " + targetID.ToString()); 1376 m_log.Warn("Sit requested on unknown object: " + targetID.ToString());
1338 } 1377 }
1339 SendSitResponse(remoteClient, targetID, offset); 1378 SendSitResponse(remoteClient, targetID, offset);
@@ -1341,6 +1380,18 @@ namespace OpenSim.Region.Environment.Scenes
1341 1380
1342 public void HandleAgentSit(IClientAPI remoteClient, UUID agentID) 1381 public void HandleAgentSit(IClientAPI remoteClient, UUID agentID)
1343 { 1382 {
1383 if (!String.IsNullOrEmpty(m_nextSitAnimation))
1384 {
1385 HandleAgentSit(remoteClient, agentID, m_nextSitAnimation);
1386 }
1387 else
1388 {
1389 HandleAgentSit(remoteClient, agentID, "SIT");
1390 }
1391 }
1392
1393 public void HandleAgentSit(IClientAPI remoteClient, UUID agentID, string sitAnimation)
1394 {
1344 SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID); 1395 SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
1345 1396
1346 if (m_sitAtAutoTarget || !m_autopilotMoving) 1397 if (m_sitAtAutoTarget || !m_autopilotMoving)
@@ -1381,7 +1432,7 @@ namespace OpenSim.Region.Environment.Scenes
1381 Velocity = new Vector3(0, 0, 0); 1432 Velocity = new Vector3(0, 0, 0);
1382 RemoveFromPhysicalScene(); 1433 RemoveFromPhysicalScene();
1383 1434
1384 TrySetMovementAnimation("SIT"); 1435 TrySetMovementAnimation(sitAnimation);
1385 SendFullUpdateToAllClients(); 1436 SendFullUpdateToAllClients();
1386 // This may seem stupid, but Our Full updates don't send avatar rotation :P 1437 // This may seem stupid, but Our Full updates don't send avatar rotation :P
1387 // So we're also sending a terse update (which has avatar rotation) 1438 // So we're also sending a terse update (which has avatar rotation)
@@ -1897,6 +1948,11 @@ namespace OpenSim.Region.Environment.Scenes
1897 1948
1898 SendAppearanceToAllOtherAgents(); 1949 SendAppearanceToAllOtherAgents();
1899 SendWearables(); 1950 SendWearables();
1951 if (!m_startAnimationSet)
1952 {
1953 UpdateMovementAnimations();
1954 m_startAnimationSet = true;
1955 }
1900 } 1956 }
1901 1957
1902 public void SetWearable(int wearableId, AvatarWearable wearable) 1958 public void SetWearable(int wearableId, AvatarWearable wearable)