aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs85
-rw-r--r--OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs40
2 files changed, 124 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs
index e43329d..8fd8e52 100644
--- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs
+++ b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectGroup2.cs
@@ -18,6 +18,9 @@ namespace OpenSim.Region.Environment.Scenes
18 protected AllNewSceneObjectPart2 m_rootPart; 18 protected AllNewSceneObjectPart2 m_rootPart;
19 protected Dictionary<LLUUID, AllNewSceneObjectPart2> m_parts = new Dictionary<LLUUID, AllNewSceneObjectPart2>(); 19 protected Dictionary<LLUUID, AllNewSceneObjectPart2> m_parts = new Dictionary<LLUUID, AllNewSceneObjectPart2>();
20 20
21 protected ulong m_regionHandle;
22 protected Scene m_scene;
23
21 public event PrimCountTaintedDelegate OnPrimCountTainted; 24 public event PrimCountTaintedDelegate OnPrimCountTainted;
22 25
23 /// <summary> 26 /// <summary>
@@ -45,9 +48,14 @@ namespace OpenSim.Region.Environment.Scenes
45 /// <summary> 48 /// <summary>
46 /// 49 ///
47 /// </summary> 50 /// </summary>
48 public AllNewSceneObjectGroup2() 51 public AllNewSceneObjectGroup2(Scene world, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
49 { 52 {
53 m_regionHandle = regionHandle;
54 m_scene = world;
50 55
56 this.Pos = pos;
57 this.m_rootPart = new AllNewSceneObjectPart2(m_regionHandle, this, ownerID, localID, shape, pos);
58 this.m_parts.Add(this.m_rootPart.UUID, this.m_rootPart);
51 } 59 }
52 60
53 /// <summary> 61 /// <summary>
@@ -142,6 +150,9 @@ namespace OpenSim.Region.Environment.Scenes
142 return false; 150 return false;
143 } 151 }
144 152
153 /// <summary>
154 ///
155 /// </summary>
145 public void TriggerTainted() 156 public void TriggerTainted()
146 { 157 {
147 if (OnPrimCountTainted != null) 158 if (OnPrimCountTainted != null)
@@ -194,6 +205,50 @@ namespace OpenSim.Region.Environment.Scenes
194 client.OutPacket(proper); 205 client.OutPacket(proper);
195 } 206 }
196 207
208 /// <summary>
209 ///
210 /// </summary>
211 /// <param name="remoteClient"></param>
212 /// <param name="localID"></param>
213 public void GetInventory(IClientAPI remoteClient, uint localID)
214 {
215 AllNewSceneObjectPart2 part = this.GetChildPrim(localID);
216 if (part != null)
217 {
218 part.GetInventory(remoteClient, localID);
219 }
220 }
221
222 /// <summary>
223 ///
224 /// </summary>
225 /// <param name="localID"></param>
226 /// <param name="type"></param>
227 /// <param name="inUse"></param>
228 /// <param name="data"></param>
229 public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data)
230 {
231 AllNewSceneObjectPart2 part = this.GetChildPrim(localID);
232 if (part != null)
233 {
234 part.UpdateExtraParam(type, inUse, data);
235 }
236 }
237
238 /// <summary>
239 ///
240 /// </summary>
241 /// <param name="localID"></param>
242 /// <param name="textureEntry"></param>
243 public void UpdateTextureEntry(uint localID, byte[] textureEntry)
244 {
245 AllNewSceneObjectPart2 part = this.GetChildPrim(localID);
246 if (part != null)
247 {
248 part.UpdateTextureEntry(textureEntry);
249 }
250 }
251
197 #region Shape 252 #region Shape
198 /// <summary> 253 /// <summary>
199 /// 254 ///
@@ -210,11 +265,20 @@ namespace OpenSim.Region.Environment.Scenes
210 #endregion 265 #endregion
211 266
212 #region Position 267 #region Position
268 /// <summary>
269 ///
270 /// </summary>
271 /// <param name="pos"></param>
213 public void UpdateGroupPosition(LLVector3 pos) 272 public void UpdateGroupPosition(LLVector3 pos)
214 { 273 {
215 this.m_pos = pos; 274 this.m_pos = pos;
216 } 275 }
217 276
277 /// <summary>
278 ///
279 /// </summary>
280 /// <param name="pos"></param>
281 /// <param name="localID"></param>
218 public void UpdateSinglePosition(LLVector3 pos, uint localID) 282 public void UpdateSinglePosition(LLVector3 pos, uint localID)
219 { 283 {
220 AllNewSceneObjectPart2 part = this.GetChildPrim(localID); 284 AllNewSceneObjectPart2 part = this.GetChildPrim(localID);
@@ -231,6 +295,10 @@ namespace OpenSim.Region.Environment.Scenes
231 } 295 }
232 } 296 }
233 297
298 /// <summary>
299 ///
300 /// </summary>
301 /// <param name="pos"></param>
234 private void UpdateRootPosition(LLVector3 pos) 302 private void UpdateRootPosition(LLVector3 pos)
235 { 303 {
236 LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z); 304 LLVector3 newPos = new LLVector3(pos.X, pos.Y, pos.Z);
@@ -258,6 +326,10 @@ namespace OpenSim.Region.Environment.Scenes
258 #endregion 326 #endregion
259 327
260 #region Roation 328 #region Roation
329 /// <summary>
330 ///
331 /// </summary>
332 /// <param name="rot"></param>
261 public void UpdateGroupRotation(LLQuaternion rot) 333 public void UpdateGroupRotation(LLQuaternion rot)
262 { 334 {
263 this.m_rootPart.UpdateRotation(rot); 335 this.m_rootPart.UpdateRotation(rot);
@@ -274,6 +346,11 @@ namespace OpenSim.Region.Environment.Scenes
274 this.m_pos = pos; 346 this.m_pos = pos;
275 } 347 }
276 348
349 /// <summary>
350 ///
351 /// </summary>
352 /// <param name="rot"></param>
353 /// <param name="localID"></param>
277 public void UpdateSingleRotation(LLQuaternion rot, uint localID) 354 public void UpdateSingleRotation(LLQuaternion rot, uint localID)
278 { 355 {
279 AllNewSceneObjectPart2 part = this.GetChildPrim(localID); 356 AllNewSceneObjectPart2 part = this.GetChildPrim(localID);
@@ -289,6 +366,11 @@ namespace OpenSim.Region.Environment.Scenes
289 } 366 }
290 } 367 }
291 } 368 }
369
370 /// <summary>
371 ///
372 /// </summary>
373 /// <param name="rot"></param>
292 private void UpdateRootRotation(LLQuaternion rot) 374 private void UpdateRootRotation(LLQuaternion rot)
293 { 375 {
294 this.m_rootPart.UpdateRotation(rot); 376 this.m_rootPart.UpdateRotation(rot);
@@ -310,6 +392,7 @@ namespace OpenSim.Region.Environment.Scenes
310 } 392 }
311 } 393 }
312 } 394 }
395
313 #endregion 396 #endregion
314 /// <summary> 397 /// <summary>
315 /// 398 ///
diff --git a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs
index c4b4b43..62f9b93 100644
--- a/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs
+++ b/OpenSim/Region/Environment/Scenes/AllNewSceneObjectPart2.cs
@@ -252,6 +252,15 @@ namespace OpenSim.Region.Environment.Scenes
252 #endregion 252 #endregion
253 253
254 #region Constructors 254 #region Constructors
255 /// <summary>
256 /// Create a completely new SceneObjectPart (prim)
257 /// </summary>
258 /// <param name="regionHandle"></param>
259 /// <param name="parent"></param>
260 /// <param name="ownerID"></param>
261 /// <param name="localID"></param>
262 /// <param name="shape"></param>
263 /// <param name="position"></param>
255 public AllNewSceneObjectPart2(ulong regionHandle, AllNewSceneObjectGroup2 parent, LLUUID ownerID, uint localID, PrimitiveBaseShape shape, LLVector3 position) 264 public AllNewSceneObjectPart2(ulong regionHandle, AllNewSceneObjectGroup2 parent, LLUUID ownerID, uint localID, PrimitiveBaseShape shape, LLVector3 position)
256 { 265 {
257 this.m_regionHandle = regionHandle; 266 this.m_regionHandle = regionHandle;
@@ -266,6 +275,10 @@ namespace OpenSim.Region.Environment.Scenes
266 this.m_Shape = shape; 275 this.m_Shape = shape;
267 276
268 this.OffsetPosition = position; 277 this.OffsetPosition = position;
278 this.RotationOffset = LLQuaternion.Identity;
279 this.Velocity = new LLVector3(0, 0, 0);
280 this.AngularVelocity = new LLVector3(0, 0, 0);
281 this.Acceleration = new LLVector3(0, 0, 0);
269 282
270 //temporary code just so the m_flags field doesn't give a compiler warning 283 //temporary code just so the m_flags field doesn't give a compiler warning
271 if (m_flags ==LLObject.ObjectFlags.AllowInventoryDrop) 284 if (m_flags ==LLObject.ObjectFlags.AllowInventoryDrop)
@@ -273,6 +286,33 @@ namespace OpenSim.Region.Environment.Scenes
273 286
274 } 287 }
275 } 288 }
289
290 /// <summary>
291 /// Recreate a SceneObjectPart (prim)
292 /// </summary>
293 /// <param name="regionHandle"></param>
294 /// <param name="parent"></param>
295 /// <param name="ownerID"></param>
296 /// <param name="localID"></param>
297 /// <param name="shape"></param>
298 /// <param name="position"></param>
299 public AllNewSceneObjectPart2(ulong regionHandle, AllNewSceneObjectGroup2 parent, int creationDate, LLUUID ownerID, LLUUID creatorID, LLUUID lastOwnerID, uint localID, PrimitiveBaseShape shape, LLVector3 position, LLQuaternion rotation, uint flags)
300 {
301 this.m_regionHandle = regionHandle;
302 this.m_parentGroup = parent;
303
304 this.CreationDate = creationDate;
305 this.OwnerID = ownerID;
306 this.CreatorID = creatorID;
307 this.LastOwnerID = lastOwnerID;
308 this.UUID = LLUUID.Random();
309 this.LocalID = (uint)(localID);
310 this.m_Shape = shape;
311
312 this.OffsetPosition = position;
313 this.RotationOffset = rotation;
314 this.ObjectFlags = flags;
315 }
276 #endregion 316 #endregion
277 317
278 #region Update Scheduling 318 #region Update Scheduling