diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 63 |
1 files changed, 34 insertions, 29 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 0390414..fe9dc56 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -171,9 +171,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
171 | 171 | ||
172 | private float m_health = 100f; | 172 | private float m_health = 100f; |
173 | 173 | ||
174 | // Default AV Height | ||
175 | private float m_avHeight = 127.0f; | ||
176 | |||
177 | protected RegionInfo m_regionInfo; | 174 | protected RegionInfo m_regionInfo; |
178 | protected ulong crossingFromRegion; | 175 | protected ulong crossingFromRegion; |
179 | 176 | ||
@@ -841,9 +838,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
841 | } | 838 | } |
842 | 839 | ||
843 | float localAVHeight = 1.56f; | 840 | float localAVHeight = 1.56f; |
844 | if (m_avHeight != 127.0f) | 841 | if (m_appearance != null) |
845 | { | 842 | { |
846 | localAVHeight = m_avHeight; | 843 | if (m_appearance.AvatarHeight > 0) |
844 | localAVHeight = m_appearance.AvatarHeight; | ||
847 | } | 845 | } |
848 | 846 | ||
849 | float posZLimit = 0; | 847 | float posZLimit = 0; |
@@ -872,6 +870,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
872 | 870 | ||
873 | AddToPhysicalScene(isFlying); | 871 | AddToPhysicalScene(isFlying); |
874 | 872 | ||
873 | if (m_appearance != null) | ||
874 | { | ||
875 | if (m_appearance.AvatarHeight > 0) | ||
876 | SetHeight(m_appearance.AvatarHeight); | ||
877 | } | ||
878 | |||
875 | if (m_forceFly) | 879 | if (m_forceFly) |
876 | { | 880 | { |
877 | m_physicsActor.Flying = true; | 881 | m_physicsActor.Flying = true; |
@@ -1060,10 +1064,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1060 | /// </summary> | 1064 | /// </summary> |
1061 | public void SetHeight(float height) | 1065 | public void SetHeight(float height) |
1062 | { | 1066 | { |
1063 | m_avHeight = height; | ||
1064 | if (PhysicsActor != null && !IsChildAgent) | 1067 | if (PhysicsActor != null && !IsChildAgent) |
1065 | { | 1068 | { |
1066 | Vector3 SetSize = new Vector3(0.45f, 0.6f, m_avHeight); | 1069 | Vector3 SetSize = new Vector3(0.45f, 0.6f, height); |
1067 | PhysicsActor.Size = SetSize; | 1070 | PhysicsActor.Size = SetSize; |
1068 | } | 1071 | } |
1069 | } | 1072 | } |
@@ -1687,9 +1690,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1687 | m_parentID = 0; | 1690 | m_parentID = 0; |
1688 | SendFullUpdateToAllClients(); | 1691 | SendFullUpdateToAllClients(); |
1689 | m_requestedSitTargetID = 0; | 1692 | m_requestedSitTargetID = 0; |
1690 | if ((m_physicsActor != null) && (m_avHeight > 0)) | 1693 | if (m_physicsActor != null && m_appearance != null) |
1691 | { | 1694 | { |
1692 | SetHeight(m_avHeight); | 1695 | if (m_appearance.AvatarHeight > 0) |
1696 | SetHeight(m_appearance.AvatarHeight); | ||
1693 | } | 1697 | } |
1694 | } | 1698 | } |
1695 | 1699 | ||
@@ -2391,11 +2395,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2391 | if (m_appearance.Texture == null) | 2395 | if (m_appearance.Texture == null) |
2392 | return; | 2396 | return; |
2393 | 2397 | ||
2394 | if (LocalId == remoteAvatar.LocalId) | 2398 | // MT: This is needed for sit. It's legal to send it to oneself, and the name |
2395 | { | 2399 | // of the method is a misnomer |
2396 | m_log.WarnFormat("[SCENEPRESENCE]: An agent is attempting to send avatar data to itself; {0}", UUID); | 2400 | // |
2397 | return; | 2401 | // if (LocalId == remoteAvatar.LocalId) |
2398 | } | 2402 | // { |
2403 | // m_log.WarnFormat("[SCENEPRESENCE]: An agent is attempting to send avatar data to itself; {0}", UUID); | ||
2404 | // return; | ||
2405 | // } | ||
2399 | 2406 | ||
2400 | if (IsChildAgent) | 2407 | if (IsChildAgent) |
2401 | { | 2408 | { |
@@ -2576,7 +2583,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2576 | cadu.ActiveGroupID = UUID.Zero.Guid; | 2583 | cadu.ActiveGroupID = UUID.Zero.Guid; |
2577 | cadu.AgentID = UUID.Guid; | 2584 | cadu.AgentID = UUID.Guid; |
2578 | cadu.alwaysrun = m_setAlwaysRun; | 2585 | cadu.alwaysrun = m_setAlwaysRun; |
2579 | cadu.AVHeight = m_avHeight; | 2586 | cadu.AVHeight = m_appearance.AvatarHeight; |
2580 | Vector3 tempCameraCenter = m_CameraCenter; | 2587 | Vector3 tempCameraCenter = m_CameraCenter; |
2581 | cadu.cameraPosition = tempCameraCenter; | 2588 | cadu.cameraPosition = tempCameraCenter; |
2582 | cadu.drawdistance = m_DrawDistance; | 2589 | cadu.drawdistance = m_DrawDistance; |
@@ -2912,7 +2919,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2912 | 2919 | ||
2913 | m_CameraCenter = cAgentData.Center + offset; | 2920 | m_CameraCenter = cAgentData.Center + offset; |
2914 | 2921 | ||
2915 | m_avHeight = cAgentData.Size.Z; | ||
2916 | //SetHeight(cAgentData.AVHeight); | 2922 | //SetHeight(cAgentData.AVHeight); |
2917 | 2923 | ||
2918 | if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) | 2924 | if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) |
@@ -2937,8 +2943,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2937 | cAgent.Position = AbsolutePosition; | 2943 | cAgent.Position = AbsolutePosition; |
2938 | cAgent.Velocity = m_velocity; | 2944 | cAgent.Velocity = m_velocity; |
2939 | cAgent.Center = m_CameraCenter; | 2945 | cAgent.Center = m_CameraCenter; |
2940 | // Don't copy the size; it is inferred from apearance parameters | ||
2941 | //cAgent.Size = new Vector3(0, 0, m_avHeight); | ||
2942 | cAgent.AtAxis = m_CameraAtAxis; | 2946 | cAgent.AtAxis = m_CameraAtAxis; |
2943 | cAgent.LeftAxis = m_CameraLeftAxis; | 2947 | cAgent.LeftAxis = m_CameraLeftAxis; |
2944 | cAgent.UpAxis = m_CameraUpAxis; | 2948 | cAgent.UpAxis = m_CameraUpAxis; |
@@ -3056,7 +3060,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3056 | m_pos = cAgent.Position; | 3060 | m_pos = cAgent.Position; |
3057 | m_velocity = cAgent.Velocity; | 3061 | m_velocity = cAgent.Velocity; |
3058 | m_CameraCenter = cAgent.Center; | 3062 | m_CameraCenter = cAgent.Center; |
3059 | //m_avHeight = cAgent.Size.Z; | ||
3060 | m_CameraAtAxis = cAgent.AtAxis; | 3063 | m_CameraAtAxis = cAgent.AtAxis; |
3061 | m_CameraLeftAxis = cAgent.LeftAxis; | 3064 | m_CameraLeftAxis = cAgent.LeftAxis; |
3062 | m_CameraUpAxis = cAgent.UpAxis; | 3065 | m_CameraUpAxis = cAgent.UpAxis; |
@@ -3075,6 +3078,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3075 | m_setAlwaysRun = cAgent.AlwaysRun; | 3078 | m_setAlwaysRun = cAgent.AlwaysRun; |
3076 | 3079 | ||
3077 | m_appearance = new AvatarAppearance(cAgent.Appearance); | 3080 | m_appearance = new AvatarAppearance(cAgent.Appearance); |
3081 | if (m_physicsActor != null) | ||
3082 | { | ||
3083 | bool isFlying = m_physicsActor.Flying; | ||
3084 | RemoveFromPhysicalScene(); | ||
3085 | AddToPhysicalScene(isFlying); | ||
3086 | } | ||
3078 | 3087 | ||
3079 | /* | 3088 | /* |
3080 | uint i = 0; | 3089 | uint i = 0; |
@@ -3184,21 +3193,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
3184 | /// </summary> | 3193 | /// </summary> |
3185 | public void AddToPhysicalScene(bool isFlying) | 3194 | public void AddToPhysicalScene(bool isFlying) |
3186 | { | 3195 | { |
3196 | if (m_appearance.AvatarHeight == 0) | ||
3197 | m_appearance.SetHeight(); | ||
3198 | |||
3187 | PhysicsScene scene = m_scene.PhysicsScene; | 3199 | PhysicsScene scene = m_scene.PhysicsScene; |
3188 | 3200 | ||
3189 | Vector3 pVec = AbsolutePosition; | 3201 | Vector3 pVec = AbsolutePosition; |
3190 | 3202 | ||
3191 | // Old bug where the height was in centimeters instead of meters | 3203 | // Old bug where the height was in centimeters instead of meters |
3192 | if (m_avHeight == 127.0f) | 3204 | m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec, |
3193 | { | 3205 | new Vector3(0f, 0f, m_appearance.AvatarHeight), isFlying); |
3194 | m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec, new Vector3(0f, 0f, 1.56f), | 3206 | |
3195 | isFlying); | ||
3196 | } | ||
3197 | else | ||
3198 | { | ||
3199 | m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec, | ||
3200 | new Vector3(0f, 0f, m_avHeight), isFlying); | ||
3201 | } | ||
3202 | scene.AddPhysicsActorTaint(m_physicsActor); | 3207 | scene.AddPhysicsActorTaint(m_physicsActor); |
3203 | //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; | 3208 | //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; |
3204 | m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; | 3209 | m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; |