diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
12 files changed, 108 insertions, 61 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Entity.cs b/OpenSim/Region/Environment/Scenes/Entity.cs index 204b68f..d9f41e3 100644 --- a/OpenSim/Region/Environment/Scenes/Entity.cs +++ b/OpenSim/Region/Environment/Scenes/Entity.cs | |||
@@ -38,7 +38,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
38 | /// <summary> | 38 | /// <summary> |
39 | /// | 39 | /// |
40 | /// </summary> | 40 | /// </summary> |
41 | public override LLVector3 Pos | 41 | public override LLVector3 AbsolutePosition |
42 | { | 42 | { |
43 | get | 43 | get |
44 | { | 44 | { |
diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs index 5f2634d..a4d9ac5 100644 --- a/OpenSim/Region/Environment/Scenes/EntityBase.cs +++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs | |||
@@ -1,10 +1,11 @@ | |||
1 | using System.Collections.Generic; | 1 | using System.Collections.Generic; |
2 | using Axiom.Math; | 2 | using Axiom.Math; |
3 | using libsecondlife; | 3 | using libsecondlife; |
4 | using OpenSim.Region.Environment.Scenes.Scripting; | ||
4 | 5 | ||
5 | namespace OpenSim.Region.Environment.Scenes | 6 | namespace OpenSim.Region.Environment.Scenes |
6 | { | 7 | { |
7 | public abstract class EntityBase | 8 | public abstract class EntityBase : IScriptHost |
8 | { | 9 | { |
9 | protected List<EntityBase> m_children; | 10 | protected List<EntityBase> m_children; |
10 | 11 | ||
@@ -37,7 +38,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
37 | /// <summary> | 38 | /// <summary> |
38 | /// | 39 | /// |
39 | /// </summary> | 40 | /// </summary> |
40 | public virtual LLVector3 Pos | 41 | public virtual LLVector3 AbsolutePosition |
41 | { | 42 | { |
42 | get { return m_pos; } | 43 | get { return m_pos; } |
43 | set { m_pos = value; } | 44 | set { m_pos = value; } |
diff --git a/OpenSim/Region/Environment/Scenes/Primitive(Old).cs b/OpenSim/Region/Environment/Scenes/Primitive(Old).cs index 64976a8..2f51ab3 100644 --- a/OpenSim/Region/Environment/Scenes/Primitive(Old).cs +++ b/OpenSim/Region/Environment/Scenes/Primitive(Old).cs | |||
@@ -57,14 +57,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
57 | /// If rootprim, will return world position | 57 | /// If rootprim, will return world position |
58 | /// otherwise will return local offset from rootprim | 58 | /// otherwise will return local offset from rootprim |
59 | /// </summary> | 59 | /// </summary> |
60 | public override LLVector3 Pos | 60 | public override LLVector3 AbsolutePosition |
61 | { | 61 | { |
62 | get | 62 | get |
63 | { | 63 | { |
64 | if (m_isRootPrim) | 64 | if (m_isRootPrim) |
65 | { | 65 | { |
66 | //if we are rootprim then our offset should be zero | 66 | //if we are rootprim then our offset should be zero |
67 | return m_pos + m_Parent.Pos; | 67 | return m_pos + m_Parent.AbsolutePosition; |
68 | } | 68 | } |
69 | else | 69 | else |
70 | { | 70 | { |
@@ -75,9 +75,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
75 | { | 75 | { |
76 | if (m_isRootPrim) | 76 | if (m_isRootPrim) |
77 | { | 77 | { |
78 | m_Parent.Pos = value; | 78 | m_Parent.AbsolutePosition = value; |
79 | } | 79 | } |
80 | m_pos = value - m_Parent.Pos; | 80 | m_pos = value - m_Parent.AbsolutePosition; |
81 | } | 81 | } |
82 | } | 82 | } |
83 | 83 | ||
@@ -99,7 +99,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
99 | } | 99 | } |
100 | else | 100 | else |
101 | { | 101 | { |
102 | return Pos; | 102 | return AbsolutePosition; |
103 | } | 103 | } |
104 | } | 104 | } |
105 | } | 105 | } |
@@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
284 | OwnerID = ownerID; | 284 | OwnerID = ownerID; |
285 | CreatorID = OwnerID; | 285 | CreatorID = OwnerID; |
286 | LastOwnerID = LLUUID.Zero; | 286 | LastOwnerID = LLUUID.Zero; |
287 | Pos = pos; | 287 | AbsolutePosition = pos; |
288 | m_uuid = LLUUID.Random(); | 288 | m_uuid = LLUUID.Random(); |
289 | m_localId = (uint)(localID); | 289 | m_localId = (uint)(localID); |
290 | 290 | ||
@@ -335,13 +335,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
335 | /// <param name="rootParent"></param> | 335 | /// <param name="rootParent"></param> |
336 | public void SetNewParent(Primitive newParent, SceneObjectOLD rootParent) | 336 | public void SetNewParent(Primitive newParent, SceneObjectOLD rootParent) |
337 | { | 337 | { |
338 | LLVector3 oldPos = new LLVector3(Pos.X, Pos.Y, Pos.Z); | 338 | LLVector3 oldPos = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); |
339 | m_isRootPrim = false; | 339 | m_isRootPrim = false; |
340 | m_Parent = newParent; | 340 | m_Parent = newParent; |
341 | ParentID = newParent.LocalId; | 341 | ParentID = newParent.LocalId; |
342 | m_RootParent = rootParent; | 342 | m_RootParent = rootParent; |
343 | m_RootParent.AddChildToList(this); | 343 | m_RootParent.AddChildToList(this); |
344 | Pos = oldPos; | 344 | AbsolutePosition = oldPos; |
345 | Vector3 axPos = new Vector3(m_pos.X, m_pos.Y, m_pos.Z); | 345 | Vector3 axPos = new Vector3(m_pos.X, m_pos.Y, m_pos.Z); |
346 | axPos = m_Parent.Rotation.Inverse() * axPos; | 346 | axPos = m_Parent.Rotation.Inverse() * axPos; |
347 | m_pos = new LLVector3(axPos.x, axPos.y, axPos.z); | 347 | m_pos = new LLVector3(axPos.x, axPos.y, axPos.z); |
@@ -366,7 +366,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
366 | public void SetRootParent(SceneObjectOLD newRoot, Primitive newParent, LLVector3 oldParentPosition, | 366 | public void SetRootParent(SceneObjectOLD newRoot, Primitive newParent, LLVector3 oldParentPosition, |
367 | Quaternion oldParentRotation) | 367 | Quaternion oldParentRotation) |
368 | { | 368 | { |
369 | LLVector3 oldPos = new LLVector3(Pos.X, Pos.Y, Pos.Z); | 369 | LLVector3 oldPos = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); |
370 | Vector3 axOldPos = new Vector3(oldPos.X, oldPos.Y, oldPos.Z); | 370 | Vector3 axOldPos = new Vector3(oldPos.X, oldPos.Y, oldPos.Z); |
371 | axOldPos = oldParentRotation * axOldPos; | 371 | axOldPos = oldParentRotation * axOldPos; |
372 | oldPos = new LLVector3(axOldPos.x, axOldPos.y, axOldPos.z); | 372 | oldPos = new LLVector3(axOldPos.x, axOldPos.y, axOldPos.z); |
@@ -379,7 +379,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
379 | 379 | ||
380 | m_RootParent = newRoot; | 380 | m_RootParent = newRoot; |
381 | m_RootParent.AddChildToList(this); | 381 | m_RootParent.AddChildToList(this); |
382 | Pos = oldPos; | 382 | AbsolutePosition = oldPos; |
383 | Vector3 axPos = new Vector3(m_pos.X, m_pos.Y, m_pos.Z); | 383 | Vector3 axPos = new Vector3(m_pos.X, m_pos.Y, m_pos.Z); |
384 | axPos = m_Parent.Rotation.Inverse() * axPos; | 384 | axPos = m_Parent.Rotation.Inverse() * axPos; |
385 | m_pos = new LLVector3(axPos.x, axPos.y, axPos.z); | 385 | m_pos = new LLVector3(axPos.x, axPos.y, axPos.z); |
@@ -445,7 +445,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
445 | { | 445 | { |
446 | LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); | 446 | LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); |
447 | 447 | ||
448 | Pos = newPos; | 448 | AbsolutePosition = newPos; |
449 | ScheduleTerseUpdate(); | 449 | ScheduleTerseUpdate(); |
450 | 450 | ||
451 | OnPrimCountTainted(); | 451 | OnPrimCountTainted(); |
@@ -461,14 +461,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
461 | if (m_isRootPrim) | 461 | if (m_isRootPrim) |
462 | { | 462 | { |
463 | LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); | 463 | LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); |
464 | LLVector3 oldPos = new LLVector3(Pos.X, Pos.Y, Pos.Z); | 464 | LLVector3 oldPos = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); |
465 | LLVector3 diff = oldPos - newPos; | 465 | LLVector3 diff = oldPos - newPos; |
466 | Vector3 axDiff = new Vector3(diff.X, diff.Y, diff.Z); | 466 | Vector3 axDiff = new Vector3(diff.X, diff.Y, diff.Z); |
467 | axDiff = Rotation.Inverse() * axDiff; | 467 | axDiff = Rotation.Inverse() * axDiff; |
468 | diff.X = axDiff.x; | 468 | diff.X = axDiff.x; |
469 | diff.Y = axDiff.y; | 469 | diff.Y = axDiff.y; |
470 | diff.Z = axDiff.z; | 470 | diff.Z = axDiff.z; |
471 | Pos = newPos; | 471 | AbsolutePosition = newPos; |
472 | 472 | ||
473 | foreach (Primitive prim in m_children) | 473 | foreach (Primitive prim in m_children) |
474 | { | 474 | { |
@@ -507,7 +507,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
507 | public void UpdateGroupMouseRotation(LLVector3 pos, LLQuaternion rot) | 507 | public void UpdateGroupMouseRotation(LLVector3 pos, LLQuaternion rot) |
508 | { | 508 | { |
509 | Rotation = new Quaternion(rot.W, rot.X, rot.Y, rot.Z); | 509 | Rotation = new Quaternion(rot.W, rot.X, rot.Y, rot.Z); |
510 | Pos = pos; | 510 | AbsolutePosition = pos; |
511 | ScheduleTerseUpdate(); | 511 | ScheduleTerseUpdate(); |
512 | } | 512 | } |
513 | 513 | ||
@@ -644,7 +644,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
644 | public void SendFullUpdateToClient(IClientAPI remoteClient) | 644 | public void SendFullUpdateToClient(IClientAPI remoteClient) |
645 | { | 645 | { |
646 | LLVector3 lPos; | 646 | LLVector3 lPos; |
647 | lPos = Pos; | 647 | lPos = AbsolutePosition; |
648 | LLQuaternion lRot; | 648 | LLQuaternion lRot; |
649 | lRot = new LLQuaternion(Rotation.x, Rotation.y, Rotation.z, Rotation.w); | 649 | lRot = new LLQuaternion(Rotation.x, Rotation.y, Rotation.z, Rotation.w); |
650 | 650 | ||
@@ -690,7 +690,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
690 | LLVector3 lPos; | 690 | LLVector3 lPos; |
691 | Quaternion lRot; | 691 | Quaternion lRot; |
692 | 692 | ||
693 | lPos = Pos; | 693 | lPos = AbsolutePosition; |
694 | lRot = Rotation; | 694 | lRot = Rotation; |
695 | 695 | ||
696 | LLQuaternion mRot = new LLQuaternion(lRot.x, lRot.y, lRot.z, lRot.w); | 696 | LLQuaternion mRot = new LLQuaternion(lRot.x, lRot.y, lRot.z, lRot.w); |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index b901d23..3f90723 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs | |||
@@ -159,7 +159,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
159 | if (this.Avatars.ContainsKey(fromAgentID)) | 159 | if (this.Avatars.ContainsKey(fromAgentID)) |
160 | { | 160 | { |
161 | avatar = this.Avatars[fromAgentID]; | 161 | avatar = this.Avatars[fromAgentID]; |
162 | fromPos = avatar.Pos; | 162 | fromPos = avatar.AbsolutePosition; |
163 | fromName = avatar.Firstname + " " + avatar.Lastname; | 163 | fromName = avatar.Firstname + " " + avatar.Lastname; |
164 | avatar = null; | 164 | avatar = null; |
165 | } | 165 | } |
@@ -170,7 +170,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
170 | if (this.Avatars.ContainsKey(presence.ControllingClient.AgentId)) | 170 | if (this.Avatars.ContainsKey(presence.ControllingClient.AgentId)) |
171 | { | 171 | { |
172 | avatar = this.Avatars[presence.ControllingClient.AgentId]; | 172 | avatar = this.Avatars[presence.ControllingClient.AgentId]; |
173 | dis = (int)avatar.Pos.GetDistanceTo(fromPos); | 173 | dis = (int)avatar.AbsolutePosition.GetDistanceTo(fromPos); |
174 | } | 174 | } |
175 | 175 | ||
176 | switch (type) | 176 | switch (type) |
@@ -354,7 +354,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
354 | if (originPrim != null) | 354 | if (originPrim != null) |
355 | { | 355 | { |
356 | SceneObjectGroup copy = originPrim.Copy(); | 356 | SceneObjectGroup copy = originPrim.Copy(); |
357 | copy.Pos = copy.Pos + offset; | 357 | copy.AbsolutePosition = copy.AbsolutePosition + offset; |
358 | this.Entities.Add(copy.UUID, copy); | 358 | this.Entities.Add(copy.UUID, copy); |
359 | 359 | ||
360 | copy.ScheduleGroupForFullUpdate(); | 360 | copy.ScheduleGroupForFullUpdate(); |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 96bb97a..7b2d0c5 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -645,7 +645,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
645 | MainLog.Instance.Verbose("World.cs:AddViewerAgent() - Adding new avatar to world"); | 645 | MainLog.Instance.Verbose("World.cs:AddViewerAgent() - Adding new avatar to world"); |
646 | MainLog.Instance.Verbose("World.cs:AddViewerAgent() - Starting RegionHandshake "); | 646 | MainLog.Instance.Verbose("World.cs:AddViewerAgent() - Starting RegionHandshake "); |
647 | 647 | ||
648 | PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); | 648 | PhysicsVector pVec = new PhysicsVector(newAvatar.AbsolutePosition.X, newAvatar.AbsolutePosition.Y, newAvatar.AbsolutePosition.Z); |
649 | lock (m_syncRoot) | 649 | lock (m_syncRoot) |
650 | { | 650 | { |
651 | newAvatar.PhysActor = phyScene.AddAvatar(pVec); | 651 | newAvatar.PhysActor = phyScene.AddAvatar(pVec); |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObject(Old).cs b/OpenSim/Region/Environment/Scenes/SceneObject(Old).cs index 882b72e..f32c952 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObject(Old).cs +++ b/OpenSim/Region/Environment/Scenes/SceneObject(Old).cs | |||
@@ -92,7 +92,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
92 | m_scene = world; | 92 | m_scene = world; |
93 | m_eventManager = eventManager; | 93 | m_eventManager = eventManager; |
94 | 94 | ||
95 | this.Pos = pos; | 95 | this.AbsolutePosition = pos; |
96 | this.CreateRootFromShape(ownerID, localID, shape, pos); | 96 | this.CreateRootFromShape(ownerID, localID, shape, pos); |
97 | 97 | ||
98 | registerEvents(); | 98 | registerEvents(); |
@@ -176,7 +176,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
176 | dupe.rootPrimitive = newRoot; | 176 | dupe.rootPrimitive = newRoot; |
177 | 177 | ||
178 | dupe.m_children.Add(dupe.rootPrimitive); | 178 | dupe.m_children.Add(dupe.rootPrimitive); |
179 | dupe.rootPrimitive.Pos = this.Pos; | 179 | dupe.rootPrimitive.AbsolutePosition = this.AbsolutePosition; |
180 | dupe.Rotation = this.Rotation; | 180 | dupe.Rotation = this.Rotation; |
181 | dupe.LocalId = m_scene.PrimIDAllocate(); | 181 | dupe.LocalId = m_scene.PrimIDAllocate(); |
182 | 182 | ||
@@ -274,7 +274,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
274 | /// <param name="remoteClient"></param> | 274 | /// <param name="remoteClient"></param> |
275 | public void GrapMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) | 275 | public void GrapMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) |
276 | { | 276 | { |
277 | this.rootPrimitive.Pos = pos; | 277 | this.rootPrimitive.AbsolutePosition = pos; |
278 | this.rootPrimitive.SendTerseUpdateForAllChildren(remoteClient); | 278 | this.rootPrimitive.SendTerseUpdateForAllChildren(remoteClient); |
279 | } | 279 | } |
280 | 280 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 73f199e..a5ad2e6 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -76,7 +76,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
76 | } | 76 | } |
77 | } | 77 | } |
78 | 78 | ||
79 | public override LLVector3 Pos | 79 | public override LLVector3 AbsolutePosition |
80 | { | 80 | { |
81 | get { return m_rootPart.GroupPosition; } | 81 | get { return m_rootPart.GroupPosition; } |
82 | set | 82 | set |
@@ -248,7 +248,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
248 | { | 248 | { |
249 | SceneObjectGroup dupe = (SceneObjectGroup)this.MemberwiseClone(); | 249 | SceneObjectGroup dupe = (SceneObjectGroup)this.MemberwiseClone(); |
250 | dupe.m_parts.Clear(); | 250 | dupe.m_parts.Clear(); |
251 | dupe.Pos = new LLVector3(Pos.X, Pos.Y, Pos.Z); | 251 | dupe.AbsolutePosition = new LLVector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); |
252 | dupe.m_scene = m_scene; | 252 | dupe.m_scene = m_scene; |
253 | dupe.m_regionHandle = this.m_regionHandle; | 253 | dupe.m_regionHandle = this.m_regionHandle; |
254 | 254 | ||
@@ -427,8 +427,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
427 | public void LinkToGroup(SceneObjectGroup objectGroup) | 427 | public void LinkToGroup(SceneObjectGroup objectGroup) |
428 | { | 428 | { |
429 | SceneObjectPart linkPart = objectGroup.m_rootPart; | 429 | SceneObjectPart linkPart = objectGroup.m_rootPart; |
430 | linkPart.OffsetPosition = linkPart.GroupPosition - this.Pos; | 430 | linkPart.OffsetPosition = linkPart.GroupPosition - this.AbsolutePosition; |
431 | linkPart.GroupPosition = this.Pos; | 431 | linkPart.GroupPosition = this.AbsolutePosition; |
432 | 432 | ||
433 | Vector3 axPos = new Vector3(linkPart.OffsetPosition.X, linkPart.OffsetPosition.Y, linkPart.OffsetPosition.Z); | 433 | Vector3 axPos = new Vector3(linkPart.OffsetPosition.X, linkPart.OffsetPosition.Y, linkPart.OffsetPosition.Z); |
434 | Quaternion parentRot = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z); | 434 | Quaternion parentRot = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z); |
@@ -456,7 +456,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
456 | /// <param name="remoteClient"></param> | 456 | /// <param name="remoteClient"></param> |
457 | public void GrabMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) | 457 | public void GrabMovement(LLVector3 offset, LLVector3 pos, IClientAPI remoteClient) |
458 | { | 458 | { |
459 | this.Pos = pos; | 459 | this.AbsolutePosition = pos; |
460 | this.m_rootPart.SendTerseUpdateToAllClients(); | 460 | this.m_rootPart.SendTerseUpdateToAllClients(); |
461 | } | 461 | } |
462 | 462 | ||
@@ -482,7 +482,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
482 | proper.ObjectData[0].TouchName = enc.GetBytes(this.m_rootPart.TouchName + "\0"); | 482 | proper.ObjectData[0].TouchName = enc.GetBytes(this.m_rootPart.TouchName + "\0"); |
483 | proper.ObjectData[0].TextureID = new byte[0]; | 483 | proper.ObjectData[0].TextureID = new byte[0]; |
484 | proper.ObjectData[0].SitName = enc.GetBytes(this.m_rootPart.SitName + "\0"); | 484 | proper.ObjectData[0].SitName = enc.GetBytes(this.m_rootPart.SitName + "\0"); |
485 | proper.ObjectData[0].Name = enc.GetBytes(this.m_rootPart.PartName + "\0"); | 485 | proper.ObjectData[0].Name = enc.GetBytes(this.m_rootPart.Name + "\0"); |
486 | proper.ObjectData[0].Description = enc.GetBytes(this.m_rootPart.Description + "\0"); | 486 | proper.ObjectData[0].Description = enc.GetBytes(this.m_rootPart.Description + "\0"); |
487 | proper.ObjectData[0].OwnerMask = this.m_rootPart.OwnerMask; | 487 | proper.ObjectData[0].OwnerMask = this.m_rootPart.OwnerMask; |
488 | proper.ObjectData[0].NextOwnerMask = this.m_rootPart.NextOwnerMask; | 488 | proper.ObjectData[0].NextOwnerMask = this.m_rootPart.NextOwnerMask; |
@@ -502,7 +502,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
502 | SceneObjectPart part = this.GetChildPrim(localID); | 502 | SceneObjectPart part = this.GetChildPrim(localID); |
503 | if (part != null) | 503 | if (part != null) |
504 | { | 504 | { |
505 | part.PartName = name; | 505 | part.Name = name; |
506 | } | 506 | } |
507 | } | 507 | } |
508 | 508 | ||
@@ -636,7 +636,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
636 | /// <param name="pos"></param> | 636 | /// <param name="pos"></param> |
637 | public void UpdateGroupPosition(LLVector3 pos) | 637 | public void UpdateGroupPosition(LLVector3 pos) |
638 | { | 638 | { |
639 | this.Pos = pos; | 639 | this.AbsolutePosition = pos; |
640 | } | 640 | } |
641 | 641 | ||
642 | /// <summary> | 642 | /// <summary> |
@@ -667,7 +667,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
667 | private void UpdateRootPosition(LLVector3 pos) | 667 | private void UpdateRootPosition(LLVector3 pos) |
668 | { | 668 | { |
669 | LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); | 669 | LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); |
670 | LLVector3 oldPos = new LLVector3(this.Pos.X + this.m_rootPart.OffsetPosition.X, this.Pos.Y + this.m_rootPart.OffsetPosition.Y, this.Pos.Z + this.m_rootPart.OffsetPosition.Z); | 670 | LLVector3 oldPos = new LLVector3(this.AbsolutePosition.X + this.m_rootPart.OffsetPosition.X, this.AbsolutePosition.Y + this.m_rootPart.OffsetPosition.Y, this.AbsolutePosition.Z + this.m_rootPart.OffsetPosition.Z); |
671 | LLVector3 diff = oldPos - newPos; | 671 | LLVector3 diff = oldPos - newPos; |
672 | Axiom.Math.Vector3 axDiff = new Vector3(diff.X, diff.Y, diff.Z); | 672 | Axiom.Math.Vector3 axDiff = new Vector3(diff.X, diff.Y, diff.Z); |
673 | Axiom.Math.Quaternion partRotation = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z); | 673 | Axiom.Math.Quaternion partRotation = new Quaternion(this.m_rootPart.RotationOffset.W, this.m_rootPart.RotationOffset.X, this.m_rootPart.RotationOffset.Y, this.m_rootPart.RotationOffset.Z); |
@@ -683,7 +683,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
683 | obPart.OffsetPosition = obPart.OffsetPosition + diff; | 683 | obPart.OffsetPosition = obPart.OffsetPosition + diff; |
684 | } | 684 | } |
685 | } | 685 | } |
686 | this.Pos = newPos; | 686 | this.AbsolutePosition = newPos; |
687 | pos.X = newPos.X; | 687 | pos.X = newPos.X; |
688 | pos.Y = newPos.Y; | 688 | pos.Y = newPos.Y; |
689 | pos.Z = newPos.Z; | 689 | pos.Z = newPos.Z; |
@@ -708,7 +708,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
708 | public void UpdateGroupRotation(LLVector3 pos, LLQuaternion rot) | 708 | public void UpdateGroupRotation(LLVector3 pos, LLQuaternion rot) |
709 | { | 709 | { |
710 | this.m_rootPart.UpdateRotation(rot); | 710 | this.m_rootPart.UpdateRotation(rot); |
711 | this.Pos = pos; | 711 | this.AbsolutePosition = pos; |
712 | } | 712 | } |
713 | 713 | ||
714 | /// <summary> | 714 | /// <summary> |
@@ -828,7 +828,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
828 | { | 828 | { |
829 | if (m_rootPart == part) | 829 | if (m_rootPart == part) |
830 | { | 830 | { |
831 | part.SendFullUpdateToClient(remoteClient, Pos); | 831 | part.SendFullUpdateToClient(remoteClient, AbsolutePosition); |
832 | } | 832 | } |
833 | else | 833 | else |
834 | { | 834 | { |
@@ -845,7 +845,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
845 | { | 845 | { |
846 | if (m_rootPart == part) | 846 | if (m_rootPart == part) |
847 | { | 847 | { |
848 | part.SendTerseUpdateToClient(remoteClient, Pos); | 848 | part.SendTerseUpdateToClient(remoteClient, AbsolutePosition); |
849 | } | 849 | } |
850 | else | 850 | else |
851 | { | 851 | { |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 8e570d4..54bb5e6 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -9,11 +9,12 @@ using libsecondlife; | |||
9 | using libsecondlife.Packets; | 9 | using libsecondlife.Packets; |
10 | using OpenSim.Framework.Interfaces; | 10 | using OpenSim.Framework.Interfaces; |
11 | using OpenSim.Framework.Types; | 11 | using OpenSim.Framework.Types; |
12 | using OpenSim.Region.Environment.Scenes.Scripting; | ||
12 | 13 | ||
13 | namespace OpenSim.Region.Environment.Scenes | 14 | namespace OpenSim.Region.Environment.Scenes |
14 | { | 15 | { |
15 | 16 | ||
16 | public class SceneObjectPart | 17 | public class SceneObjectPart : IScriptHost |
17 | { | 18 | { |
18 | private const uint FULL_MASK_PERMISSIONS = 2147483647; | 19 | private const uint FULL_MASK_PERMISSIONS = 2147483647; |
19 | 20 | ||
@@ -55,11 +56,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
55 | set { m_localID = value; } | 56 | set { m_localID = value; } |
56 | } | 57 | } |
57 | 58 | ||
58 | protected string m_partName; | 59 | protected string m_name; |
59 | public virtual string PartName | 60 | public virtual string Name |
60 | { | 61 | { |
61 | get { return m_partName; } | 62 | get { return m_name; } |
62 | set { m_partName = value; } | 63 | set { m_name = value; } |
63 | } | 64 | } |
64 | 65 | ||
65 | protected LLObject.ObjectFlags m_flags = (LLObject.ObjectFlags)32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456 + 128; | 66 | protected LLObject.ObjectFlags m_flags = (LLObject.ObjectFlags)32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456 + 128; |
@@ -91,11 +92,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
91 | set { m_groupPosition = value; } | 92 | set { m_groupPosition = value; } |
92 | } | 93 | } |
93 | 94 | ||
94 | protected LLVector3 m_offset; | 95 | protected LLVector3 m_offsetPosition; |
95 | public LLVector3 OffsetPosition | 96 | public LLVector3 OffsetPosition |
96 | { | 97 | { |
97 | get { return m_offset; } | 98 | get { return m_offsetPosition; } |
98 | set { m_offset = value; } | 99 | set { m_offsetPosition = value; } |
100 | } | ||
101 | |||
102 | public LLVector3 AbsolutePosition | ||
103 | { | ||
104 | get { return m_offsetPosition + m_groupPosition; } | ||
99 | } | 105 | } |
100 | 106 | ||
101 | protected LLQuaternion m_rotationOffset; | 107 | protected LLQuaternion m_rotationOffset; |
@@ -195,7 +201,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
195 | /// <param name="position"></param> | 201 | /// <param name="position"></param> |
196 | public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, PrimitiveBaseShape shape, LLVector3 groupPosition, LLVector3 offsetPosition) | 202 | public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, PrimitiveBaseShape shape, LLVector3 groupPosition, LLVector3 offsetPosition) |
197 | { | 203 | { |
198 | this.m_partName = "Primitive"; | 204 | this.m_name = "Primitive"; |
199 | this.m_regionHandle = regionHandle; | 205 | this.m_regionHandle = regionHandle; |
200 | this.m_parentGroup = parent; | 206 | this.m_parentGroup = parent; |
201 | 207 | ||
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 6e4fcda..5dbf643 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -156,7 +156,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
156 | this.m_firstname = ControllingClient.FirstName; | 156 | this.m_firstname = ControllingClient.FirstName; |
157 | this.m_lastname = ControllingClient.LastName; | 157 | this.m_lastname = ControllingClient.LastName; |
158 | m_localId = m_scene.NextLocalId; | 158 | m_localId = m_scene.NextLocalId; |
159 | Pos = ControllingClient.StartPos; | 159 | AbsolutePosition = ControllingClient.StartPos; |
160 | 160 | ||
161 | visualParams = new byte[218]; | 161 | visualParams = new byte[218]; |
162 | for (int i = 0; i < 218; i++) | 162 | for (int i = 0; i < 218; i++) |
@@ -205,7 +205,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
205 | if (this.childAgent == true) | 205 | if (this.childAgent == true) |
206 | { | 206 | { |
207 | this.Velocity = new LLVector3(0, 0, 0); | 207 | this.Velocity = new LLVector3(0, 0, 0); |
208 | this.Pos = new LLVector3(128, 128, 70); | 208 | this.AbsolutePosition = new LLVector3(128, 128, 70); |
209 | 209 | ||
210 | } | 210 | } |
211 | } | 211 | } |
@@ -217,7 +217,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
217 | public void MakeAvatar(LLVector3 pos, bool isFlying) | 217 | public void MakeAvatar(LLVector3 pos, bool isFlying) |
218 | { | 218 | { |
219 | //this.childAvatar = false; | 219 | //this.childAvatar = false; |
220 | this.Pos = pos; | 220 | this.AbsolutePosition = pos; |
221 | this._physActor.Flying = isFlying; | 221 | this._physActor.Flying = isFlying; |
222 | this.newAvatar = true; | 222 | this.newAvatar = true; |
223 | this.childAgent = false; | 223 | this.childAgent = false; |
@@ -236,7 +236,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
236 | /// <param name="pos"></param> | 236 | /// <param name="pos"></param> |
237 | public void Teleport(LLVector3 pos) | 237 | public void Teleport(LLVector3 pos) |
238 | { | 238 | { |
239 | this.Pos = pos; | 239 | this.AbsolutePosition = pos; |
240 | this.SendTerseUpdateToALLClients(); | 240 | this.SendTerseUpdateToALLClients(); |
241 | } | 241 | } |
242 | 242 | ||
@@ -278,7 +278,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
278 | { | 278 | { |
279 | look = new LLVector3(0.99f, 0.042f, 0); | 279 | look = new LLVector3(0.99f, 0.042f, 0); |
280 | } | 280 | } |
281 | this.ControllingClient.MoveAgentIntoRegion(m_regionInfo, Pos, look); | 281 | this.ControllingClient.MoveAgentIntoRegion(m_regionInfo, AbsolutePosition, look); |
282 | if (this.childAgent) | 282 | if (this.childAgent) |
283 | { | 283 | { |
284 | this.childAgent = false; | 284 | this.childAgent = false; |
@@ -427,7 +427,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
427 | /// <param name="RemoteClient"></param> | 427 | /// <param name="RemoteClient"></param> |
428 | public void SendTerseUpdateToClient(IClientAPI RemoteClient) | 428 | public void SendTerseUpdateToClient(IClientAPI RemoteClient) |
429 | { | 429 | { |
430 | LLVector3 pos = this.Pos; | 430 | LLVector3 pos = this.AbsolutePosition; |
431 | LLVector3 vel = this.Velocity; | 431 | LLVector3 vel = this.Velocity; |
432 | RemoteClient.SendAvatarTerseUpdate(this.m_regionHandle, 64096, this.LocalId, new LLVector3(pos.X, pos.Y, pos.Z), new LLVector3(vel.X, vel.Y, vel.Z)); | 432 | RemoteClient.SendAvatarTerseUpdate(this.m_regionHandle, 64096, this.LocalId, new LLVector3(pos.X, pos.Y, pos.Z), new LLVector3(vel.X, vel.Y, vel.Z)); |
433 | } | 433 | } |
@@ -450,7 +450,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
450 | /// <param name="remoteAvatar"></param> | 450 | /// <param name="remoteAvatar"></param> |
451 | public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar) | 451 | public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar) |
452 | { | 452 | { |
453 | remoteAvatar.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.m_firstname, this.m_lastname, this.m_uuid, this.LocalId, this.Pos, this.m_textureEntry.ToBytes()); | 453 | remoteAvatar.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.m_firstname, this.m_lastname, this.m_uuid, this.LocalId, this.AbsolutePosition, this.m_textureEntry.ToBytes()); |
454 | } | 454 | } |
455 | 455 | ||
456 | public void SendFullUpdateToALLClients() | 456 | public void SendFullUpdateToALLClients() |
@@ -472,7 +472,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
472 | /// </summary> | 472 | /// </summary> |
473 | public void SendInitialData() | 473 | public void SendInitialData() |
474 | { | 474 | { |
475 | this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.m_firstname, this.m_lastname, this.m_uuid, this.LocalId, this.Pos, this.m_textureEntry.ToBytes()); | 475 | this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.m_firstname, this.m_lastname, this.m_uuid, this.LocalId, this.AbsolutePosition, this.m_textureEntry.ToBytes()); |
476 | if (!this.childAgent) | 476 | if (!this.childAgent) |
477 | { | 477 | { |
478 | this.m_scene.InformClientOfNeighbours(this.ControllingClient); | 478 | this.m_scene.InformClientOfNeighbours(this.ControllingClient); |
@@ -547,9 +547,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
547 | 547 | ||
548 | protected void CheckForSignificantMovement() | 548 | protected void CheckForSignificantMovement() |
549 | { | 549 | { |
550 | if (libsecondlife.Helpers.VecDist(this.Pos, this.posLastSignificantMove) > 2.0) | 550 | if (libsecondlife.Helpers.VecDist(this.AbsolutePosition, this.posLastSignificantMove) > 2.0) |
551 | { | 551 | { |
552 | this.posLastSignificantMove = this.Pos; | 552 | this.posLastSignificantMove = this.AbsolutePosition; |
553 | if (OnSignificantClientMovement != null) | 553 | if (OnSignificantClientMovement != null) |
554 | { | 554 | { |
555 | OnSignificantClientMovement(this.ControllingClient); | 555 | OnSignificantClientMovement(this.ControllingClient); |
@@ -564,7 +564,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
564 | /// </summary> | 564 | /// </summary> |
565 | protected void CheckForBorderCrossing() | 565 | protected void CheckForBorderCrossing() |
566 | { | 566 | { |
567 | LLVector3 pos2 = this.Pos; | 567 | LLVector3 pos2 = this.AbsolutePosition; |
568 | LLVector3 vel = this.Velocity; | 568 | LLVector3 vel = this.Velocity; |
569 | 569 | ||
570 | float timeStep = 0.1f; | 570 | float timeStep = 0.1f; |
@@ -588,7 +588,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
588 | /// </summary> | 588 | /// </summary> |
589 | protected void CrossToNewRegion() | 589 | protected void CrossToNewRegion() |
590 | { | 590 | { |
591 | LLVector3 pos = this.Pos; | 591 | LLVector3 pos = this.AbsolutePosition; |
592 | LLVector3 newpos = new LLVector3(pos.X, pos.Y, pos.Z); | 592 | LLVector3 newpos = new LLVector3(pos.X, pos.Y, pos.Z); |
593 | uint neighbourx = this.m_regionInfo.RegionLocX; | 593 | uint neighbourx = this.m_regionInfo.RegionLocX; |
594 | uint neighboury = this.m_regionInfo.RegionLocY; | 594 | uint neighboury = this.m_regionInfo.RegionLocY; |
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs b/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs new file mode 100644 index 0000000..1c14264 --- /dev/null +++ b/OpenSim/Region/Environment/Scenes/Scripting/IScriptHost.cs | |||
@@ -0,0 +1,14 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using libsecondlife; | ||
5 | |||
6 | namespace OpenSim.Region.Environment.Scenes.Scripting | ||
7 | { | ||
8 | public interface IScriptHost | ||
9 | { | ||
10 | string Name { get; } | ||
11 | LLUUID UUID { get; } | ||
12 | LLVector3 AbsolutePosition { get; } | ||
13 | } | ||
14 | } | ||
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs b/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs new file mode 100644 index 0000000..a55c87e --- /dev/null +++ b/OpenSim/Region/Environment/Scenes/Scripting/NullScriptHost.cs | |||
@@ -0,0 +1,26 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using libsecondlife; | ||
5 | |||
6 | namespace OpenSim.Region.Environment.Scenes.Scripting | ||
7 | { | ||
8 | public class NullScriptHost : IScriptHost | ||
9 | { | ||
10 | LLVector3 m_pos = new LLVector3( 128, 128, 30 ); | ||
11 | public string Name | ||
12 | { | ||
13 | get { return "Object"; } | ||
14 | } | ||
15 | |||
16 | public LLUUID UUID | ||
17 | { | ||
18 | get { return LLUUID.Zero; } | ||
19 | } | ||
20 | |||
21 | public LLVector3 AbsolutePosition | ||
22 | { | ||
23 | get { return m_pos; } | ||
24 | } | ||
25 | } | ||
26 | } | ||
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/ScriptInterpretedAPI.cs b/OpenSim/Region/Environment/Scenes/Scripting/ScriptInterpretedAPI.cs index a5898b7..4617feb 100644 --- a/OpenSim/Region/Environment/Scenes/Scripting/ScriptInterpretedAPI.cs +++ b/OpenSim/Region/Environment/Scenes/Scripting/ScriptInterpretedAPI.cs | |||
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Scripting | |||
74 | [Obsolete("Unimplemented")] | 74 | [Obsolete("Unimplemented")] |
75 | public void osAddToLandPassList(Key avatar, float hours) | 75 | public void osAddToLandPassList(Key avatar, float hours) |
76 | { | 76 | { |
77 | Vector myPosition = Task.Pos; | 77 | Vector myPosition = Task.AbsolutePosition; |
78 | Land myParcel = Scene.LandManager.getLandObject(myPosition.X, myPosition.Y); | 78 | Land myParcel = Scene.LandManager.getLandObject(myPosition.X, myPosition.Y); |
79 | 79 | ||
80 | OpenSim.Framework.Console.MainLog.Instance.Warn("script", "Unimplemented function called by script: osAddToLandPassList(Key avatar, float hours)"); | 80 | OpenSim.Framework.Console.MainLog.Instance.Warn("script", "Unimplemented function called by script: osAddToLandPassList(Key avatar, float hours)"); |