Avatar Appearance refactoring /changes. Added a AvatarAppearance class, each ScenePresence "has" a AvatarAppearance object. All the ScenePresences in a opensim related to one user (so a user's various ScenePresence's in all the regions in that instance) share the same AvatarAppearance object. This means that a user's avatar should appear correctly (to both that user and other users) no matter what border crossing or teleporting they have done.

Note: this mainly improves Standalone mode, as in grid mode the appearance data isn't passed between region servers. Although people should notice a improvement when moving between regions in the same instance.
This commit is contained in:
MW
2007-12-07 17:23:11 +00:00
parent 7f4d033490
commit e23290eff6
6 changed files with 298 additions and 195 deletions

View File

@@ -991,11 +991,10 @@ namespace OpenSim.Region.Environment.Scenes
{
ScenePresence avatar = null;
byte[] visualParams;
AvatarWearable[] wearables;
LoadAvatarAppearance(client, out visualParams, out wearables);
AvatarAppearance appearance;
LoadAvatarAppearance(client, out appearance);
avatar = m_innerScene.CreateAndAddScenePresence(client, child, wearables, visualParams);
avatar = m_innerScene.CreateAndAddScenePresence(client, child, appearance);
if (avatar.IsChildAgent)
{
@@ -1005,12 +1004,16 @@ namespace OpenSim.Region.Environment.Scenes
return avatar;
}
protected void LoadAvatarAppearance(IClientAPI client, out byte[] visualParams, out AvatarWearable[] wearables)
protected void LoadAvatarAppearance(IClientAPI client, out AvatarAppearance appearance)
{
if (m_AvatarFactory == null ||
!m_AvatarFactory.TryGetInitialAvatarAppearance(client.AgentId, out wearables, out visualParams))
!m_AvatarFactory.TryGetAvatarAppearance(client.AgentId, out appearance))
{
//not found Appearance
byte[] visualParams;
AvatarWearable[] wearables;
AvatarFactoryModule.GetDefaultAvatarAppearance(out wearables, out visualParams);
appearance = new AvatarAppearance(client.AgentId, wearables, visualParams);
}
}