aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2012-12-07 21:53:33 +0000
committerUbitUmarov2012-12-07 21:53:33 +0000
commitc73c2fb0707ee4dc78a354d932293f3e7e83ac50 (patch)
tree0ef3fa94ce3062df5a447f652179beed5c147502
parentrevert the use of avatar skeleton and use avatar size provided by viewers, (diff)
downloadopensim-SC-c73c2fb0707ee4dc78a354d932293f3e7e83ac50.zip
opensim-SC-c73c2fb0707ee4dc78a354d932293f3e7e83ac50.tar.gz
opensim-SC-c73c2fb0707ee4dc78a354d932293f3e7e83ac50.tar.bz2
opensim-SC-c73c2fb0707ee4dc78a354d932293f3e7e83ac50.tar.xz
add some default size setting and checks
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs22
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs3
-rw-r--r--OpenSim/Services/Interfaces/IAvatarService.cs7
3 files changed, 28 insertions, 4 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index b01b8da..2183fb6 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -40,10 +40,12 @@ namespace OpenSim.Framework
40 /// </summary> 40 /// </summary>
41 public class AvatarAppearance 41 public class AvatarAppearance
42 { 42 {
43 // SL box diferent to size
43 const float AVBOXAJUST = 0.2f; 44 const float AVBOXAJUST = 0.2f;
45 // constrains for ubitode physics
44 const float AVBOXMINX = 0.2f; 46 const float AVBOXMINX = 0.2f;
45 const float AVBOXMINY = 0.3f; 47 const float AVBOXMINY = 0.3f;
46 const float AVBOXMINZ = 0.5f; 48 const float AVBOXMINZ = 1.2f;
47 49
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 50 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 51
@@ -60,7 +62,7 @@ namespace OpenSim.Framework
60 protected AvatarWearable[] m_wearables; 62 protected AvatarWearable[] m_wearables;
61 protected Dictionary<int, List<AvatarAttachment>> m_attachments; 63 protected Dictionary<int, List<AvatarAttachment>> m_attachments;
62 protected float m_avatarHeight = 0; 64 protected float m_avatarHeight = 0;
63 protected Vector3 m_avatarSize = new Vector3(0.45f, 0.6f, 1.9f); 65 protected Vector3 m_avatarSize = new Vector3(0.45f, 0.6f, 1.9f); // sl Z cloud value
64 protected Vector3 m_avatarBoxSize = new Vector3(0.45f, 0.6f, 1.9f); 66 protected Vector3 m_avatarBoxSize = new Vector3(0.45f, 0.6f, 1.9f);
65 protected float m_avatarFeetOffset = 0; 67 protected float m_avatarFeetOffset = 0;
66 protected float m_avatarAnimOffset = 0; 68 protected float m_avatarAnimOffset = 0;
@@ -157,6 +159,8 @@ namespace OpenSim.Framework
157 SetDefaultParams(); 159 SetDefaultParams();
158 160
159// SetHeight(); 161// SetHeight();
162 if(m_avatarHeight == 0)
163 SetSize(new Vector3(0.45f,0.6f,1.9f));
160 164
161 m_attachments = new Dictionary<int, List<AvatarAttachment>>(); 165 m_attachments = new Dictionary<int, List<AvatarAttachment>>();
162 } 166 }
@@ -408,6 +412,20 @@ namespace OpenSim.Framework
408 412
409 public void SetSize(Vector3 avSize) 413 public void SetSize(Vector3 avSize)
410 { 414 {
415 if (avSize.X > 32f)
416 avSize.X = 32f;
417 else if (avSize.X < 0.1f)
418 avSize.X = 0.1f;
419
420 if (avSize.Y > 32f)
421 avSize.Y = 32f;
422 else if (avSize.Y < 0.1f)
423 avSize.Y = 0.1f;
424 if (avSize.Z > 32f)
425 avSize.Z = 32f;
426 else if (avSize.Z < 0.1f)
427 avSize.Z = 0.1f;
428
411 m_avatarSize = avSize; 429 m_avatarSize = avSize;
412 m_avatarBoxSize = avSize; 430 m_avatarBoxSize = avSize;
413 m_avatarBoxSize.Z += AVBOXAJUST; 431 m_avatarBoxSize.Z += AVBOXAJUST;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 9dfccca..9ada5bb 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3443,8 +3443,9 @@ namespace OpenSim.Region.Framework.Scenes
3443 Name, Scene.RegionInfo.RegionName); 3443 Name, Scene.RegionInfo.RegionName);
3444 } 3444 }
3445 3445
3446// if (Appearance.AvatarHeight == 0) 3446 if (Appearance.AvatarHeight == 0)
3447// Appearance.SetHeight(); 3447// Appearance.SetHeight();
3448 Appearance.SetSize(new Vector3(0.45f,0.6f,1.9f));
3448 3449
3449 PhysicsScene scene = m_scene.PhysicsScene; 3450 PhysicsScene scene = m_scene.PhysicsScene;
3450 3451
diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs
index 260e1c6..c0130f1 100644
--- a/OpenSim/Services/Interfaces/IAvatarService.cs
+++ b/OpenSim/Services/Interfaces/IAvatarService.cs
@@ -201,8 +201,13 @@ namespace OpenSim.Services.Interfaces
201 appearance.Serial = Int32.Parse(Data["Serial"]); 201 appearance.Serial = Int32.Parse(Data["Serial"]);
202 202
203 if (Data.ContainsKey("AvatarHeight")) 203 if (Data.ContainsKey("AvatarHeight"))
204 appearance.SetSize(new Vector3(0.45f, 0.6f, float.Parse(Data["AvatarHeight"]))); 204 {
205 float h = float.Parse(Data["AvatarHeight"]);
206 if( h == 0f)
207 h = 1.9f;
208 appearance.SetSize(new Vector3(0.45f, 0.6f, h ));
205// appearance.AvatarHeight = float.Parse(Data["AvatarHeight"]); 209// appearance.AvatarHeight = float.Parse(Data["AvatarHeight"]);
210 }
206 211
207 // Legacy Wearables 212 // Legacy Wearables
208 if (Data.ContainsKey("BodyItem")) 213 if (Data.ContainsKey("BodyItem"))