aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorSean Dague2008-05-15 14:39:54 +0000
committerSean Dague2008-05-15 14:39:54 +0000
commit8e7f2d6d0efe37108b2931cfdda36e695830abb0 (patch)
treee8b558217b05901f50fc65148cb1196510ce8eca /OpenSim
parentadd some additional bits to AvatarAppearance to make this (diff)
downloadopensim-SC_OLD-8e7f2d6d0efe37108b2931cfdda36e695830abb0.zip
opensim-SC_OLD-8e7f2d6d0efe37108b2931cfdda36e695830abb0.tar.gz
opensim-SC_OLD-8e7f2d6d0efe37108b2931cfdda36e695830abb0.tar.bz2
opensim-SC_OLD-8e7f2d6d0efe37108b2931cfdda36e695830abb0.tar.xz
refactoring to move AvatarAppearance into Framework and
move the appearance sending bits to ScenePresence
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs (renamed from OpenSim/Region/Environment/Scenes/AvatarAppearance.cs)22
-rw-r--r--OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs1
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs24
3 files changed, 20 insertions, 27 deletions
diff --git a/OpenSim/Region/Environment/Scenes/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index a88306f..50afa75 100644
--- a/OpenSim/Region/Environment/Scenes/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -33,7 +33,7 @@ using libsecondlife;
33using libsecondlife.Packets; 33using libsecondlife.Packets;
34using OpenSim.Framework; 34using OpenSim.Framework;
35 35
36namespace OpenSim.Region.Environment.Scenes 36namespace OpenSim.Framework
37{ 37{
38 [Serializable] 38 [Serializable]
39 public class AvatarAppearance : ISerializable 39 public class AvatarAppearance : ISerializable
@@ -153,28 +153,12 @@ namespace OpenSim.Region.Environment.Scenes
153 // (float)m_visualParams[25] = Height 153 // (float)m_visualParams[25] = Height
154 // (float)m_visualParams[125] = LegLength 154 // (float)m_visualParams[125] = LegLength
155 m_avatarHeight = (1.50856f + (((float) m_visualParams[25]/255.0f)*(2.525506f - 1.50856f))) 155 m_avatarHeight = (1.50856f + (((float) m_visualParams[25]/255.0f)*(2.525506f - 1.50856f)))
156 + (((float) m_visualParams[125]/255.0f)/1.5f); 156 + (((float) m_visualParams[125]/255.0f)/1.5f);
157 } 157 }
158 158
159 /// <summary> 159 public void SetWearable(int wearableId, AvatarWearable wearable)
160 ///
161 /// </summary>
162 /// <param name="avatar"></param>
163 public void SendAppearanceToOtherAgent(ScenePresence avatar)
164 {
165 avatar.ControllingClient.SendAppearance(m_scenePresenceID, m_visualParams,
166 m_textureEntry.ToBytes());
167 }
168
169 public void SetWearable(IClientAPI client, int wearableId, AvatarWearable wearable)
170 { 160 {
171 m_wearables[wearableId] = wearable; 161 m_wearables[wearableId] = wearable;
172 SendOwnWearables(client);
173 }
174
175 public void SendOwnWearables(IClientAPI ourClient)
176 {
177 ourClient.SendWearables(m_wearables, m_wearablesSerial++);
178 } 162 }
179 163
180 public static LLObject.TextureEntry GetDefaultTextureEntry() 164 public static LLObject.TextureEntry GetDefaultTextureEntry()
diff --git a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs
index 3ebbaab..86958d1 100644
--- a/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs
+++ b/OpenSim/Region/Environment/Interfaces/IAvatarFactory.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using libsecondlife; 28using libsecondlife;
29using OpenSim.Framework;
29using OpenSim.Region.Environment.Scenes; 30using OpenSim.Region.Environment.Scenes;
30 31
31namespace OpenSim.Region.Environment.Interfaces 32namespace OpenSim.Region.Environment.Interfaces
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 8ac1a77..6f591e8 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -1461,16 +1461,20 @@ namespace OpenSim.Region.Environment.Scenes
1461 SendAppearanceToAllOtherAgents(); 1461 SendAppearanceToAllOtherAgents();
1462 } 1462 }
1463 1463
1464
1465 public void SetWearable(IClientAPI client, int wearableId, AvatarWearable wearable)
1466 {
1467 m_appearance.SetWearable(wearableId, wearable);
1468 client.SendWearables(m_appearance.Wearables, m_appearance.WearablesSerial++);
1469 }
1470
1464 /// <summary> 1471 /// <summary>
1465 /// 1472 ///
1466 /// </summary> 1473 /// </summary>
1467 /// <param name="client"></param> 1474 /// <param name="client"></param>
1468 public void SendOwnAppearance() 1475 public void SendOwnAppearance()
1469 { 1476 {
1470 m_appearance.SendOwnWearables(ControllingClient); 1477 ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.WearablesSerial++);
1471
1472 // TODO: remove this once the SunModule is slightly more tested
1473 // m_controllingClient.SendViewerTime(m_scene.TimePhase);
1474 } 1478 }
1475 1479
1476 /// <summary> 1480 /// <summary>
@@ -1484,15 +1488,19 @@ namespace OpenSim.Region.Environment.Scenes
1484 { 1488 {
1485 if (scenePresence.UUID != UUID) 1489 if (scenePresence.UUID != UUID)
1486 { 1490 {
1487 m_appearance.SendAppearanceToOtherAgent(scenePresence); 1491 SendAppearanceToOtherAgent(scenePresence);
1488 } 1492 }
1489 }); 1493 });
1490 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); 1494 m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
1491 } 1495 }
1492 1496
1493 public void SendAppearanceToOtherAgent(ScenePresence avatar) 1497 public void SendAppearanceToOtherAgent(ScenePresence avatar)
1494 { 1498 {
1495 m_appearance.SendAppearanceToOtherAgent(avatar); 1499 avatar.ControllingClient.SendAppearance(
1500 m_appearance.ScenePresenceID,
1501 m_appearance.VisualParams,
1502 m_appearance.TextureEntry.ToBytes()
1503 );
1496 } 1504 }
1497 1505
1498 public void SetAppearance(byte[] texture, List<byte> visualParam) 1506 public void SetAppearance(byte[] texture, List<byte> visualParam)
@@ -1505,7 +1513,7 @@ namespace OpenSim.Region.Environment.Scenes
1505 1513
1506 public void SetWearable(int wearableId, AvatarWearable wearable) 1514 public void SetWearable(int wearableId, AvatarWearable wearable)
1507 { 1515 {
1508 m_appearance.SetWearable(ControllingClient, wearableId, wearable); 1516 m_appearance.SetWearable(wearableId, wearable);
1509 } 1517 }
1510 1518
1511 /// <summary> 1519 /// <summary>