From 0d17ba2a76d4eb01f0bd6097c3974cd9d9fb2061 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 6 Nov 2008 22:21:25 +0000 Subject: * refactor: Attach a scene object to a scene separately from its construction --- .../Region/Examples/SimpleModule/ComplexObject.cs | 24 ++++++++++------------ .../Examples/SimpleModule/CpuCounterObject.cs | 4 ++-- .../Examples/SimpleModule/FileSystemObject.cs | 2 +- 3 files changed, 14 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/Examples') diff --git a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs index 3b776e7..9ad4897 100644 --- a/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/ComplexObject.cs @@ -51,11 +51,9 @@ namespace OpenSim.Region.Examples.SimpleModule { } - public RotatingWheel(ulong regionHandle, SceneObjectGroup parent, UUID ownerID, uint localID, + public RotatingWheel(SceneObjectGroup parent, UUID ownerID, uint localID, Vector3 groupPosition, Vector3 offsetPosition, Quaternion rotationDirection) - : base( - regionHandle, parent, ownerID, localID, PrimitiveBaseShape.Default, groupPosition, offsetPosition - ) + : base(parent, ownerID, localID, PrimitiveBaseShape.Default, groupPosition, offsetPosition) { m_rotationDirection = rotationDirection; @@ -64,13 +62,13 @@ namespace OpenSim.Region.Examples.SimpleModule public override void UpdateMovement() { - UpdateRotation(RotationOffset*m_rotationDirection); + UpdateRotation(RotationOffset * m_rotationDirection); } } public override void UpdateMovement() { - UpdateGroupRotation(GroupRotation*m_rotationDirection); + UpdateGroupRotation(GroupRotation * m_rotationDirection); base.UpdateMovement(); } @@ -80,29 +78,29 @@ namespace OpenSim.Region.Examples.SimpleModule } public ComplexObject(Scene scene, ulong regionHandle, UUID ownerID, uint localID, Vector3 pos) - : base(scene, regionHandle, ownerID, localID, pos, PrimitiveBaseShape.Default) + : base(ownerID, localID, pos, PrimitiveBaseShape.Default) { m_rotationDirection = new Quaternion(0.05f, 0.1f, 0.15f); AddPart( - new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0, 0, 0.75f), + new RotatingWheel(this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0, 0, 0.75f), new Quaternion(0.05f, 0, 0))); AddPart( - new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0, 0, -0.75f), + new RotatingWheel(this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0, 0, -0.75f), new Quaternion(-0.05f, 0, 0))); AddPart( - new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0, 0.75f, 0), + new RotatingWheel(this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0, 0.75f, 0), new Quaternion(0.5f, 0, 0.05f))); AddPart( - new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0, -0.75f, 0), + new RotatingWheel(this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0, -0.75f, 0), new Quaternion(-0.5f, 0, -0.05f))); AddPart( - new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0.75f, 0, 0), + new RotatingWheel(this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(0.75f, 0, 0), new Quaternion(0, 0.5f, 0.05f))); AddPart( - new RotatingWheel(regionHandle, this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(-0.75f, 0, 0), + new RotatingWheel(this, ownerID, scene.PrimIDAllocate(), pos, new Vector3(-0.75f, 0, 0), new Quaternion(0, -0.5f, -0.05f))); RootPart.Flags |= PrimFlags.Touch; diff --git a/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs b/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs index 126ccd3..83bced5 100644 --- a/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/CpuCounterObject.cs @@ -45,8 +45,8 @@ namespace OpenSim.Region.Examples.SimpleModule private PerformanceCounter m_counter; - public CpuCounterObject(Scene world, ulong regionHandle, UUID ownerID, uint localID, Vector3 pos) - : base(world, regionHandle, ownerID, localID, pos, PrimitiveBaseShape.Default) + public CpuCounterObject(UUID ownerID, uint localID, Vector3 pos) + : base(ownerID, localID, pos, PrimitiveBaseShape.Default) { String objectName = "Processor"; String counterName = "% Processor Time"; diff --git a/OpenSim/Region/Examples/SimpleModule/FileSystemObject.cs b/OpenSim/Region/Examples/SimpleModule/FileSystemObject.cs index 3b43c7a..0903edd 100644 --- a/OpenSim/Region/Examples/SimpleModule/FileSystemObject.cs +++ b/OpenSim/Region/Examples/SimpleModule/FileSystemObject.cs @@ -35,7 +35,7 @@ namespace OpenSim.Region.Examples.SimpleModule public class FileSystemObject : SceneObjectGroup { public FileSystemObject(Scene world, FileInfo fileInfo, Vector3 pos) - : base(world, world.RegionInfo.RegionHandle, UUID.Zero, world.NextLocalId, pos, PrimitiveBaseShape.Default) + : base(UUID.Zero, world.NextLocalId, pos, PrimitiveBaseShape.Default) { Text = fileInfo.Name; } -- cgit v1.1