diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs index 38938c6..ba937f5 100644 --- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs +++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs | |||
@@ -37,7 +37,7 @@ using System.Collections.Generic; | |||
37 | using System.Diagnostics; | 37 | using System.Diagnostics; |
38 | using System.Drawing; | 38 | using System.Drawing; |
39 | 39 | ||
40 | using libsecondlife; | 40 | using OpenMetaverse; |
41 | 41 | ||
42 | using Nini.Config; | 42 | using Nini.Config; |
43 | 43 | ||
@@ -48,8 +48,6 @@ using OpenSim.Region.Physics.Manager; | |||
48 | 48 | ||
49 | using log4net; | 49 | using log4net; |
50 | 50 | ||
51 | using Axiom.Math; | ||
52 | |||
53 | namespace OpenSim.Region.Environment.Modules.ContentManagement | 51 | namespace OpenSim.Region.Environment.Modules.ContentManagement |
54 | { | 52 | { |
55 | #region Enumerations | 53 | #region Enumerations |
@@ -99,14 +97,14 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement | |||
99 | 97 | ||
100 | #region Private Methods | 98 | #region Private Methods |
101 | 99 | ||
102 | private static bool AreQuaternionsEquivalent(LLQuaternion first, LLQuaternion second) | 100 | private static bool AreQuaternionsEquivalent(Quaternion first, Quaternion second) |
103 | { | 101 | { |
104 | LLVector3 firstVector = llRot2Euler(first); | 102 | Vector3 firstVector = llRot2Euler(first); |
105 | LLVector3 secondVector = llRot2Euler(second); | 103 | Vector3 secondVector = llRot2Euler(second); |
106 | return AreVectorsEquivalent(firstVector, secondVector); | 104 | return AreVectorsEquivalent(firstVector, secondVector); |
107 | } | 105 | } |
108 | 106 | ||
109 | private static bool AreVectorsEquivalent(LLVector3 first, LLVector3 second) | 107 | private static bool AreVectorsEquivalent(Vector3 first, Vector3 second) |
110 | { | 108 | { |
111 | if(TruncateSignificant(first.X, 2) == TruncateSignificant(second.X, 2) | 109 | if(TruncateSignificant(first.X, 2) == TruncateSignificant(second.X, 2) |
112 | && TruncateSignificant(first.Y, 2) == TruncateSignificant(second.Y, 2) | 110 | && TruncateSignificant(first.Y, 2) == TruncateSignificant(second.Y, 2) |
@@ -133,21 +131,21 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement | |||
133 | 131 | ||
134 | // Taken from Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 132 | // Taken from Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs |
135 | // Also changed the original function from LSL_Types to LL types | 133 | // Also changed the original function from LSL_Types to LL types |
136 | private static LLVector3 llRot2Euler(LLQuaternion r) | 134 | private static Vector3 llRot2Euler(Quaternion r) |
137 | { | 135 | { |
138 | LLQuaternion t = new LLQuaternion(r.X * r.X, r.Y * r.Y, r.Z * r.Z, r.W * r.W); | 136 | Quaternion t = new Quaternion(r.X * r.X, r.Y * r.Y, r.Z * r.Z, r.W * r.W); |
139 | double m = (t.X + t.Y + t.Z + t.W); | 137 | double m = (t.X + t.Y + t.Z + t.W); |
140 | if (m == 0) return new LLVector3(); | 138 | if (m == 0) return new Vector3(); |
141 | double n = 2 * (r.Y * r.W + r.X * r.Z); | 139 | double n = 2 * (r.Y * r.W + r.X * r.Z); |
142 | double p = m * m - n * n; | 140 | double p = m * m - n * n; |
143 | if (p > 0) | 141 | if (p > 0) |
144 | return new LLVector3((float)NormalizeAngle(Math.Atan2(2.0 * (r.X * r.W - r.Y * r.Z), (-t.X - t.Y + t.Z + t.W))), | 142 | return new Vector3((float)NormalizeAngle(Math.Atan2(2.0 * (r.X * r.W - r.Y * r.Z), (-t.X - t.Y + t.Z + t.W))), |
145 | (float)NormalizeAngle(Math.Atan2(n, Math.Sqrt(p))), | 143 | (float)NormalizeAngle(Math.Atan2(n, Math.Sqrt(p))), |
146 | (float)NormalizeAngle(Math.Atan2(2.0 * (r.Z * r.W - r.X * r.Y), (t.X - t.Y - t.Z + t.W)))); | 144 | (float)NormalizeAngle(Math.Atan2(2.0 * (r.Z * r.W - r.X * r.Y), (t.X - t.Y - t.Z + t.W)))); |
147 | else if (n > 0) | 145 | else if (n > 0) |
148 | return new LLVector3(0.0f, (float)(Math.PI / 2), (float)NormalizeAngle(Math.Atan2((r.Z * r.W + r.X * r.Y), 0.5 - t.X - t.Z))); | 146 | return new Vector3(0.0f, (float)(Math.PI / 2), (float)NormalizeAngle(Math.Atan2((r.Z * r.W + r.X * r.Y), 0.5 - t.X - t.Z))); |
149 | else | 147 | else |
150 | return new LLVector3(0.0f, (float)(-Math.PI / 2), (float)NormalizeAngle(Math.Atan2((r.Z * r.W + r.X * r.Y), 0.5 - t.X - t.Z))); | 148 | return new Vector3(0.0f, (float)(-Math.PI / 2), (float)NormalizeAngle(Math.Atan2((r.Z * r.W + r.X * r.Y), 0.5 - t.X - t.Z))); |
151 | } | 149 | } |
152 | 150 | ||
153 | #endregion Private Methods | 151 | #endregion Private Methods |
@@ -187,7 +185,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement | |||
187 | result |= Diff.ROTATIONOFFSET; | 185 | result |= Diff.ROTATIONOFFSET; |
188 | 186 | ||
189 | 187 | ||
190 | // MISC COMPARISONS (LLUUID, Byte) | 188 | // MISC COMPARISONS (UUID, Byte) |
191 | if(first.ClickAction != second.ClickAction) | 189 | if(first.ClickAction != second.ClickAction) |
192 | result |= Diff.CLICKACTION; | 190 | result |= Diff.CLICKACTION; |
193 | if(first.ObjectOwner != second.ObjectOwner) | 191 | if(first.ObjectOwner != second.ObjectOwner) |
@@ -217,4 +215,4 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement | |||
217 | 215 | ||
218 | #endregion Public Methods | 216 | #endregion Public Methods |
219 | } | 217 | } |
220 | } \ No newline at end of file | 218 | } |