diff options
author | MW | 2007-07-18 13:40:07 +0000 |
---|---|---|
committer | MW | 2007-07-18 13:40:07 +0000 |
commit | 04ece84d6b3aa442ed7413f23b0daa30ff6d3ee8 (patch) | |
tree | e457adc88cfa763d6e3fb3734b253f94b2aa775b /OpenSim/Region/Environment/Scenes/Primitive.cs | |
parent | * Added a FileSystemObject to SimpleApp (diff) | |
download | opensim-SC-04ece84d6b3aa442ed7413f23b0daa30ff6d3ee8.zip opensim-SC-04ece84d6b3aa442ed7413f23b0daa30ff6d3ee8.tar.gz opensim-SC-04ece84d6b3aa442ed7413f23b0daa30ff6d3ee8.tar.bz2 opensim-SC-04ece84d6b3aa442ed7413f23b0daa30ff6d3ee8.tar.xz |
few small changes
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Primitive.cs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Primitive.cs b/OpenSim/Region/Environment/Scenes/Primitive.cs index 5b6b13d..4818348 100644 --- a/OpenSim/Region/Environment/Scenes/Primitive.cs +++ b/OpenSim/Region/Environment/Scenes/Primitive.cs | |||
@@ -9,7 +9,7 @@ using OpenSim.Framework.Types; | |||
9 | 9 | ||
10 | namespace OpenSim.Region.Environment.Scenes | 10 | namespace OpenSim.Region.Environment.Scenes |
11 | { | 11 | { |
12 | public delegate void PrimCountTaintedDelegate(); | 12 | // public delegate void PrimCountTaintedDelegate(); |
13 | 13 | ||
14 | public class Primitive : EntityBase | 14 | public class Primitive : EntityBase |
15 | { | 15 | { |
@@ -198,12 +198,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
198 | dupe.m_RootParent = rootParent; | 198 | dupe.m_RootParent = rootParent; |
199 | 199 | ||
200 | // TODO: Copy this properly. | 200 | // TODO: Copy this properly. |
201 | |||
201 | dupe.m_inventoryItems = m_inventoryItems; | 202 | dupe.m_inventoryItems = m_inventoryItems; |
202 | dupe.m_children = new List<EntityBase>(); | 203 | dupe.m_children = new List<EntityBase>(); |
203 | dupe.m_Shape = m_Shape.Copy(); | 204 | dupe.m_Shape = m_Shape.Copy(); |
204 | dupe.m_regionHandle = m_regionHandle; | 205 | dupe.m_regionHandle = m_regionHandle; |
205 | dupe.m_world = m_world; | 206 | dupe.m_world = m_world; |
206 | 207 | ||
208 | |||
207 | uint newLocalID = m_world.PrimIDAllocate(); | 209 | uint newLocalID = m_world.PrimIDAllocate(); |
208 | dupe.m_uuid = LLUUID.Random(); | 210 | dupe.m_uuid = LLUUID.Random(); |
209 | dupe.LocalId = newLocalID; | 211 | dupe.LocalId = newLocalID; |
@@ -227,9 +229,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
227 | m_world.AcknowledgeNewPrim(dupe); | 229 | m_world.AcknowledgeNewPrim(dupe); |
228 | dupe.TriggerOnPrimCountTainted(); | 230 | dupe.TriggerOnPrimCountTainted(); |
229 | 231 | ||
232 | |||
230 | foreach (Primitive prim in m_children) | 233 | foreach (Primitive prim in m_children) |
231 | { | 234 | { |
232 | Primitive primClone = prim.Copy(dupe, rootParent); | 235 | Primitive primClone = prim.Copy(dupe, rootParent); |
236 | |||
233 | dupe.m_children.Add(primClone); | 237 | dupe.m_children.Add(primClone); |
234 | } | 238 | } |
235 | 239 | ||
@@ -320,6 +324,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
320 | { | 324 | { |
321 | // Console.WriteLine("linking new prims " + linkObject.rootLocalID + " to me (" + this.LocalId + ")"); | 325 | // Console.WriteLine("linking new prims " + linkObject.rootLocalID + " to me (" + this.LocalId + ")"); |
322 | //TODO check permissions | 326 | //TODO check permissions |
327 | |||
323 | m_children.Add(linkObject.rootPrimitive); | 328 | m_children.Add(linkObject.rootPrimitive); |
324 | linkObject.rootPrimitive.SetNewParent(this, m_RootParent); | 329 | linkObject.rootPrimitive.SetNewParent(this, m_RootParent); |
325 | 330 | ||
@@ -350,11 +355,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
350 | Rotation = m_Parent.Rotation.Inverse() * Rotation; | 355 | Rotation = m_Parent.Rotation.Inverse() * Rotation; |
351 | ScheduleFullUpdate(); | 356 | ScheduleFullUpdate(); |
352 | 357 | ||
358 | |||
353 | foreach (Primitive child in m_children) | 359 | foreach (Primitive child in m_children) |
354 | { | 360 | { |
355 | child.SetRootParent(rootParent, newParent, oldPos, oldRot); | 361 | child.SetRootParent(rootParent, newParent, oldPos, oldRot); |
356 | } | 362 | } |
363 | |||
357 | m_children.Clear(); | 364 | m_children.Clear(); |
365 | |||
358 | } | 366 | } |
359 | 367 | ||
360 | /// <summary> | 368 | /// <summary> |
@@ -374,6 +382,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
374 | m_Parent = newParent; | 382 | m_Parent = newParent; |
375 | ParentID = newParent.LocalId; | 383 | ParentID = newParent.LocalId; |
376 | newParent.AddToChildrenList(this); | 384 | newParent.AddToChildrenList(this); |
385 | |||
377 | m_RootParent = newRoot; | 386 | m_RootParent = newRoot; |
378 | m_RootParent.AddChildToList(this); | 387 | m_RootParent.AddChildToList(this); |
379 | Pos = oldPos; | 388 | Pos = oldPos; |
@@ -387,7 +396,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
387 | { | 396 | { |
388 | child.SetRootParent(newRoot, newParent, oldPos, oldRot); | 397 | child.SetRootParent(newRoot, newParent, oldPos, oldRot); |
389 | } | 398 | } |
399 | |||
390 | m_children.Clear(); | 400 | m_children.Clear(); |
401 | |||
391 | } | 402 | } |
392 | 403 | ||
393 | /// <summary> | 404 | /// <summary> |
@@ -527,6 +538,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
527 | public void UpdateSingleRotation(LLQuaternion rot) | 538 | public void UpdateSingleRotation(LLQuaternion rot) |
528 | { | 539 | { |
529 | //Console.WriteLine("updating single prim rotation"); | 540 | //Console.WriteLine("updating single prim rotation"); |
541 | |||
530 | Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z); | 542 | Quaternion axRot = new Quaternion(rot.W, rot.X, rot.Y, rot.Z); |
531 | Quaternion oldParentRot = new Quaternion(Rotation.w, Rotation.x, Rotation.y, Rotation.z); | 543 | Quaternion oldParentRot = new Quaternion(Rotation.w, Rotation.x, Rotation.y, Rotation.z); |
532 | Rotation = axRot; | 544 | Rotation = axRot; |
@@ -598,9 +610,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
598 | /// <param name="remoteClient"></param> | 610 | /// <param name="remoteClient"></param> |
599 | public void SendFullUpdateForAllChildren(IClientAPI remoteClient) | 611 | public void SendFullUpdateForAllChildren(IClientAPI remoteClient) |
600 | { | 612 | { |
613 | |||
601 | SendFullUpdateToClient(remoteClient); | 614 | SendFullUpdateToClient(remoteClient); |
602 | for (int i = 0; i < m_children.Count; i++) | 615 | for (int i = 0; i < m_children.Count; i++) |
616 | |||
603 | { | 617 | { |
618 | |||
604 | if (m_children[i] is Primitive) | 619 | if (m_children[i] is Primitive) |
605 | { | 620 | { |
606 | ((Primitive)m_children[i]).SendFullUpdateForAllChildren(remoteClient); | 621 | ((Primitive)m_children[i]).SendFullUpdateForAllChildren(remoteClient); |
@@ -641,6 +656,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
641 | /// <param name="remoteClient"></param> | 656 | /// <param name="remoteClient"></param> |
642 | public void SendTerseUpdateForAllChildren(IClientAPI remoteClient) | 657 | public void SendTerseUpdateForAllChildren(IClientAPI remoteClient) |
643 | { | 658 | { |
659 | |||
644 | SendTerseUpdateToClient(remoteClient); | 660 | SendTerseUpdateToClient(remoteClient); |
645 | for (int i = 0; i < m_children.Count; i++) | 661 | for (int i = 0; i < m_children.Count; i++) |
646 | { | 662 | { |