diff options
author | Justin Clarke Casey | 2008-11-06 22:21:25 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-11-06 22:21:25 +0000 |
commit | 0d17ba2a76d4eb01f0bd6097c3974cd9d9fb2061 (patch) | |
tree | 82fc3cdd059f30d72407875a69ff662bb5747e41 /OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |
parent | add create_time and access_time to asset db for mysql, as well (diff) | |
download | opensim-SC_OLD-0d17ba2a76d4eb01f0bd6097c3974cd9d9fb2061.zip opensim-SC_OLD-0d17ba2a76d4eb01f0bd6097c3974cd9d9fb2061.tar.gz opensim-SC_OLD-0d17ba2a76d4eb01f0bd6097c3974cd9d9fb2061.tar.bz2 opensim-SC_OLD-0d17ba2a76d4eb01f0bd6097c3974cd9d9fb2061.tar.xz |
* refactor: Attach a scene object to a scene separately from its construction
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 51 |
1 files changed, 21 insertions, 30 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index be37352..9577bf6 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -216,9 +216,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
216 | Rezzed = DateTime.Now; | 216 | Rezzed = DateTime.Now; |
217 | } | 217 | } |
218 | 218 | ||
219 | public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, UUID ownerID, uint localID, | 219 | public SceneObjectPart(SceneObjectGroup parent, UUID ownerID, uint localID, |
220 | PrimitiveBaseShape shape, Vector3 groupPosition, Vector3 offsetPosition) | 220 | PrimitiveBaseShape shape, Vector3 groupPosition, Vector3 offsetPosition) |
221 | : this(regionHandle, parent, ownerID, localID, shape, groupPosition, Quaternion.Identity, offsetPosition) | 221 | : this(parent, ownerID, localID, shape, groupPosition, Quaternion.Identity, offsetPosition) |
222 | { | 222 | { |
223 | } | 223 | } |
224 | 224 | ||
@@ -231,12 +231,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
231 | /// <param name="localID"></param> | 231 | /// <param name="localID"></param> |
232 | /// <param name="shape"></param> | 232 | /// <param name="shape"></param> |
233 | /// <param name="position"></param> | 233 | /// <param name="position"></param> |
234 | public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, UUID ownerID, uint localID, | 234 | /// <param name="rotationOffset"></param> |
235 | /// <param name="offsetPosition"></param> | ||
236 | public SceneObjectPart(SceneObjectGroup parent, UUID ownerID, uint localID, | ||
235 | PrimitiveBaseShape shape, Vector3 groupPosition, Quaternion rotationOffset, | 237 | PrimitiveBaseShape shape, Vector3 groupPosition, Quaternion rotationOffset, |
236 | Vector3 offsetPosition) | 238 | Vector3 offsetPosition) |
237 | { | 239 | { |
238 | m_name = "Primitive"; | 240 | m_name = "Primitive"; |
239 | m_regionHandle = regionHandle; | ||
240 | m_parentGroup = parent; | 241 | m_parentGroup = parent; |
241 | 242 | ||
242 | Rezzed = DateTime.Now; | 243 | Rezzed = DateTime.Now; |
@@ -259,14 +260,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
259 | RotationOffset = rotationOffset; | 260 | RotationOffset = rotationOffset; |
260 | Velocity = new Vector3(0, 0, 0); | 261 | Velocity = new Vector3(0, 0, 0); |
261 | AngularVelocity = new Vector3(0, 0, 0); | 262 | AngularVelocity = new Vector3(0, 0, 0); |
262 | Acceleration = new Vector3(0, 0, 0); | 263 | Acceleration = new Vector3(0, 0, 0); |
263 | |||
264 | |||
265 | |||
266 | m_TextureAnimation = new byte[0]; | 264 | m_TextureAnimation = new byte[0]; |
267 | m_particleSystem = new byte[0]; | 265 | m_particleSystem = new byte[0]; |
268 | |||
269 | |||
270 | 266 | ||
271 | // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol, | 267 | // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol, |
272 | // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from | 268 | // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from |
@@ -277,8 +273,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
277 | 273 | ||
278 | TrimPermissions(); | 274 | TrimPermissions(); |
279 | //m_undo = new UndoStack<UndoState>(ParentGroup.GetSceneMaxUndo()); | 275 | //m_undo = new UndoStack<UndoState>(ParentGroup.GetSceneMaxUndo()); |
280 | |||
281 | ScheduleFullUpdate(); | ||
282 | } | 276 | } |
283 | 277 | ||
284 | /// <summary> | 278 | /// <summary> |
@@ -291,11 +285,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
291 | /// <param name="localID"></param> | 285 | /// <param name="localID"></param> |
292 | /// <param name="shape"></param> | 286 | /// <param name="shape"></param> |
293 | /// <param name="position"></param> | 287 | /// <param name="position"></param> |
294 | public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, int creationDate, UUID ownerID, | 288 | public SceneObjectPart(SceneObjectGroup parent, int creationDate, UUID ownerID, |
295 | UUID creatorID, UUID lastOwnerID, uint localID, PrimitiveBaseShape shape, | 289 | UUID creatorID, UUID lastOwnerID, uint localID, PrimitiveBaseShape shape, |
296 | Vector3 position, Quaternion rotation, uint flags) | 290 | Vector3 position, Quaternion rotation, uint flags) |
297 | { | 291 | { |
298 | m_regionHandle = regionHandle; | ||
299 | m_parentGroup = parent; | 292 | m_parentGroup = parent; |
300 | TimeStampTerse = (uint) Util.UnixTimeSinceEpoch(); | 293 | TimeStampTerse = (uint) Util.UnixTimeSinceEpoch(); |
301 | _creationDate = creationDate; | 294 | _creationDate = creationDate; |
@@ -324,8 +317,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
324 | 317 | ||
325 | TrimPermissions(); | 318 | TrimPermissions(); |
326 | // ApplyPhysics(); | 319 | // ApplyPhysics(); |
327 | |||
328 | ScheduleFullUpdate(); | ||
329 | } | 320 | } |
330 | 321 | ||
331 | protected SceneObjectPart(SerializationInfo info, StreamingContext context) | 322 | protected SceneObjectPart(SerializationInfo info, StreamingContext context) |
@@ -370,7 +361,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
370 | private DateTime m_expires; | 361 | private DateTime m_expires; |
371 | private DateTime m_rezzed; | 362 | private DateTime m_rezzed; |
372 | 363 | ||
373 | public UUID CreatorID { | 364 | public UUID CreatorID |
365 | { | ||
374 | get | 366 | get |
375 | { | 367 | { |
376 | return _creatorID; | 368 | return _creatorID; |
@@ -553,17 +545,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
553 | { | 545 | { |
554 | StoreUndoState(); | 546 | StoreUndoState(); |
555 | m_offsetPosition = value; | 547 | m_offsetPosition = value; |
556 | //try | ||
557 | //{ | ||
558 | // Hack to get the child prim to update world positions in the physics engine | ||
559 | // ParentGroup.ResetChildPrimPhysicsPositions(); | ||
560 | |||
561 | //} | ||
562 | //catch (NullReferenceException) | ||
563 | //{ | ||
564 | // Ignore, and skip over. | ||
565 | //} | ||
566 | //m_log.Info("[PART]: OFFSET:" + m_offsetPosition.ToString()); | ||
567 | 548 | ||
568 | if (ParentGroup != null && ParentGroup.RootPart != null) | 549 | if (ParentGroup != null && ParentGroup.RootPart != null) |
569 | { | 550 | { |
@@ -778,6 +759,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
778 | TriggerScriptChangedEvent(Changed.SHAPE); | 759 | TriggerScriptChangedEvent(Changed.SHAPE); |
779 | } | 760 | } |
780 | } | 761 | } |
762 | |||
781 | public Vector3 Scale | 763 | public Vector3 Scale |
782 | { | 764 | { |
783 | get { return m_shape.Scale; } | 765 | get { return m_shape.Scale; } |
@@ -813,7 +795,6 @@ if (m_shape != null) { | |||
813 | //--------------- | 795 | //--------------- |
814 | #region Public Properties with only Get | 796 | #region Public Properties with only Get |
815 | 797 | ||
816 | |||
817 | public Vector3 AbsolutePosition | 798 | public Vector3 AbsolutePosition |
818 | { | 799 | { |
819 | get { | 800 | get { |
@@ -3418,6 +3399,16 @@ if (m_shape != null) { | |||
3418 | } | 3399 | } |
3419 | 3400 | ||
3420 | #endregion Public Methods | 3401 | #endregion Public Methods |
3402 | |||
3403 | /// <summary> | ||
3404 | /// Attach this part to a scene such that it appears to avatars | ||
3405 | /// </summary> | ||
3406 | protected internal void AttachToScene(ulong regionHandle) | ||
3407 | { | ||
3408 | m_regionHandle = regionHandle; | ||
3409 | |||
3410 | ScheduleFullUpdate(); | ||
3411 | } | ||
3421 | 3412 | ||
3422 | private byte GetAttachPointEncoded() | 3413 | private byte GetAttachPointEncoded() |
3423 | { | 3414 | { |