aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
authordan miller2007-10-30 23:38:56 +0000
committerdan miller2007-10-30 23:38:56 +0000
commitf5195a453c265891858fbdcbed02dd768e7cb80f (patch)
tree5c97b620135b9e659d6205ffcb839056ab3851fd /OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
parentStep one on the long march towards grid based inventory. Introduction of an I... (diff)
downloadopensim-SC_OLD-f5195a453c265891858fbdcbed02dd768e7cb80f.zip
opensim-SC_OLD-f5195a453c265891858fbdcbed02dd768e7cb80f.tar.gz
opensim-SC_OLD-f5195a453c265891858fbdcbed02dd768e7cb80f.tar.bz2
opensim-SC_OLD-f5195a453c265891858fbdcbed02dd768e7cb80f.tar.xz
Tevarus' patch for object flags & implemented Phantom edits
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs106
1 files changed, 102 insertions, 4 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 387f573..f0d6916 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -308,9 +308,9 @@ namespace OpenSim.Region.Environment.Scenes
308 m_flags = 0; 308 m_flags = 0;
309 m_flags |= LLObject.ObjectFlags.ObjectModify | 309 m_flags |= LLObject.ObjectFlags.ObjectModify |
310 LLObject.ObjectFlags.ObjectCopy | 310 LLObject.ObjectFlags.ObjectCopy |
311 LLObject.ObjectFlags.ObjectYouOwner | 311 LLObject.ObjectFlags.ObjectYouOwner |
312 LLObject.ObjectFlags.Touch | 312 LLObject.ObjectFlags.Touch |
313 LLObject.ObjectFlags.ObjectMove | 313 LLObject.ObjectFlags.ObjectMove |
314 LLObject.ObjectFlags.AllowInventoryDrop | 314 LLObject.ObjectFlags.AllowInventoryDrop |
315 LLObject.ObjectFlags.ObjectTransfer | 315 LLObject.ObjectFlags.ObjectTransfer |
316 LLObject.ObjectFlags.ObjectOwnerModify; 316 LLObject.ObjectFlags.ObjectOwnerModify;
@@ -441,6 +441,30 @@ namespace OpenSim.Region.Environment.Scenes
441 TimeStampFull = (uint) Util.UnixTimeSinceEpoch(); 441 TimeStampFull = (uint) Util.UnixTimeSinceEpoch();
442 m_updateFlag = 2; 442 m_updateFlag = 2;
443 } 443 }
444 public void AddFlag(LLObject.ObjectFlags flag)
445 {
446 LLObject.ObjectFlags prevflag = m_flags;
447 //uint objflags = m_flags;
448 if ((this.ObjectFlags & (uint)flag) == 0)
449 {
450 //Console.WriteLine("Adding flag: " + ((LLObject.ObjectFlags) flag).ToString());
451 m_flags |= flag;
452 }
453 uint currflag = (uint)m_flags;
454 //System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + m_flags.ToString());
455 //ScheduleFullUpdate();
456 }
457 public void RemFlag(LLObject.ObjectFlags flag)
458 {
459 LLObject.ObjectFlags prevflag = m_flags;
460 if ((this.ObjectFlags & (uint) flag) != 0)
461 {
462 //Console.WriteLine("Removing flag: " + ((LLObject.ObjectFlags)flag).ToString());
463 m_flags &= ~flag;
464 }
465 //System.Console.WriteLine("prev: " + prevflag.ToString() + " curr: " + m_flags.ToString());
466 //ScheduleFullUpdate();
467 }
444 468
445 /// <summary> 469 /// <summary>
446 /// 470 ///
@@ -610,6 +634,80 @@ namespace OpenSim.Region.Environment.Scenes
610 #endregion 634 #endregion
611 635
612 #region ExtraParams 636 #region ExtraParams
637 public void UpdatePrimFlags(ushort type, bool inUse, byte[] data)
638 {
639 bool hasPrim = false;
640 bool UsePhysics = false;
641 bool IsTemporary = false;
642 bool IsPhantom = false;
643 bool CastsShadows = false;
644 //bool IsLocked = false;
645 int i = 0;
646
647
648 try
649 {
650 i += 46;
651 //IsLocked = (data[i++] != 0) ? true : false;
652 UsePhysics = (data[i++] != 0) ? true : false;
653 //System.Console.WriteLine("U" + packet.ToBytes().Length.ToString());
654 IsTemporary = (data[i++] != 0) ? true : false;
655 IsPhantom = (data[i++] != 0) ? true : false;
656 CastsShadows = (data[i++] != 0) ? true : false;
657 }
658 catch (System.Exception e)
659 {
660 System.Console.WriteLine("Ignoring invalid Packet:");
661 //Silently ignore it - TODO: FIXME Quick
662 }
663
664 if (IsPhantom)
665 {
666 AddFlag(LLObject.ObjectFlags.Phantom);
667 if(this.PhysActor != null) {
668 this.m_parentGroup.m_scene.PhysScene.RemovePrim(this.PhysActor); /// that's not wholesome. Had to make m_scene public
669 this.PhysActor = null;
670 }
671 }
672 else
673 {
674 RemFlag(LLObject.ObjectFlags.Phantom);
675 if (this.PhysActor == null)
676 {
677 this.PhysActor = this.m_parentGroup.m_scene.PhysScene.AddPrimShape(
678 this.Name,
679 this.Shape,
680 new PhysicsVector(this.AbsolutePosition.X, this.AbsolutePosition.Y,
681 this.AbsolutePosition.Z),
682 new PhysicsVector(this.Scale.X, this.Scale.Y, this.Scale.Z),
683 new Quaternion(this.RotationOffset.W, this.RotationOffset.X,
684 this.RotationOffset.Y, this.RotationOffset.Z));
685 }
686 }
687
688 if (UsePhysics)
689 {
690 AddFlag(LLObject.ObjectFlags.Physics);
691
692 }
693 else
694 {
695 RemFlag(LLObject.ObjectFlags.Physics);
696 }
697 if (IsTemporary)
698 {
699 AddFlag(LLObject.ObjectFlags.TemporaryOnRez);
700 }
701 else
702 {
703 RemFlag(LLObject.ObjectFlags.TemporaryOnRez);
704 }
705// System.Console.WriteLine("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString());
706 ScheduleFullUpdate();
707
708
709
710 }
613 711
614 public void UpdateExtraParam(ushort type, bool inUse, byte[] data) 712 public void UpdateExtraParam(ushort type, bool inUse, byte[] data)
615 { 713 {
@@ -922,4 +1020,4 @@ namespace OpenSim.Region.Environment.Scenes
922 } 1020 }
923 } 1021 }
924 } 1022 }
925} \ No newline at end of file 1023}