aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs
diff options
context:
space:
mode:
authorJeff Ames2008-09-09 01:26:48 +0000
committerJeff Ames2008-09-09 01:26:48 +0000
commitfae34bb10cfa10702faf5c19d8c8517faa018cb5 (patch)
tree2001f24703b010957254dbb49ef5e222ff30b84d /OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs
parentFix state xxx within state xxx itself triggering a state "change" to (diff)
downloadopensim-SC-fae34bb10cfa10702faf5c19d8c8517faa018cb5.zip
opensim-SC-fae34bb10cfa10702faf5c19d8c8517faa018cb5.tar.gz
opensim-SC-fae34bb10cfa10702faf5c19d8c8517faa018cb5.tar.bz2
opensim-SC-fae34bb10cfa10702faf5c19d8c8517faa018cb5.tar.xz
Update svn properties, formatting cleanup.
Diffstat (limited to 'OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs')
-rw-r--r--OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs74
1 files changed, 37 insertions, 37 deletions
diff --git a/OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs b/OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs
index ba937f5..79e970d 100644
--- a/OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs
+++ b/OpenSim/Region/Environment/Modules/ContentManagementSystem/SceneObjectGroupDiff.cs
@@ -106,13 +106,13 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
106 106
107 private static bool AreVectorsEquivalent(Vector3 first, Vector3 second) 107 private static bool AreVectorsEquivalent(Vector3 first, Vector3 second)
108 { 108 {
109 if(TruncateSignificant(first.X, 2) == TruncateSignificant(second.X, 2) 109 if (TruncateSignificant(first.X, 2) == TruncateSignificant(second.X, 2)
110 && TruncateSignificant(first.Y, 2) == TruncateSignificant(second.Y, 2) 110 && TruncateSignificant(first.Y, 2) == TruncateSignificant(second.Y, 2)
111 && TruncateSignificant(first.Z, 2) == TruncateSignificant(second.Z, 2) 111 && TruncateSignificant(first.Z, 2) == TruncateSignificant(second.Z, 2)
112 ) 112 )
113 return true; 113 return true;
114 else 114 else
115 return false; 115 return false;
116 } 116 }
117 117
118 // Taken from Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs 118 // Taken from Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -126,7 +126,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
126 private static int TruncateSignificant(float num, int digits) 126 private static int TruncateSignificant(float num, int digits)
127 { 127 {
128 return (int) Math.Ceiling((Math.Truncate(num * 10 * digits)/10*digits)); 128 return (int) Math.Ceiling((Math.Truncate(num * 10 * digits)/10*digits));
129 // return (int) ((num * (10*digits))/10*digits); 129 // return (int) ((num * (10*digits))/10*digits);
130 } 130 }
131 131
132 // Taken from Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs 132 // Taken from Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
153 #region Public Methods 153 #region Public Methods
154 154
155 /// <summary> 155 /// <summary>
156 /// Compares the attributes (Vectors, Quaternions, Strings, etc.) between two scene object parts 156 /// Compares the attributes (Vectors, Quaternions, Strings, etc.) between two scene object parts
157 /// and returns a Diff bitmask which details what the differences are. 157 /// and returns a Diff bitmask which details what the differences are.
158 /// </summary> 158 /// </summary>
159 public static Diff FindDifferences(SceneObjectPart first, SceneObjectPart second) 159 public static Diff FindDifferences(SceneObjectPart first, SceneObjectPart second)
@@ -164,47 +164,47 @@ namespace OpenSim.Region.Environment.Modules.ContentManagement
164 Diff result = 0; 164 Diff result = 0;
165 165
166 // VECTOR COMPARISONS 166 // VECTOR COMPARISONS
167 if(! AreVectorsEquivalent(first.Acceleration, second.Acceleration)) 167 if (!AreVectorsEquivalent(first.Acceleration, second.Acceleration))
168 result |= Diff.ACCELERATION; 168 result |= Diff.ACCELERATION;
169 if(! AreVectorsEquivalent(first.AbsolutePosition, second.AbsolutePosition)) 169 if (!AreVectorsEquivalent(first.AbsolutePosition, second.AbsolutePosition))
170 result |= Diff.POSITION; 170 result |= Diff.POSITION;
171 if(! AreVectorsEquivalent(first.AngularVelocity, second.AngularVelocity)) 171 if (!AreVectorsEquivalent(first.AngularVelocity, second.AngularVelocity))
172 result |= Diff.ANGULARVELOCITY; 172 result |= Diff.ANGULARVELOCITY;
173 if(! AreVectorsEquivalent(first.OffsetPosition, second.OffsetPosition)) 173 if (!AreVectorsEquivalent(first.OffsetPosition, second.OffsetPosition))
174 result |= Diff.OFFSETPOSITION; 174 result |= Diff.OFFSETPOSITION;
175 if(! AreVectorsEquivalent(first.RotationalVelocity, second.RotationalVelocity)) 175 if (!AreVectorsEquivalent(first.RotationalVelocity, second.RotationalVelocity))
176 result |= Diff.ROTATIONALVELOCITY; 176 result |= Diff.ROTATIONALVELOCITY;
177 if(! AreVectorsEquivalent(first.Scale, second.Scale)) 177 if (!AreVectorsEquivalent(first.Scale, second.Scale))
178 result |= Diff.SCALE; 178 result |= Diff.SCALE;
179 if(! AreVectorsEquivalent(first.Velocity, second.Velocity)) 179 if (!AreVectorsEquivalent(first.Velocity, second.Velocity))
180 result |= Diff.VELOCITY; 180 result |= Diff.VELOCITY;
181 181
182 182
183 // QUATERNION COMPARISONS 183 // QUATERNION COMPARISONS
184 if(! AreQuaternionsEquivalent(first.RotationOffset, second.RotationOffset)) 184 if (!AreQuaternionsEquivalent(first.RotationOffset, second.RotationOffset))
185 result |= Diff.ROTATIONOFFSET; 185 result |= Diff.ROTATIONOFFSET;
186 186
187 187
188 // MISC COMPARISONS (UUID, Byte) 188 // MISC COMPARISONS (UUID, Byte)
189 if(first.ClickAction != second.ClickAction) 189 if (first.ClickAction != second.ClickAction)
190 result |= Diff.CLICKACTION; 190 result |= Diff.CLICKACTION;
191 if(first.ObjectOwner != second.ObjectOwner) 191 if (first.ObjectOwner != second.ObjectOwner)
192 result |= Diff.OBJECTOWNER; 192 result |= Diff.OBJECTOWNER;
193 193
194 194
195 // STRING COMPARISONS 195 // STRING COMPARISONS
196 if(first.Description != second.Description) 196 if (first.Description != second.Description)
197 result |= Diff.DESCRIPTION; 197 result |= Diff.DESCRIPTION;
198 if(first.Material != second.Material) 198 if (first.Material != second.Material)
199 result |= Diff.MATERIAL; 199 result |= Diff.MATERIAL;
200 if(first.Name != second.Name) 200 if (first.Name != second.Name)
201 result |= Diff.NAME; 201 result |= Diff.NAME;
202 if(first.SitName != second.SitName) 202 if (first.SitName != second.SitName)
203 result |= Diff.SITNAME; 203 result |= Diff.SITNAME;
204 if(first.Text != second.Text) 204 if (first.Text != second.Text)
205 result |= Diff.TEXT; 205 result |= Diff.TEXT;
206 if(first.TouchName != second.TouchName) 206 if (first.TouchName != second.TouchName)
207 result |= Diff.TOUCHNAME; 207 result |= Diff.TOUCHNAME;
208 208
209 x.Stop(); 209 x.Stop();
210 TimeToDiff += x.ElapsedMilliseconds; 210 TimeToDiff += x.ElapsedMilliseconds;