diff options
author | Melanie | 2012-12-18 09:48:12 +0000 |
---|---|---|
committer | Melanie | 2012-12-18 09:48:12 +0000 |
commit | 79bdf464d3f123f8e195fa57c497e546b7d9dfcc (patch) | |
tree | bf6123b15d1ced7ec72ce871e4801d6645bb23f4 /OpenSim/Region/CoreModules/Avatar | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Fix locking for good (diff) | |
download | opensim-SC-79bdf464d3f123f8e195fa57c497e546b7d9dfcc.zip opensim-SC-79bdf464d3f123f8e195fa57c497e546b7d9dfcc.tar.gz opensim-SC-79bdf464d3f123f8e195fa57c497e546b7d9dfcc.tar.bz2 opensim-SC-79bdf464d3f123f8e195fa57c497e546b7d9dfcc.tar.xz |
Merge branch 'avination' into careminster
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 81 |
1 files changed, 65 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 8496005..3532b1d 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -145,6 +145,21 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
145 | SetAppearance(sp, appearance.Texture, appearance.VisualParams); | 145 | SetAppearance(sp, appearance.Texture, appearance.VisualParams); |
146 | } | 146 | } |
147 | 147 | ||
148 | |||
149 | public void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams, Vector3 avSize) | ||
150 | { | ||
151 | float oldoff = sp.Appearance.AvatarFeetOffset; | ||
152 | Vector3 oldbox = sp.Appearance.AvatarBoxSize; | ||
153 | |||
154 | SetAppearance(sp, textureEntry, visualParams); | ||
155 | sp.Appearance.SetSize(avSize); | ||
156 | |||
157 | float off = sp.Appearance.AvatarFeetOffset; | ||
158 | Vector3 box = sp.Appearance.AvatarBoxSize; | ||
159 | if (oldoff != off || oldbox != box) | ||
160 | ((ScenePresence)sp).SetSize(box, off); | ||
161 | } | ||
162 | |||
148 | /// <summary> | 163 | /// <summary> |
149 | /// Set appearance data (texture asset IDs and slider settings) | 164 | /// Set appearance data (texture asset IDs and slider settings) |
150 | /// </summary> | 165 | /// </summary> |
@@ -174,12 +189,21 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
174 | // m_log.DebugFormat( | 189 | // m_log.DebugFormat( |
175 | // "[AVFACTORY]: Setting visual params for {0} to {1}", | 190 | // "[AVFACTORY]: Setting visual params for {0} to {1}", |
176 | // client.Name, string.Join(", ", visualParamsStrings)); | 191 | // client.Name, string.Join(", ", visualParamsStrings)); |
177 | 192 | /* | |
178 | float oldHeight = sp.Appearance.AvatarHeight; | 193 | float oldHeight = sp.Appearance.AvatarHeight; |
179 | changed = sp.Appearance.SetVisualParams(visualParams); | 194 | changed = sp.Appearance.SetVisualParams(visualParams); |
180 | 195 | ||
181 | if (sp.Appearance.AvatarHeight != oldHeight && sp.Appearance.AvatarHeight > 0) | 196 | if (sp.Appearance.AvatarHeight != oldHeight && sp.Appearance.AvatarHeight > 0) |
182 | ((ScenePresence)sp).SetHeight(sp.Appearance.AvatarHeight); | 197 | ((ScenePresence)sp).SetHeight(sp.Appearance.AvatarHeight); |
198 | */ | ||
199 | // float oldoff = sp.Appearance.AvatarFeetOffset; | ||
200 | // Vector3 oldbox = sp.Appearance.AvatarBoxSize; | ||
201 | changed = sp.Appearance.SetVisualParams(visualParams); | ||
202 | // float off = sp.Appearance.AvatarFeetOffset; | ||
203 | // Vector3 box = sp.Appearance.AvatarBoxSize; | ||
204 | // if(oldoff != off || oldbox != box) | ||
205 | // ((ScenePresence)sp).SetSize(box,off); | ||
206 | |||
183 | } | 207 | } |
184 | 208 | ||
185 | // Process the baked texture array | 209 | // Process the baked texture array |
@@ -337,6 +361,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
337 | public bool ValidateBakedTextureCache(IScenePresence sp) | 361 | public bool ValidateBakedTextureCache(IScenePresence sp) |
338 | { | 362 | { |
339 | bool defonly = true; // are we only using default textures | 363 | bool defonly = true; // are we only using default textures |
364 | IImprovedAssetCache cache = m_scene.RequestModuleInterface<IImprovedAssetCache>(); | ||
340 | 365 | ||
341 | // Process the texture entry | 366 | // Process the texture entry |
342 | for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) | 367 | for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) |
@@ -361,8 +386,16 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
361 | 386 | ||
362 | defonly = false; // found a non-default texture reference | 387 | defonly = false; // found a non-default texture reference |
363 | 388 | ||
364 | if (m_scene.AssetService.Get(face.TextureID.ToString()) == null) | 389 | if (cache != null) |
365 | return false; | 390 | { |
391 | if (!cache.Check(face.TextureID.ToString())) | ||
392 | return false; | ||
393 | } | ||
394 | else | ||
395 | { | ||
396 | if (m_scene.AssetService.Get(face.TextureID.ToString()) == null) | ||
397 | return false; | ||
398 | } | ||
366 | } | 399 | } |
367 | 400 | ||
368 | // m_log.DebugFormat("[AVFACTORY]: Completed texture check for {0} {1}", sp.Name, sp.UUID); | 401 | // m_log.DebugFormat("[AVFACTORY]: Completed texture check for {0} {1}", sp.Name, sp.UUID); |
@@ -374,6 +407,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
374 | public int RequestRebake(IScenePresence sp, bool missingTexturesOnly) | 407 | public int RequestRebake(IScenePresence sp, bool missingTexturesOnly) |
375 | { | 408 | { |
376 | int texturesRebaked = 0; | 409 | int texturesRebaked = 0; |
410 | IImprovedAssetCache cache = m_scene.RequestModuleInterface<IImprovedAssetCache>(); | ||
377 | 411 | ||
378 | for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) | 412 | for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) |
379 | { | 413 | { |
@@ -397,21 +431,36 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
397 | 431 | ||
398 | if (missingTexturesOnly) | 432 | if (missingTexturesOnly) |
399 | { | 433 | { |
400 | if (m_scene.AssetService.Get(face.TextureID.ToString()) != null) | 434 | if (cache != null) |
401 | { | 435 | { |
402 | continue; | 436 | if (cache.Check(face.TextureID.ToString())) |
437 | continue; | ||
438 | else | ||
439 | { | ||
440 | m_log.DebugFormat( | ||
441 | "[AVFACTORY]: Missing baked texture {0} ({1}) for {2}, requesting rebake.", | ||
442 | face.TextureID, idx, sp.Name); | ||
443 | } | ||
403 | } | 444 | } |
404 | else | 445 | else |
405 | { | 446 | { |
406 | // On inter-simulator teleports, this occurs if baked textures are not being stored by the | 447 | if (m_scene.AssetService.Get(face.TextureID.ToString()) != null) |
407 | // grid asset service (which means that they are not available to the new region and so have | 448 | { |
408 | // to be re-requested from the client). | 449 | continue; |
409 | // | 450 | } |
410 | // The only available core OpenSimulator behaviour right now | 451 | |
411 | // is not to store these textures, temporarily or otherwise. | 452 | else |
412 | m_log.DebugFormat( | 453 | { |
413 | "[AVFACTORY]: Missing baked texture {0} ({1}) for {2}, requesting rebake.", | 454 | // On inter-simulator teleports, this occurs if baked textures are not being stored by the |
414 | face.TextureID, idx, sp.Name); | 455 | // grid asset service (which means that they are not available to the new region and so have |
456 | // to be re-requested from the client). | ||
457 | // | ||
458 | // The only available core OpenSimulator behaviour right now | ||
459 | // is not to store these textures, temporarily or otherwise. | ||
460 | m_log.DebugFormat( | ||
461 | "[AVFACTORY]: Missing baked texture {0} ({1}) for {2}, requesting rebake.", | ||
462 | face.TextureID, idx, sp.Name); | ||
463 | } | ||
415 | } | 464 | } |
416 | } | 465 | } |
417 | else | 466 | else |
@@ -611,12 +660,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
611 | /// <param name="client"></param> | 660 | /// <param name="client"></param> |
612 | /// <param name="texture"></param> | 661 | /// <param name="texture"></param> |
613 | /// <param name="visualParam"></param> | 662 | /// <param name="visualParam"></param> |
614 | private void Client_OnSetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams) | 663 | private void Client_OnSetAppearance(IClientAPI client, Primitive.TextureEntry textureEntry, byte[] visualParams, Vector3 avSize) |
615 | { | 664 | { |
616 | // m_log.WarnFormat("[AVFACTORY]: Client_OnSetAppearance called for {0} ({1})", client.Name, client.AgentId); | 665 | // m_log.WarnFormat("[AVFACTORY]: Client_OnSetAppearance called for {0} ({1})", client.Name, client.AgentId); |
617 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); | 666 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); |
618 | if (sp != null) | 667 | if (sp != null) |
619 | SetAppearance(sp, textureEntry, visualParams); | 668 | SetAppearance(sp, textureEntry, visualParams,avSize); |
620 | else | 669 | else |
621 | m_log.WarnFormat("[AVFACTORY]: Client_OnSetAppearance unable to find presence for {0}", client.AgentId); | 670 | m_log.WarnFormat("[AVFACTORY]: Client_OnSetAppearance unable to find presence for {0}", client.AgentId); |
622 | } | 671 | } |