refactoring to move AvatarAppearance into Framework and

move the appearance sending bits to ScenePresence
0.6.0-stable
Sean Dague 2008-05-15 14:39:54 +00:00
parent 3079cf7beb
commit 8e7f2d6d0e
3 changed files with 20 additions and 27 deletions

View File

@ -33,7 +33,7 @@ using libsecondlife;
using libsecondlife.Packets;
using OpenSim.Framework;
namespace OpenSim.Region.Environment.Scenes
namespace OpenSim.Framework
{
[Serializable]
public class AvatarAppearance : ISerializable
@ -153,28 +153,12 @@ namespace OpenSim.Region.Environment.Scenes
// (float)m_visualParams[25] = Height
// (float)m_visualParams[125] = LegLength
m_avatarHeight = (1.50856f + (((float) m_visualParams[25]/255.0f)*(2.525506f - 1.50856f)))
+ (((float) m_visualParams[125]/255.0f)/1.5f);
+ (((float) m_visualParams[125]/255.0f)/1.5f);
}
/// <summary>
///
/// </summary>
/// <param name="avatar"></param>
public void SendAppearanceToOtherAgent(ScenePresence avatar)
{
avatar.ControllingClient.SendAppearance(m_scenePresenceID, m_visualParams,
m_textureEntry.ToBytes());
}
public void SetWearable(IClientAPI client, int wearableId, AvatarWearable wearable)
public void SetWearable(int wearableId, AvatarWearable wearable)
{
m_wearables[wearableId] = wearable;
SendOwnWearables(client);
}
public void SendOwnWearables(IClientAPI ourClient)
{
ourClient.SendWearables(m_wearables, m_wearablesSerial++);
}
public static LLObject.TextureEntry GetDefaultTextureEntry()

View File

@ -26,6 +26,7 @@
*/
using libsecondlife;
using OpenSim.Framework;
using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Region.Environment.Interfaces

View File

@ -1461,16 +1461,20 @@ namespace OpenSim.Region.Environment.Scenes
SendAppearanceToAllOtherAgents();
}
public void SetWearable(IClientAPI client, int wearableId, AvatarWearable wearable)
{
m_appearance.SetWearable(wearableId, wearable);
client.SendWearables(m_appearance.Wearables, m_appearance.WearablesSerial++);
}
/// <summary>
///
/// </summary>
/// <param name="client"></param>
public void SendOwnAppearance()
{
m_appearance.SendOwnWearables(ControllingClient);
// TODO: remove this once the SunModule is slightly more tested
// m_controllingClient.SendViewerTime(m_scene.TimePhase);
ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.WearablesSerial++);
}
/// <summary>
@ -1484,15 +1488,19 @@ namespace OpenSim.Region.Environment.Scenes
{
if (scenePresence.UUID != UUID)
{
m_appearance.SendAppearanceToOtherAgent(scenePresence);
SendAppearanceToOtherAgent(scenePresence);
}
});
m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS);
}
public void SendAppearanceToOtherAgent(ScenePresence avatar)
{
m_appearance.SendAppearanceToOtherAgent(avatar);
{
avatar.ControllingClient.SendAppearance(
m_appearance.ScenePresenceID,
m_appearance.VisualParams,
m_appearance.TextureEntry.ToBytes()
);
}
public void SetAppearance(byte[] texture, List<byte> visualParam)
@ -1505,7 +1513,7 @@ namespace OpenSim.Region.Environment.Scenes
public void SetWearable(int wearableId, AvatarWearable wearable)
{
m_appearance.SetWearable(ControllingClient, wearableId, wearable);
m_appearance.SetWearable(wearableId, wearable);
}
/// <summary>