diff options
author | lbsa71 | 2007-03-27 21:42:14 +0000 |
---|---|---|
committer | lbsa71 | 2007-03-27 21:42:14 +0000 |
commit | f42d1fc825b7b9d22ae05836992531d9abd2a26d (patch) | |
tree | c316d0d2ec56a34c6c7f2099977bcc6f14e5eb24 /OpenSim.RegionServer/world/Primitive.cs | |
parent | * Reverting todays work. It was worth a try. (diff) | |
download | opensim-SC_OLD-f42d1fc825b7b9d22ae05836992531d9abd2a26d.zip opensim-SC_OLD-f42d1fc825b7b9d22ae05836992531d9abd2a26d.tar.gz opensim-SC_OLD-f42d1fc825b7b9d22ae05836992531d9abd2a26d.tar.bz2 opensim-SC_OLD-f42d1fc825b7b9d22ae05836992531d9abd2a26d.tar.xz |
* revert the revert - begin the beguine
Diffstat (limited to 'OpenSim.RegionServer/world/Primitive.cs')
-rw-r--r-- | OpenSim.RegionServer/world/Primitive.cs | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/OpenSim.RegionServer/world/Primitive.cs b/OpenSim.RegionServer/world/Primitive.cs index 6ff66a3..a185f0b 100644 --- a/OpenSim.RegionServer/world/Primitive.cs +++ b/OpenSim.RegionServer/world/Primitive.cs | |||
@@ -22,6 +22,9 @@ namespace OpenSim.world | |||
22 | private PhysicsActor _physActor; | 22 | private PhysicsActor _physActor; |
23 | private bool physicsEnabled = false; | 23 | private bool physicsEnabled = false; |
24 | private bool physicstest = false; //just added for testing | 24 | private bool physicstest = false; //just added for testing |
25 | private Dictionary<uint, SimClient> m_clientThreads; | ||
26 | private ulong m_regionHandle; | ||
27 | private World m_world; | ||
25 | 28 | ||
26 | public bool PhysicsEnabled | 29 | public bool PhysicsEnabled |
27 | { | 30 | { |
@@ -65,10 +68,14 @@ namespace OpenSim.world | |||
65 | } | 68 | } |
66 | } | 69 | } |
67 | 70 | ||
68 | public Primitive() | 71 | public Primitive(Dictionary<uint, SimClient> clientThreads, ulong regionHandle, World world) |
69 | { | 72 | { |
70 | mesh_cutbegin = 0.0f; | 73 | mesh_cutbegin = 0.0f; |
71 | mesh_cutend = 1.0f; | 74 | mesh_cutend = 1.0f; |
75 | |||
76 | m_clientThreads = clientThreads; | ||
77 | m_regionHandle = regionHandle; | ||
78 | m_world = world; | ||
72 | } | 79 | } |
73 | 80 | ||
74 | public override Mesh getMesh() | 81 | public override Mesh getMesh() |
@@ -99,7 +106,7 @@ namespace OpenSim.world | |||
99 | { | 106 | { |
100 | if (this.newPrimFlag) | 107 | if (this.newPrimFlag) |
101 | { | 108 | { |
102 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) | 109 | foreach (SimClient client in m_clientThreads.Values) |
103 | { | 110 | { |
104 | client.OutPacket(OurPacket); | 111 | client.OutPacket(OurPacket); |
105 | } | 112 | } |
@@ -108,11 +115,11 @@ namespace OpenSim.world | |||
108 | else if (this.updateFlag) | 115 | else if (this.updateFlag) |
109 | { | 116 | { |
110 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); | 117 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); |
111 | terse.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; // FIXME | 118 | terse.RegionData.RegionHandle = m_regionHandle; // FIXME |
112 | terse.RegionData.TimeDilation = 64096; | 119 | terse.RegionData.TimeDilation = 64096; |
113 | terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; | 120 | terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; |
114 | terse.ObjectData[0] = this.CreateImprovedBlock(); | 121 | terse.ObjectData[0] = this.CreateImprovedBlock(); |
115 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) | 122 | foreach (SimClient client in m_clientThreads.Values) |
116 | { | 123 | { |
117 | client.OutPacket(terse); | 124 | client.OutPacket(terse); |
118 | } | 125 | } |
@@ -120,7 +127,7 @@ namespace OpenSim.world | |||
120 | } | 127 | } |
121 | else if (this.dirtyFlag) | 128 | else if (this.dirtyFlag) |
122 | { | 129 | { |
123 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) | 130 | foreach (SimClient client in m_clientThreads.Values) |
124 | { | 131 | { |
125 | UpdateClient(client); | 132 | UpdateClient(client); |
126 | } | 133 | } |
@@ -131,11 +138,11 @@ namespace OpenSim.world | |||
131 | if (this._physActor != null && this.physicsEnabled) | 138 | if (this._physActor != null && this.physicsEnabled) |
132 | { | 139 | { |
133 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); | 140 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); |
134 | terse.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; // FIXME | 141 | terse.RegionData.RegionHandle = m_regionHandle; // FIXME |
135 | terse.RegionData.TimeDilation = 64096; | 142 | terse.RegionData.TimeDilation = 64096; |
136 | terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; | 143 | terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; |
137 | terse.ObjectData[0] = this.CreateImprovedBlock(); | 144 | terse.ObjectData[0] = this.CreateImprovedBlock(); |
138 | foreach (SimClient client in OpenSimRoot.Instance.ClientThreads.Values) | 145 | foreach (SimClient client in m_clientThreads.Values) |
139 | { | 146 | { |
140 | client.OutPacket(terse); | 147 | client.OutPacket(terse); |
141 | } | 148 | } |
@@ -255,7 +262,7 @@ namespace OpenSim.world | |||
255 | public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID) | 262 | public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID) |
256 | { | 263 | { |
257 | ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); | 264 | ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); |
258 | objupdate.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; | 265 | objupdate.RegionData.RegionHandle = m_regionHandle; |
259 | objupdate.RegionData.TimeDilation = 64096; | 266 | objupdate.RegionData.TimeDilation = 64096; |
260 | 267 | ||
261 | objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; | 268 | objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; |
@@ -323,7 +330,7 @@ namespace OpenSim.world | |||
323 | { | 330 | { |
324 | //need to clean this up as it shares a lot of code with CreateFromPacket() | 331 | //need to clean this up as it shares a lot of code with CreateFromPacket() |
325 | ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); | 332 | ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); |
326 | objupdate.RegionData.RegionHandle = OpenSimRoot.Instance.Cfg.RegionHandle; | 333 | objupdate.RegionData.RegionHandle = m_regionHandle; |
327 | objupdate.RegionData.TimeDilation = 64096; | 334 | objupdate.RegionData.TimeDilation = 64096; |
328 | objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; | 335 | objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; |
329 | 336 | ||
@@ -480,7 +487,7 @@ namespace OpenSim.world | |||
480 | this.primData.LocalID = this.localid; | 487 | this.primData.LocalID = this.localid; |
481 | this.primData.Position = this.position; | 488 | this.primData.Position = this.position; |
482 | this.primData.Rotation = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z, this.rotation.w); | 489 | this.primData.Rotation = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z, this.rotation.w); |
483 | OpenSimRoot.Instance.LocalWorld.localStorage.StorePrim(this.primData); | 490 | m_world.localStorage.StorePrim(this.primData); |
484 | } | 491 | } |
485 | } | 492 | } |
486 | 493 | ||