aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs202
1 files changed, 101 insertions, 101 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 0196b91..a52d5f9 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -41,7 +41,7 @@ using OpenSim.Region.Physics.Manager;
41 41
42namespace OpenSim.Region.Environment.Scenes 42namespace OpenSim.Region.Environment.Scenes
43{ 43{
44 // I don't really know where to put this except here. 44 // I don't really know where to put this except here.
45 // Can't access the OpenSim.Region.ScriptEngine.Common.LSL_BaseClass.Changed constants 45 // Can't access the OpenSim.Region.ScriptEngine.Common.LSL_BaseClass.Changed constants
46 [Flags] 46 [Flags]
47 public enum ExtraParamType 47 public enum ExtraParamType
@@ -81,13 +81,13 @@ namespace OpenSim.Region.Environment.Scenes
81 SCALE = 0x40 81 SCALE = 0x40
82 } 82 }
83 83
84 84
85 [Serializable] 85 [Serializable]
86 public partial class SceneObjectPart : IScriptHost, ISerializable 86 public partial class SceneObjectPart : IScriptHost, ISerializable
87 { 87 {
88 88
89 [XmlIgnore] public PhysicsActor PhysActor = null; 89 [XmlIgnore] public PhysicsActor PhysActor = null;
90 90
91 public LLUUID LastOwnerID; 91 public LLUUID LastOwnerID;
92 public LLUUID OwnerID; 92 public LLUUID OwnerID;
93 public LLUUID GroupID; 93 public LLUUID GroupID;
@@ -95,7 +95,7 @@ namespace OpenSim.Region.Environment.Scenes
95 public byte ObjectSaleType; 95 public byte ObjectSaleType;
96 public int SalePrice; 96 public int SalePrice;
97 public uint Category; 97 public uint Category;
98 98
99 // TODO: This needs to be persisted in next XML version update! 99 // TODO: This needs to be persisted in next XML version update!
100 [XmlIgnore] public int[] PayPrice = {-2,-2,-2,-2,-2}; 100 [XmlIgnore] public int[] PayPrice = {-2,-2,-2,-2,-2};
101 [XmlIgnore] private Dictionary<LLUUID, scriptEvents> m_scriptEvents = new Dictionary<LLUUID, scriptEvents>(); 101 [XmlIgnore] private Dictionary<LLUUID, scriptEvents> m_scriptEvents = new Dictionary<LLUUID, scriptEvents>();
@@ -139,7 +139,7 @@ namespace OpenSim.Region.Environment.Scenes
139 set { Flags = (LLObject.ObjectFlags)value; } 139 set { Flags = (LLObject.ObjectFlags)value; }
140 } 140 }
141 141
142 #endregion 142 #endregion
143 143
144 protected byte[] m_particleSystem = new byte[0]; 144 protected byte[] m_particleSystem = new byte[0];
145 145
@@ -152,13 +152,13 @@ namespace OpenSim.Region.Environment.Scenes
152 /// 0 - no update is scheduled 152 /// 0 - no update is scheduled
153 /// 1 - terse update scheduled 153 /// 1 - terse update scheduled
154 /// 2 - full update scheduled 154 /// 2 - full update scheduled
155 /// 155 ///
156 /// TODO - This should be an enumeration 156 /// TODO - This should be an enumeration
157 /// </summary> 157 /// </summary>
158 private byte m_updateFlag; 158 private byte m_updateFlag;
159 159
160 #region Properties 160 #region Properties
161 161
162 public LLUUID CreatorID; 162 public LLUUID CreatorID;
163 163
164 public LLUUID ObjectCreator 164 public LLUUID ObjectCreator
@@ -230,7 +230,7 @@ namespace OpenSim.Region.Environment.Scenes
230 /// <returns>A Linked Child Prim objects position in world</returns> 230 /// <returns>A Linked Child Prim objects position in world</returns>
231 public LLVector3 GetWorldPosition() 231 public LLVector3 GetWorldPosition()
232 { 232 {
233 233
234 Quaternion parentRot = new Quaternion( 234 Quaternion parentRot = new Quaternion(
235 ParentGroup.RootPart.RotationOffset.W, 235 ParentGroup.RootPart.RotationOffset.W,
236 ParentGroup.RootPart.RotationOffset.X, 236 ParentGroup.RootPart.RotationOffset.X,
@@ -256,13 +256,13 @@ namespace OpenSim.Region.Environment.Scenes
256 /// <returns></returns> 256 /// <returns></returns>
257 public LLQuaternion GetWorldRotation() 257 public LLQuaternion GetWorldRotation()
258 { 258 {
259 259
260 Quaternion newRot; 260 Quaternion newRot;
261 261
262 if (this.LinkNum == 0) 262 if (this.LinkNum == 0)
263 { 263 {
264 newRot = new Quaternion(RotationOffset.W,RotationOffset.X,RotationOffset.Y,RotationOffset.Z); 264 newRot = new Quaternion(RotationOffset.W,RotationOffset.X,RotationOffset.Y,RotationOffset.Z);
265 265
266 } 266 }
267 else 267 else
268 { 268 {
@@ -286,7 +286,7 @@ namespace OpenSim.Region.Environment.Scenes
286 //return new LLQuaternion(axiomPartRotation.x, axiomPartRotation.y, axiomPartRotation.z, axiomPartRotation.w); 286 //return new LLQuaternion(axiomPartRotation.x, axiomPartRotation.y, axiomPartRotation.z, axiomPartRotation.w);
287 287
288 } 288 }
289 289
290 public void StoreUndoState() 290 public void StoreUndoState()
291 { 291 {
292 if (!m_undoing) 292 if (!m_undoing)
@@ -307,7 +307,7 @@ namespace OpenSim.Region.Environment.Scenes
307 if (m_parentGroup.GetSceneMaxUndo() > 0) 307 if (m_parentGroup.GetSceneMaxUndo() > 0)
308 { 308 {
309 UndoState nUndo = new UndoState(this); 309 UndoState nUndo = new UndoState(this);
310 310
311 m_undo.Push(nUndo); 311 m_undo.Push(nUndo);
312 312
313 } 313 }
@@ -362,7 +362,7 @@ namespace OpenSim.Region.Environment.Scenes
362 } 362 }
363 else 363 else
364 { 364 {
365 365
366 // To move the child prim in respect to the group position and rotation we have to calculate 366 // To move the child prim in respect to the group position and rotation we have to calculate
367 367
368 LLVector3 resultingposition = GetWorldPosition(); 368 LLVector3 resultingposition = GetWorldPosition();
@@ -370,7 +370,7 @@ namespace OpenSim.Region.Environment.Scenes
370 LLQuaternion resultingrot = GetWorldRotation(); 370 LLQuaternion resultingrot = GetWorldRotation();
371 PhysActor.Orientation = new Quaternion(resultingrot.W, resultingrot.X, resultingrot.Y, resultingrot.Z); 371 PhysActor.Orientation = new Quaternion(resultingrot.W, resultingrot.X, resultingrot.Y, resultingrot.Z);
372 } 372 }
373 373
374 // Tell the physics engines that this prim changed. 374 // Tell the physics engines that this prim changed.
375 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 375 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
376 } 376 }
@@ -379,12 +379,12 @@ namespace OpenSim.Region.Environment.Scenes
379 Console.WriteLine(e.Message); 379 Console.WriteLine(e.Message);
380 } 380 }
381 } 381 }
382 382
383 } 383 }
384 } 384 }
385 385
386 private byte[] m_TextureAnimation; 386 private byte[] m_TextureAnimation;
387 387
388 protected LLVector3 m_offsetPosition; 388 protected LLVector3 m_offsetPosition;
389 389
390 public LLVector3 OffsetPosition 390 public LLVector3 OffsetPosition
@@ -398,7 +398,7 @@ namespace OpenSim.Region.Environment.Scenes
398 { 398 {
399 // Hack to get the child prim to update world positions in the physics engine 399 // Hack to get the child prim to update world positions in the physics engine
400 ParentGroup.ResetChildPrimPhysicsPositions(); 400 ParentGroup.ResetChildPrimPhysicsPositions();
401 401
402 } 402 }
403 catch (NullReferenceException) 403 catch (NullReferenceException)
404 { 404 {
@@ -467,7 +467,7 @@ namespace OpenSim.Region.Environment.Scenes
467 Console.WriteLine(ex.Message); 467 Console.WriteLine(ex.Message);
468 } 468 }
469 } 469 }
470 470
471 } 471 }
472 } 472 }
473 473
@@ -494,8 +494,8 @@ namespace OpenSim.Region.Environment.Scenes
494 494
495 return m_velocity; 495 return m_velocity;
496 } 496 }
497 set { 497 set {
498 498
499 m_velocity = value; 499 m_velocity = value;
500 if (PhysActor != null) 500 if (PhysActor != null)
501 { 501 {
@@ -505,7 +505,7 @@ namespace OpenSim.Region.Environment.Scenes
505 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); 505 m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
506 } 506 }
507 } 507 }
508 508
509 } 509 }
510 } 510 }
511 511
@@ -565,7 +565,7 @@ namespace OpenSim.Region.Environment.Scenes
565 { 565 {
566 m_color = value; 566 m_color = value;
567 TriggerScriptChangedEvent(Changed.COLOR); 567 TriggerScriptChangedEvent(Changed.COLOR);
568 568
569 /* ScheduleFullUpdate() need not be called b/c after 569 /* ScheduleFullUpdate() need not be called b/c after
570 * setting the color, the text will be set, so then 570 * setting the color, the text will be set, so then
571 * ScheduleFullUpdate() will be called. */ 571 * ScheduleFullUpdate() will be called. */
@@ -615,11 +615,11 @@ namespace OpenSim.Region.Environment.Scenes
615 public int LinkNum 615 public int LinkNum
616 { 616 {
617 get { return m_linkNum; } 617 get { return m_linkNum; }
618 set 618 set
619 { 619 {
620 m_linkNum = value; 620 m_linkNum = value;
621 TriggerScriptChangedEvent(Changed.LINK); 621 TriggerScriptChangedEvent(Changed.LINK);
622 622
623 } 623 }
624 } 624 }
625 625
@@ -646,7 +646,7 @@ namespace OpenSim.Region.Environment.Scenes
646 public void ApplyImpulse(LLVector3 impulsei, bool localGlobalTF) 646 public void ApplyImpulse(LLVector3 impulsei, bool localGlobalTF)
647 { 647 {
648 PhysicsVector impulse = new PhysicsVector(impulsei.X, impulsei.Y, impulsei.Z); 648 PhysicsVector impulse = new PhysicsVector(impulsei.X, impulsei.Y, impulsei.Z);
649 649
650 if (localGlobalTF) 650 if (localGlobalTF)
651 { 651 {
652 652
@@ -659,7 +659,7 @@ namespace OpenSim.Region.Environment.Scenes
659 } 659 }
660 else 660 else
661 { 661 {
662 662
663 if (m_parentGroup != null) 663 if (m_parentGroup != null)
664 { 664 {
665 m_parentGroup.applyImpulse(impulse); 665 m_parentGroup.applyImpulse(impulse);
@@ -698,9 +698,9 @@ namespace OpenSim.Region.Environment.Scenes
698 public PrimitiveBaseShape Shape 698 public PrimitiveBaseShape Shape
699 { 699 {
700 get { return m_shape; } 700 get { return m_shape; }
701 set 701 set
702 { 702 {
703 703
704 m_shape = value; 704 m_shape = value;
705 TriggerScriptChangedEvent(Changed.SHAPE); 705 TriggerScriptChangedEvent(Changed.SHAPE);
706 } 706 }
@@ -709,7 +709,7 @@ namespace OpenSim.Region.Environment.Scenes
709 public LLVector3 Scale 709 public LLVector3 Scale
710 { 710 {
711 get { return m_shape.Scale; } 711 get { return m_shape.Scale; }
712 set 712 set
713 { 713 {
714 StoreUndoState(); 714 StoreUndoState();
715 m_shape.Scale = value; 715 m_shape.Scale = value;
@@ -731,7 +731,7 @@ namespace OpenSim.Region.Environment.Scenes
731 } 731 }
732 732
733 #endregion 733 #endregion
734 734
735 public LLUUID ObjectOwner 735 public LLUUID ObjectOwner
736 { 736 {
737 get { return OwnerID; } 737 get { return OwnerID; }
@@ -809,9 +809,9 @@ namespace OpenSim.Region.Environment.Scenes
809 Acceleration = new LLVector3(0, 0, 0); 809 Acceleration = new LLVector3(0, 0, 0);
810 m_TextureAnimation = new byte[0]; 810 m_TextureAnimation = new byte[0];
811 m_inventoryFileName = "inventory_" + LLUUID.Random().ToString() + ".tmp"; 811 m_inventoryFileName = "inventory_" + LLUUID.Random().ToString() + ".tmp";
812 812
813 // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol, 813 // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol,
814 // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from 814 // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from
815 // the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log 815 // the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log
816 816
817 Flags = 0; 817 Flags = 0;
@@ -819,7 +819,7 @@ namespace OpenSim.Region.Environment.Scenes
819 819
820 TrimPermissions(); 820 TrimPermissions();
821 //m_undo = new UndoStack<UndoState>(ParentGroup.GetSceneMaxUndo()); 821 //m_undo = new UndoStack<UndoState>(ParentGroup.GetSceneMaxUndo());
822 822
823 ScheduleFullUpdate(); 823 ScheduleFullUpdate();
824 } 824 }
825 825
@@ -855,14 +855,14 @@ namespace OpenSim.Region.Environment.Scenes
855 OffsetPosition = position; 855 OffsetPosition = position;
856 RotationOffset = rotation; 856 RotationOffset = rotation;
857 ObjectFlags = flags; 857 ObjectFlags = flags;
858 858
859 // Since we don't store script state, this is only a 'temporary' objectflag now 859 // Since we don't store script state, this is only a 'temporary' objectflag now
860 // If the object is scripted, the script will get loaded and this will be set again 860 // If the object is scripted, the script will get loaded and this will be set again
861 ObjectFlags &= ~(uint)(LLObject.ObjectFlags.Scripted | LLObject.ObjectFlags.Touch); 861 ObjectFlags &= ~(uint)(LLObject.ObjectFlags.Scripted | LLObject.ObjectFlags.Touch);
862 862
863 TrimPermissions(); 863 TrimPermissions();
864 // ApplyPhysics(); 864 // ApplyPhysics();
865 865
866 ScheduleFullUpdate(); 866 ScheduleFullUpdate();
867 } 867 }
868 868
@@ -881,7 +881,7 @@ namespace OpenSim.Region.Environment.Scenes
881 SceneObjectPart newobject = (SceneObjectPart) serializer.Deserialize(xmlReader); 881 SceneObjectPart newobject = (SceneObjectPart) serializer.Deserialize(xmlReader);
882 return newobject; 882 return newobject;
883 } 883 }
884 884
885 public void ApplyPhysics(uint rootObjectFlags, bool m_physicalPrim) 885 public void ApplyPhysics(uint rootObjectFlags, bool m_physicalPrim)
886 { 886 {
887 887
@@ -902,7 +902,7 @@ namespace OpenSim.Region.Environment.Scenes
902 new PhysicsVector(Scale.X, Scale.Y, Scale.Z), 902 new PhysicsVector(Scale.X, Scale.Y, Scale.Z),
903 new Quaternion(RotationOffset.W, RotationOffset.X, 903 new Quaternion(RotationOffset.W, RotationOffset.X,
904 RotationOffset.Y, RotationOffset.Z), RigidBody); 904 RotationOffset.Y, RotationOffset.Z), RigidBody);
905 905
906 // Basic Physics returns null.. joy joy joy. 906 // Basic Physics returns null.. joy joy joy.
907 if (PhysActor != null) 907 if (PhysActor != null)
908 { 908 {
@@ -954,7 +954,7 @@ namespace OpenSim.Region.Environment.Scenes
954 Vector3 rOrigin = iray.Origin; 954 Vector3 rOrigin = iray.Origin;
955 Vector3 rDirection = iray.Direction; 955 Vector3 rDirection = iray.Direction;
956 956
957 957
958 958
959 //rDirection = rDirection.Normalize(); 959 //rDirection = rDirection.Normalize();
960 // Buidling the first part of the Quadratic equation 960 // Buidling the first part of the Quadratic equation
@@ -985,7 +985,7 @@ namespace OpenSim.Region.Environment.Scenes
985 radius = vScale.z; 985 radius = vScale.z;
986 986
987 // the second part of this is the default prim size 987 // the second part of this is the default prim size
988 // once we factor in the aabb of the prim we're adding we can 988 // once we factor in the aabb of the prim we're adding we can
989 // change this to; 989 // change this to;
990 // radius = (radius / 2) - 0.01f; 990 // radius = (radius / 2) - 0.01f;
991 // 991 //
@@ -1018,7 +1018,7 @@ namespace OpenSim.Region.Environment.Scenes
1018 } 1018 }
1019 } 1019 }
1020 1020
1021 // We got an intersection. putting together an EntityIntersection object with the 1021 // We got an intersection. putting together an EntityIntersection object with the
1022 // intersection information 1022 // intersection information
1023 Vector3 ipoint = 1023 Vector3 ipoint =
1024 new Vector3(iray.Origin.x + (iray.Direction.x*root), iray.Origin.y + (iray.Direction.y*root), 1024 new Vector3(iray.Origin.x + (iray.Direction.x*root), iray.Origin.y + (iray.Direction.y*root),
@@ -1089,16 +1089,16 @@ namespace OpenSim.Region.Environment.Scenes
1089 Vector3 AXpos = new Vector3(pos.X, pos.Y, pos.Z); 1089 Vector3 AXpos = new Vector3(pos.X, pos.Y, pos.Z);
1090 1090
1091 // tScale is the offset to derive the vertex based on the scale. 1091 // tScale is the offset to derive the vertex based on the scale.
1092 // it's different for each vertex because we've got to rotate it 1092 // it's different for each vertex because we've got to rotate it
1093 // to get the world position of the vertex to produce the Oriented Bounding Box 1093 // to get the world position of the vertex to produce the Oriented Bounding Box
1094 1094
1095 Vector3 tScale = new Vector3(); 1095 Vector3 tScale = new Vector3();
1096 1096
1097 Vector3 AXscale = new Vector3(m_shape.Scale.X * 0.5f, m_shape.Scale.Y * 0.5f, m_shape.Scale.Z * 0.5f); 1097 Vector3 AXscale = new Vector3(m_shape.Scale.X * 0.5f, m_shape.Scale.Y * 0.5f, m_shape.Scale.Z * 0.5f);
1098 1098
1099 //Vector3 pScale = (AXscale) - (AXrot.Inverse() * (AXscale)); 1099 //Vector3 pScale = (AXscale) - (AXrot.Inverse() * (AXscale));
1100 //Vector3 nScale = (AXscale * -1) - (AXrot.Inverse() * (AXscale * -1)); 1100 //Vector3 nScale = (AXscale * -1) - (AXrot.Inverse() * (AXscale * -1));
1101 1101
1102 // rScale is the rotated offset to find a vertex based on the scale and the world rotation. 1102 // rScale is the rotated offset to find a vertex based on the scale and the world rotation.
1103 Vector3 rScale = new Vector3(); 1103 Vector3 rScale = new Vector3();
1104 1104
@@ -1109,14 +1109,14 @@ namespace OpenSim.Region.Environment.Scenes
1109 // | | 1109 // | |
1110 // | 4 top | 1110 // | 4 top |
1111 // |_________| 1111 // |_________|
1112 // C D 1112 // C D
1113 1113
1114 // A _________ B 1114 // A _________ B
1115 // | Back | 1115 // | Back |
1116 // | 3 | 1116 // | 3 |
1117 // |_________| 1117 // |_________|
1118 // C D 1118 // C D
1119 1119
1120 // A _________ B B _________ A 1120 // A _________ B B _________ A
1121 // | Left | | Right | 1121 // | Left | | Right |
1122 // | 0 | | 2 | 1122 // | 0 | | 2 |
@@ -1127,13 +1127,13 @@ namespace OpenSim.Region.Environment.Scenes
1127 // | Front | 1127 // | Front |
1128 // | 1 | 1128 // | 1 |
1129 // |_________| 1129 // |_________|
1130 // C D 1130 // C D
1131 1131
1132 // C _________ D 1132 // C _________ D
1133 // | | 1133 // | |
1134 // | 5 bot | 1134 // | 5 bot |
1135 // |_________| 1135 // |_________|
1136 // A B 1136 // A B
1137 #endregion 1137 #endregion
1138 1138
1139 #region Plane Decomposition of Oriented Bounding Box 1139 #region Plane Decomposition of Oriented Bounding Box
@@ -1238,22 +1238,22 @@ namespace OpenSim.Region.Environment.Scenes
1238 for (int i = 0; i < 6; i++) 1238 for (int i = 0; i < 6; i++)
1239 { 1239 {
1240 //m_log.Info("[FACECALCULATION]: FaceA[" + i + "]=" + FaceA[i] + " FaceB[" + i + "]=" + FaceB[i] + " FaceC[" + i + "]=" + FaceC[i] + " FaceD[" + i + "]=" + FaceD[i]); 1240 //m_log.Info("[FACECALCULATION]: FaceA[" + i + "]=" + FaceA[i] + " FaceB[" + i + "]=" + FaceB[i] + " FaceC[" + i + "]=" + FaceC[i] + " FaceD[" + i + "]=" + FaceD[i]);
1241 1241
1242 // Our Plane direction 1242 // Our Plane direction
1243 AmBa = FaceA[i] - FaceB[i]; 1243 AmBa = FaceA[i] - FaceB[i];
1244 AmBb = FaceB[i] - FaceC[i]; 1244 AmBb = FaceB[i] - FaceC[i];
1245 1245
1246 cross = AmBb.Cross(AmBa); 1246 cross = AmBb.Cross(AmBa);
1247 1247
1248 // normalize the cross product to get the normal. 1248 // normalize the cross product to get the normal.
1249 normals[i] = cross / cross.Length; 1249 normals[i] = cross / cross.Length;
1250 1250
1251 //m_log.Info("[NORMALS]: normals[ " + i + "]" + normals[i].ToString()); 1251 //m_log.Info("[NORMALS]: normals[ " + i + "]" + normals[i].ToString());
1252 //distance[i] = (normals[i].x * AmBa.x + normals[i].y * AmBa.y + normals[i].z * AmBa.z) * -1; 1252 //distance[i] = (normals[i].x * AmBa.x + normals[i].y * AmBa.y + normals[i].z * AmBa.z) * -1;
1253 } 1253 }
1254 1254
1255 EntityIntersection returnresult = new EntityIntersection(); 1255 EntityIntersection returnresult = new EntityIntersection();
1256 1256
1257 returnresult.distance = 1024; 1257 returnresult.distance = 1024;
1258 float c = 0; 1258 float c = 0;
1259 float a = 0; 1259 float a = 0;
@@ -1276,7 +1276,7 @@ namespace OpenSim.Region.Environment.Scenes
1276 //{ 1276 //{
1277 //return returnresult; 1277 //return returnresult;
1278 //} 1278 //}
1279 // else 1279 // else
1280 //{ 1280 //{
1281 //continue; 1281 //continue;
1282 //} 1282 //}
@@ -1294,9 +1294,9 @@ namespace OpenSim.Region.Environment.Scenes
1294 //} 1294 //}
1295 1295
1296 //} 1296 //}
1297 //else 1297 //else
1298 //{ 1298 //{
1299 //if (a < fmin) 1299 //if (a < fmin)
1300 //{ 1300 //{
1301 //if (a < 0 || a < fmax) 1301 //if (a < 0 || a < fmax)
1302 //{ 1302 //{
@@ -1339,7 +1339,7 @@ namespace OpenSim.Region.Environment.Scenes
1339 1339
1340 // If the normal is pointing outside the object 1340 // If the normal is pointing outside the object
1341 1341
1342 1342
1343 1343
1344 if (iray.Direction.Dot(normals[i]) < 0 || !frontFacesOnly) 1344 if (iray.Direction.Dot(normals[i]) < 0 || !frontFacesOnly)
1345 { 1345 {
@@ -1359,7 +1359,7 @@ namespace OpenSim.Region.Environment.Scenes
1359 { 1359 {
1360 distance2 = (float)GetDistanceTo(q, iray.Origin); 1360 distance2 = (float)GetDistanceTo(q, iray.Origin);
1361 } 1361 }
1362 1362
1363 1363
1364 if (distance2 < returnresult.distance) 1364 if (distance2 < returnresult.distance)
1365 { 1365 {
@@ -1378,7 +1378,7 @@ namespace OpenSim.Region.Environment.Scenes
1378 } 1378 }
1379 return returnresult; 1379 return returnresult;
1380 } 1380 }
1381 1381
1382 // Use this for attachments! LocalID should be avatar's localid 1382 // Use this for attachments! LocalID should be avatar's localid
1383 public void SetParentLocalId(uint localID) 1383 public void SetParentLocalId(uint localID)
1384 { 1384 {
@@ -1388,16 +1388,16 @@ namespace OpenSim.Region.Environment.Scenes
1388 public void SetAttachmentPoint(uint AttachmentPoint) 1388 public void SetAttachmentPoint(uint AttachmentPoint)
1389 { 1389 {
1390 m_attachmentPoint = AttachmentPoint; 1390 m_attachmentPoint = AttachmentPoint;
1391 1391
1392 // save the attachment point. 1392 // save the attachment point.
1393 //if (AttachmentPoint != 0) 1393 //if (AttachmentPoint != 0)
1394 //{ 1394 //{
1395 m_shape.State = (byte)AttachmentPoint; 1395 m_shape.State = (byte)AttachmentPoint;
1396 //} 1396 //}
1397 1397
1398 } 1398 }
1399 /// <summary> 1399 /// <summary>
1400 /// 1400 ///
1401 /// </summary> 1401 /// </summary>
1402 public void SetParent(SceneObjectGroup parent) 1402 public void SetParent(SceneObjectGroup parent)
1403 { 1403 {
@@ -1417,7 +1417,7 @@ namespace OpenSim.Region.Environment.Scenes
1417 PhysActor.Buoyancy = fvalue; 1417 PhysActor.Buoyancy = fvalue;
1418 } 1418 }
1419 } 1419 }
1420 1420
1421 public void SetAxisRotation(int axis, int rotate) 1421 public void SetAxisRotation(int axis, int rotate)
1422 { 1422 {
1423 if (m_parentGroup != null) 1423 if (m_parentGroup != null)
@@ -1448,7 +1448,7 @@ namespace OpenSim.Region.Environment.Scenes
1448 1448
1449 } 1449 }
1450 } 1450 }
1451 1451
1452 1452
1453 public LLVector3 GetSitTargetPositionLL() 1453 public LLVector3 GetSitTargetPositionLL()
1454 { 1454 {
@@ -1547,9 +1547,9 @@ namespace OpenSim.Region.Environment.Scenes
1547 dupe.ObjectSaleType = ObjectSaleType; 1547 dupe.ObjectSaleType = ObjectSaleType;
1548 dupe.SalePrice = SalePrice; 1548 dupe.SalePrice = SalePrice;
1549 dupe.Category = Category; 1549 dupe.Category = Category;
1550 1550
1551 dupe.TaskInventory = (TaskInventoryDictionary)dupe.TaskInventory.Clone(); 1551 dupe.TaskInventory = (TaskInventoryDictionary)dupe.TaskInventory.Clone();
1552 1552
1553 dupe.ResetIDs(linkNum); 1553 dupe.ResetIDs(linkNum);
1554 1554
1555 // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated. 1555 // This may be wrong... it might have to be applied in SceneObjectGroup to the object that's being duplicated.
@@ -1569,7 +1569,7 @@ namespace OpenSim.Region.Environment.Scenes
1569 } 1569 }
1570 1570
1571 #endregion 1571 #endregion
1572 1572
1573 /// <summary> 1573 /// <summary>
1574 /// Reset LLUUIDs for this part. This involves generate this part's own LLUUID and 1574 /// Reset LLUUIDs for this part. This involves generate this part's own LLUUID and
1575 /// generating new LLUUIDs for all the items in the inventory. 1575 /// generating new LLUUIDs for all the items in the inventory.
@@ -1578,8 +1578,8 @@ namespace OpenSim.Region.Environment.Scenes
1578 public void ResetIDs(int linkNum) 1578 public void ResetIDs(int linkNum)
1579 { 1579 {
1580 UUID = LLUUID.Random(); 1580 UUID = LLUUID.Random();
1581 LinkNum = linkNum; 1581 LinkNum = linkNum;
1582 1582
1583 ResetInventoryIDs(); 1583 ResetInventoryIDs();
1584 } 1584 }
1585 1585
@@ -1603,9 +1603,9 @@ namespace OpenSim.Region.Environment.Scenes
1603 m_parentGroup.HasGroupChanged = true; 1603 m_parentGroup.HasGroupChanged = true;
1604 m_parentGroup.QueueForUpdateCheck(); 1604 m_parentGroup.QueueForUpdateCheck();
1605 } 1605 }
1606 1606
1607 int timeNow = Util.UnixTimeSinceEpoch(); 1607 int timeNow = Util.UnixTimeSinceEpoch();
1608 1608
1609 // If multiple updates are scheduled on the same second, we still need to perform all of them 1609 // If multiple updates are scheduled on the same second, we still need to perform all of them
1610 // So we'll force the issue by bumping up the timestamp so that later processing sees these need 1610 // So we'll force the issue by bumping up the timestamp so that later processing sees these need
1611 // to be performed. 1611 // to be performed.
@@ -1617,11 +1617,11 @@ namespace OpenSim.Region.Environment.Scenes
1617 { 1617 {
1618 TimeStampFull = (uint)timeNow; 1618 TimeStampFull = (uint)timeNow;
1619 } 1619 }
1620 1620
1621 m_updateFlag = 2; 1621 m_updateFlag = 2;
1622 1622
1623// m_log.DebugFormat( 1623// m_log.DebugFormat(
1624// "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}", 1624// "[SCENE OBJECT PART]: Scheduling full update for {0}, {1} at {2}",
1625// UUID, Name, TimeStampFull); 1625// UUID, Name, TimeStampFull);
1626 } 1626 }
1627 1627
@@ -1668,13 +1668,13 @@ namespace OpenSim.Region.Environment.Scenes
1668 m_updateFlag = 1; 1668 m_updateFlag = 1;
1669 1669
1670// m_log.DebugFormat( 1670// m_log.DebugFormat(
1671// "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}", 1671// "[SCENE OBJECT PART]: Scheduling terse update for {0}, {1} at {2}",
1672// UUID, Name, TimeStampTerse); 1672// UUID, Name, TimeStampTerse);
1673 } 1673 }
1674 } 1674 }
1675 1675
1676 /// <summary> 1676 /// <summary>
1677 /// Tell all the prims which have had updates scheduled 1677 /// Tell all the prims which have had updates scheduled
1678 /// </summary> 1678 /// </summary>
1679 public void SendScheduledUpdates() 1679 public void SendScheduledUpdates()
1680 { 1680 {
@@ -1687,7 +1687,7 @@ namespace OpenSim.Region.Environment.Scenes
1687 // bad, so it's been replaced by an event driven method. 1687 // bad, so it's been replaced by an event driven method.
1688 //if ((ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0) 1688 //if ((ObjectFlags & (uint)LLObject.ObjectFlags.Physics) != 0)
1689 //{ 1689 //{
1690 // Only send the constant terse updates on physical objects! 1690 // Only send the constant terse updates on physical objects!
1691 //ScheduleTerseUpdate(); 1691 //ScheduleTerseUpdate();
1692 //} 1692 //}
1693 } 1693 }
@@ -1706,7 +1706,7 @@ namespace OpenSim.Region.Environment.Scenes
1706 #region Shape 1706 #region Shape
1707 1707
1708 /// <summary> 1708 /// <summary>
1709 /// 1709 ///
1710 /// </summary> 1710 /// </summary>
1711 /// <param name="shapeBlock"></param> 1711 /// <param name="shapeBlock"></param>
1712 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock) 1712 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock)
@@ -1750,7 +1750,7 @@ namespace OpenSim.Region.Environment.Scenes
1750 //m_log.Info("TSomething4:" + ((type & (ushort)ExtraParamType.Something4) == (ushort)ExtraParamType.Something4)); 1750 //m_log.Info("TSomething4:" + ((type & (ushort)ExtraParamType.Something4) == (ushort)ExtraParamType.Something4));
1751 //m_log.Info("TSomething5:" + ((type & (ushort)ExtraParamType.Something5) == (ushort)ExtraParamType.Something5)); 1751 //m_log.Info("TSomething5:" + ((type & (ushort)ExtraParamType.Something5) == (ushort)ExtraParamType.Something5));
1752 //m_log.Info("TSomething6:" + ((type & (ushort)ExtraParamType.Something6) == (ushort)ExtraParamType.Something6)); 1752 //m_log.Info("TSomething6:" + ((type & (ushort)ExtraParamType.Something6) == (ushort)ExtraParamType.Something6));
1753 1753
1754 bool usePhysics = false; 1754 bool usePhysics = false;
1755 bool IsTemporary = false; 1755 bool IsTemporary = false;
1756 bool IsPhantom = false; 1756 bool IsPhantom = false;
@@ -1758,7 +1758,7 @@ namespace OpenSim.Region.Environment.Scenes
1758 bool wasUsingPhysics = ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) != 0); 1758 bool wasUsingPhysics = ((ObjectFlags & (uint) LLObject.ObjectFlags.Physics) != 0);
1759 //bool IsLocked = false; 1759 //bool IsLocked = false;
1760 int i = 0; 1760 int i = 0;
1761 1761
1762 1762
1763 try 1763 try
1764 { 1764 {
@@ -1975,7 +1975,7 @@ namespace OpenSim.Region.Environment.Scenes
1975 #region Texture 1975 #region Texture
1976 1976
1977 /// <summary> 1977 /// <summary>
1978 /// 1978 ///
1979 /// </summary> 1979 /// </summary>
1980 /// <param name="textureEntry"></param> 1980 /// <param name="textureEntry"></param>
1981 public void UpdateTextureEntry(byte[] textureEntry) 1981 public void UpdateTextureEntry(byte[] textureEntry)
@@ -1985,7 +1985,7 @@ namespace OpenSim.Region.Environment.Scenes
1985 ScheduleFullUpdate(); 1985 ScheduleFullUpdate();
1986 } 1986 }
1987 1987
1988 // Added to handle bug in libsecondlife's TextureEntry.ToBytes() 1988 // Added to handle bug in libsecondlife's TextureEntry.ToBytes()
1989 // not handling RGBA properly. Cycles through, and "fixes" the color 1989 // not handling RGBA properly. Cycles through, and "fixes" the color
1990 // info 1990 // info
1991 public void UpdateTexture(LLObject.TextureEntry tex) 1991 public void UpdateTexture(LLObject.TextureEntry tex)
@@ -2030,7 +2030,7 @@ namespace OpenSim.Region.Environment.Scenes
2030 byte[] data = new byte[16]; 2030 byte[] data = new byte[16];
2031 int pos = 0; 2031 int pos = 0;
2032 2032
2033 // The flags don't like conversion from uint to byte, so we have to do 2033 // The flags don't like conversion from uint to byte, so we have to do
2034 // it the crappy way. See the above function :( 2034 // it the crappy way. See the above function :(
2035 2035
2036 data[pos] = ConvertScriptUintToByte(pTexAnim.Flags); pos++; 2036 data[pos] = ConvertScriptUintToByte(pTexAnim.Flags); pos++;
@@ -2059,7 +2059,7 @@ namespace OpenSim.Region.Environment.Scenes
2059 #region Position 2059 #region Position
2060 2060
2061 /// <summary> 2061 /// <summary>
2062 /// 2062 ///
2063 /// </summary> 2063 /// </summary>
2064 /// <param name="pos"></param> 2064 /// <param name="pos"></param>
2065 public void UpdateOffSet(LLVector3 pos) 2065 public void UpdateOffSet(LLVector3 pos)
@@ -2115,7 +2115,7 @@ namespace OpenSim.Region.Environment.Scenes
2115 foreach (ScenePresence p in avatarts) 2115 foreach (ScenePresence p in avatarts)
2116 { 2116 {
2117 // TODO: some filtering by distance of avatar 2117 // TODO: some filtering by distance of avatar
2118 2118
2119 p.ControllingClient.SendPreLoadSound(objectID, objectID, soundID); 2119 p.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);
2120 } 2120 }
2121 } 2121 }
@@ -2193,14 +2193,14 @@ namespace OpenSim.Region.Environment.Scenes
2193 #region Resizing/Scale 2193 #region Resizing/Scale
2194 2194
2195 /// <summary> 2195 /// <summary>
2196 /// 2196 ///
2197 /// </summary> 2197 /// </summary>
2198 /// <param name="scale"></param> 2198 /// <param name="scale"></param>
2199 public void Resize(LLVector3 scale) 2199 public void Resize(LLVector3 scale)
2200 { 2200 {
2201 StoreUndoState(); 2201 StoreUndoState();
2202 m_shape.Scale = scale; 2202 m_shape.Scale = scale;
2203 2203
2204 ScheduleFullUpdate(); 2204 ScheduleFullUpdate();
2205 } 2205 }
2206 2206
@@ -2261,7 +2261,7 @@ namespace OpenSim.Region.Environment.Scenes
2261 } 2261 }
2262 2262
2263 #region Client Update Methods 2263 #region Client Update Methods
2264 2264
2265 /// <summary> 2265 /// <summary>
2266 /// Tell all scene presences that they should send updates for this part to their clients 2266 /// Tell all scene presences that they should send updates for this part to their clients
2267 /// </summary> 2267 /// </summary>
@@ -2287,7 +2287,7 @@ namespace OpenSim.Region.Environment.Scenes
2287 } 2287 }
2288 } 2288 }
2289 } 2289 }
2290 2290
2291 2291
2292 public void AddFullUpdateToAvatar(ScenePresence presence) 2292 public void AddFullUpdateToAvatar(ScenePresence presence)
2293 { 2293 {
@@ -2295,7 +2295,7 @@ namespace OpenSim.Region.Environment.Scenes
2295 } 2295 }
2296 2296
2297 /// <summary> 2297 /// <summary>
2298 /// 2298 ///
2299 /// </summary> 2299 /// </summary>
2300 public void SendFullUpdateToAllClients() 2300 public void SendFullUpdateToAllClients()
2301 { 2301 {
@@ -2309,7 +2309,7 @@ namespace OpenSim.Region.Environment.Scenes
2309 } 2309 }
2310 2310
2311 /// <summary> 2311 /// <summary>
2312 /// 2312 ///
2313 /// </summary> 2313 /// </summary>
2314 /// <param name="remoteClient"></param> 2314 /// <param name="remoteClient"></param>
2315 public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags) 2315 public void SendFullUpdate(IClientAPI remoteClient, uint clientFlags)
@@ -2328,7 +2328,7 @@ namespace OpenSim.Region.Environment.Scenes
2328 lPos = OffsetPosition; 2328 lPos = OffsetPosition;
2329 SendFullUpdateToClient(remoteClient, lPos, clientflags); 2329 SendFullUpdateToClient(remoteClient, lPos, clientflags);
2330 } 2330 }
2331 2331
2332 /// <summary> 2332 /// <summary>
2333 /// Sends a full update to the client 2333 /// Sends a full update to the client
2334 /// </summary> 2334 /// </summary>
@@ -2338,7 +2338,7 @@ namespace OpenSim.Region.Environment.Scenes
2338 public void SendFullUpdateToClient(IClientAPI remoteClient, LLVector3 lPos, uint clientFlags) 2338 public void SendFullUpdateToClient(IClientAPI remoteClient, LLVector3 lPos, uint clientFlags)
2339 { 2339 {
2340 clientFlags &= ~(uint) LLObject.ObjectFlags.CreateSelected; 2340 clientFlags &= ~(uint) LLObject.ObjectFlags.CreateSelected;
2341 2341
2342 if (remoteClient.AgentId == OwnerID) 2342 if (remoteClient.AgentId == OwnerID)
2343 { 2343 {
2344 if ((uint) (Flags & LLObject.ObjectFlags.CreateSelected) != 0) 2344 if ((uint) (Flags & LLObject.ObjectFlags.CreateSelected) != 0)
@@ -2351,7 +2351,7 @@ namespace OpenSim.Region.Environment.Scenes
2351 2351
2352 byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A}; 2352 byte[] color = new byte[] {m_color.R, m_color.G, m_color.B, m_color.A};
2353 remoteClient.SendPrimitiveToClient( 2353 remoteClient.SendPrimitiveToClient(
2354 m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, m_shape, 2354 m_regionHandle, (ushort)(m_parentGroup.GetTimeDilation() * (float)ushort.MaxValue), LocalId, m_shape,
2355 lPos, Velocity, Acceleration, RotationOffset, RotationalVelocity, clientFlags, m_uuid, 2355 lPos, Velocity, Acceleration, RotationOffset, RotationalVelocity, clientFlags, m_uuid,
2356 OwnerID, 2356 OwnerID,
2357 m_text, color, ParentID, m_particleSystem, m_clickAction, m_TextureAnimation, m_IsAttachment, m_attachmentPoint,fromAssetID); 2357 m_text, color, ParentID, m_particleSystem, m_clickAction, m_TextureAnimation, m_IsAttachment, m_attachmentPoint,fromAssetID);
@@ -2373,7 +2373,7 @@ namespace OpenSim.Region.Environment.Scenes
2373 } 2373 }
2374 2374
2375 /// <summary> 2375 /// <summary>
2376 /// 2376 ///
2377 /// </summary> 2377 /// </summary>
2378 public void SendTerseUpdateToAllClients() 2378 public void SendTerseUpdateToAllClients()
2379 { 2379 {
@@ -2451,7 +2451,7 @@ namespace OpenSim.Region.Environment.Scenes
2451 m_parentGroup.AbsolutePosition = newpos; 2451 m_parentGroup.AbsolutePosition = newpos;
2452 return; 2452 return;
2453 } 2453 }
2454 2454
2455 } 2455 }
2456 ScheduleTerseUpdate(); 2456 ScheduleTerseUpdate();
2457 2457