aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
authorlbsa712007-11-01 19:19:05 +0000
committerlbsa712007-11-01 19:19:05 +0000
commit4fad66f855544b9298ae2216c58c0f44009358a5 (patch)
tree07747305928e0072230b31c399d8a7e76442b77f /OpenSim/Region/Environment/Scenes
parentPartialy fixed a bug with collisions in BulletXPlugin. (diff)
downloadopensim-SC-4fad66f855544b9298ae2216c58c0f44009358a5.zip
opensim-SC-4fad66f855544b9298ae2216c58c0f44009358a5.tar.gz
opensim-SC-4fad66f855544b9298ae2216c58c0f44009358a5.tar.bz2
opensim-SC-4fad66f855544b9298ae2216c58c0f44009358a5.tar.xz
* Diuerse beavtificatems
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs8
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs8
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs102
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs28
5 files changed, 77 insertions, 71 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index 73954d0..73d317a 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -332,16 +332,14 @@ namespace OpenSim.Region.Environment.Scenes
332 { 332 {
333 if (ent is SceneObjectGroup) 333 if (ent is SceneObjectGroup)
334 { 334 {
335 hasprim = ((SceneObjectGroup)ent).HasChildPrim(localID); 335 hasprim = ((SceneObjectGroup) ent).HasChildPrim(localID);
336 if (hasprim != false) 336 if (hasprim != false)
337 { 337 {
338 338 ((SceneObjectGroup) ent).UpdatePrimFlags(localID, (ushort) packet.Type, true, packet.ToBytes());
339 ((SceneObjectGroup)ent).UpdatePrimFlags(localID, (ushort)packet.Type, true, packet.ToBytes());
340
341 } 339 }
342 } 340 }
343 } 341 }
344 342
345 //System.Console.WriteLine("Got primupdate packet: " + packet.UsePhysics.ToString()); 343 //System.Console.WriteLine("Got primupdate packet: " + packet.UsePhysics.ToString());
346 } 344 }
347 345
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 8da22c4..d02f3e3 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1565,4 +1565,4 @@ namespace OpenSim.Region.Environment.Scenes
1565 } 1565 }
1566 } 1566 }
1567 } 1567 }
1568} 1568} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index aaa25e7..2f746b2 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -341,8 +341,9 @@ namespace OpenSim.Region.Environment.Scenes
341 /// 341 ///
342 /// </summary> 342 /// </summary>
343 public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos, 343 public SceneObjectGroup(Scene scene, ulong regionHandle, LLUUID ownerID, uint localID, LLVector3 pos,
344 PrimitiveBaseShape shape):this(scene, regionHandle, ownerID, localID, pos, LLQuaternion.Identity, shape) 344 PrimitiveBaseShape shape)
345 { 345 : this(scene, regionHandle, ownerID, localID, pos, LLQuaternion.Identity, shape)
346 {
346 } 347 }
347 348
348 #endregion 349 #endregion
@@ -927,6 +928,7 @@ namespace OpenSim.Region.Environment.Scenes
927 part.UpdatePrimFlags(type, inUse, data); 928 part.UpdatePrimFlags(type, inUse, data);
928 } 929 }
929 } 930 }
931
930 public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data) 932 public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data)
931 { 933 {
932 SceneObjectPart part = GetChildPart(localID); 934 SceneObjectPart part = GetChildPart(localID);
@@ -1394,4 +1396,4 @@ namespace OpenSim.Region.Environment.Scenes
1394 Text = text; 1396 Text = text;
1395 } 1397 }
1396 } 1398 }
1397} 1399} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index dacac4b..38eaf90 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -272,9 +272,10 @@ namespace OpenSim.Region.Environment.Scenes
272 } 272 }
273 273
274 public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, 274 public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID,
275 PrimitiveBaseShape shape, LLVector3 groupPosition, LLVector3 offsetPosition):this(regionHandle, parent, ownerID, localID, shape, groupPosition, LLQuaternion.Identity, offsetPosition) 275 PrimitiveBaseShape shape, LLVector3 groupPosition, LLVector3 offsetPosition)
276 { 276 : this(regionHandle, parent, ownerID, localID, shape, groupPosition, LLQuaternion.Identity, offsetPosition)
277 } 277 {
278 }
278 279
279 /// <summary> 280 /// <summary>
280 /// Create a completely new SceneObjectPart (prim) 281 /// Create a completely new SceneObjectPart (prim)
@@ -286,7 +287,8 @@ namespace OpenSim.Region.Environment.Scenes
286 /// <param name="shape"></param> 287 /// <param name="shape"></param>
287 /// <param name="position"></param> 288 /// <param name="position"></param>
288 public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID, 289 public SceneObjectPart(ulong regionHandle, SceneObjectGroup parent, LLUUID ownerID, uint localID,
289 PrimitiveBaseShape shape, LLVector3 groupPosition, LLQuaternion rotationOffset, LLVector3 offsetPosition) 290 PrimitiveBaseShape shape, LLVector3 groupPosition, LLQuaternion rotationOffset,
291 LLVector3 offsetPosition)
290 { 292 {
291 m_name = "Primitive"; 293 m_name = "Primitive";
292 m_regionHandle = regionHandle; 294 m_regionHandle = regionHandle;
@@ -313,12 +315,12 @@ namespace OpenSim.Region.Environment.Scenes
313 m_flags = 0; 315 m_flags = 0;
314 m_flags |= LLObject.ObjectFlags.ObjectModify | 316 m_flags |= LLObject.ObjectFlags.ObjectModify |
315 LLObject.ObjectFlags.ObjectCopy | 317 LLObject.ObjectFlags.ObjectCopy |
316 LLObject.ObjectFlags.ObjectYouOwner | 318 LLObject.ObjectFlags.ObjectYouOwner |
317 LLObject.ObjectFlags.Touch | 319 LLObject.ObjectFlags.Touch |
318 LLObject.ObjectFlags.ObjectMove | 320 LLObject.ObjectFlags.ObjectMove |
319 LLObject.ObjectFlags.AllowInventoryDrop | 321 LLObject.ObjectFlags.AllowInventoryDrop |
320 LLObject.ObjectFlags.ObjectTransfer | 322 LLObject.ObjectFlags.ObjectTransfer |
321 LLObject.ObjectFlags.CreateSelected | 323 LLObject.ObjectFlags.CreateSelected |
322 LLObject.ObjectFlags.ObjectOwnerModify; 324 LLObject.ObjectFlags.ObjectOwnerModify;
323 325
324 ScheduleFullUpdate(); 326 ScheduleFullUpdate();
@@ -447,23 +449,25 @@ namespace OpenSim.Region.Environment.Scenes
447 TimeStampFull = (uint) Util.UnixTimeSinceEpoch(); 449 TimeStampFull = (uint) Util.UnixTimeSinceEpoch();
448 m_updateFlag = 2; 450 m_updateFlag = 2;
449 } 451 }
452
450 public void AddFlag(LLObject.ObjectFlags flag) 453 public void AddFlag(LLObject.ObjectFlags flag)
451 { 454 {
452 LLObject.ObjectFlags prevflag = m_flags; 455 LLObject.ObjectFlags prevflag = m_flags;
453 //uint objflags = m_flags; 456 //uint objflags = m_flags;
454 if ((this.ObjectFlags & (uint)flag) == 0) 457 if ((ObjectFlags & (uint) flag) == 0)
455 { 458 {
456 //Console.WriteLine("Adding flag: " + ((LLObject.ObjectFlags) flag).ToString()); 459 //Console.WriteLine("Adding flag: " + ((LLObject.ObjectFlags) flag).ToString());
457 m_flags |= flag; 460 m_flags |= flag;
458 } 461 }
459 uint currflag = (uint)m_flags; 462 uint currflag = (uint) m_flags;
460 //System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + m_flags.ToString()); 463 //System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + m_flags.ToString());
461 //ScheduleFullUpdate(); 464 //ScheduleFullUpdate();
462 } 465 }
466
463 public void RemFlag(LLObject.ObjectFlags flag) 467 public void RemFlag(LLObject.ObjectFlags flag)
464 { 468 {
465 LLObject.ObjectFlags prevflag = m_flags; 469 LLObject.ObjectFlags prevflag = m_flags;
466 if ((this.ObjectFlags & (uint) flag) != 0) 470 if ((ObjectFlags & (uint) flag) != 0)
467 { 471 {
468 //Console.WriteLine("Removing flag: " + ((LLObject.ObjectFlags)flag).ToString()); 472 //Console.WriteLine("Removing flag: " + ((LLObject.ObjectFlags)flag).ToString());
469 m_flags &= ~flag; 473 m_flags &= ~flag;
@@ -640,6 +644,7 @@ namespace OpenSim.Region.Environment.Scenes
640 #endregion 644 #endregion
641 645
642 #region ExtraParams 646 #region ExtraParams
647
643 public void UpdatePrimFlags(ushort type, bool inUse, byte[] data) 648 public void UpdatePrimFlags(ushort type, bool inUse, byte[] data)
644 { 649 {
645 bool hasPrim = false; 650 bool hasPrim = false;
@@ -649,8 +654,8 @@ namespace OpenSim.Region.Environment.Scenes
649 bool CastsShadows = false; 654 bool CastsShadows = false;
650 //bool IsLocked = false; 655 //bool IsLocked = false;
651 int i = 0; 656 int i = 0;
652 657
653 658
654 try 659 try
655 { 660 {
656 i += 46; 661 i += 46;
@@ -661,40 +666,41 @@ namespace OpenSim.Region.Environment.Scenes
661 IsPhantom = (data[i++] != 0) ? true : false; 666 IsPhantom = (data[i++] != 0) ? true : false;
662 CastsShadows = (data[i++] != 0) ? true : false; 667 CastsShadows = (data[i++] != 0) ? true : false;
663 } 668 }
664 catch (System.Exception e) 669 catch (Exception e)
665 { 670 {
666 System.Console.WriteLine("Ignoring invalid Packet:"); 671 Console.WriteLine("Ignoring invalid Packet:");
667 //Silently ignore it - TODO: FIXME Quick 672 //Silently ignore it - TODO: FIXME Quick
668 } 673 }
669 674
670 if (IsPhantom) 675 if (IsPhantom)
671 { 676 {
672 AddFlag(LLObject.ObjectFlags.Phantom); 677 AddFlag(LLObject.ObjectFlags.Phantom);
673 if(this.PhysActor != null) { 678 if (PhysActor != null)
674 this.m_parentGroup.m_scene.PhysScene.RemovePrim(this.PhysActor); /// that's not wholesome. Had to make m_scene public 679 {
675 this.PhysActor = null; 680 m_parentGroup.m_scene.PhysScene.RemovePrim(PhysActor);
681 /// that's not wholesome. Had to make m_scene public
682 PhysActor = null;
676 } 683 }
677 } 684 }
678 else 685 else
679 { 686 {
680 RemFlag(LLObject.ObjectFlags.Phantom); 687 RemFlag(LLObject.ObjectFlags.Phantom);
681 if (this.PhysActor == null) 688 if (PhysActor == null)
682 { 689 {
683 this.PhysActor = this.m_parentGroup.m_scene.PhysScene.AddPrimShape( 690 PhysActor = m_parentGroup.m_scene.PhysScene.AddPrimShape(
684 this.Name, 691 Name,
685 this.Shape, 692 Shape,
686 new PhysicsVector(this.AbsolutePosition.X, this.AbsolutePosition.Y, 693 new PhysicsVector(AbsolutePosition.X, AbsolutePosition.Y,
687 this.AbsolutePosition.Z), 694 AbsolutePosition.Z),
688 new PhysicsVector(this.Scale.X, this.Scale.Y, this.Scale.Z), 695 new PhysicsVector(Scale.X, Scale.Y, Scale.Z),
689 new Quaternion(this.RotationOffset.W, this.RotationOffset.X, 696 new Quaternion(RotationOffset.W, RotationOffset.X,
690 this.RotationOffset.Y, this.RotationOffset.Z)); 697 RotationOffset.Y, RotationOffset.Z));
691 } 698 }
692 } 699 }
693 700
694 if (UsePhysics) 701 if (UsePhysics)
695 { 702 {
696 AddFlag(LLObject.ObjectFlags.Physics); 703 AddFlag(LLObject.ObjectFlags.Physics);
697
698 } 704 }
699 else 705 else
700 { 706 {
@@ -710,9 +716,6 @@ namespace OpenSim.Region.Environment.Scenes
710 } 716 }
711// System.Console.WriteLine("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString()); 717// System.Console.WriteLine("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString());
712 ScheduleFullUpdate(); 718 ScheduleFullUpdate();
713
714
715
716 } 719 }
717 720
718 public void UpdateExtraParam(ushort type, bool inUse, byte[] data) 721 public void UpdateExtraParam(ushort type, bool inUse, byte[] data)
@@ -861,22 +864,21 @@ namespace OpenSim.Region.Environment.Scenes
861 { 864 {
862 LLQuaternion lRot; 865 LLQuaternion lRot;
863 lRot = RotationOffset; 866 lRot = RotationOffset;
864 uint clientFlags = ObjectFlags & ~(uint)LLObject.ObjectFlags.CreateSelected; 867 uint clientFlags = ObjectFlags & ~(uint) LLObject.ObjectFlags.CreateSelected;
865 868
866 List<ScenePresence> avatars=m_parentGroup.GetScenePresences(); 869 List<ScenePresence> avatars = m_parentGroup.GetScenePresences();
867 foreach(ScenePresence s in avatars) 870 foreach (ScenePresence s in avatars)
868 { 871 {
869 if(s.m_uuid == OwnerID) 872 if (s.m_uuid == OwnerID)
870 { 873 {
871 if(s.ControllingClient == remoteClient) 874 if (s.ControllingClient == remoteClient)
872 { 875 {
873 clientFlags = ObjectFlags; 876 clientFlags = ObjectFlags;
874 m_flags &= ~LLObject.ObjectFlags.CreateSelected; 877 m_flags &= ~LLObject.ObjectFlags.CreateSelected;
875 878 }
876 } 879 break;
877 break; 880 }
878 } 881 }
879 }
880 882
881 remoteClient.SendPrimitiveToClient(m_regionHandle, 64096, LocalID, m_shape, lPos, clientFlags, m_uuid, 883 remoteClient.SendPrimitiveToClient(m_regionHandle, 64096, LocalID, m_shape, lPos, clientFlags, m_uuid,
882 OwnerID, 884 OwnerID,
@@ -1042,4 +1044,4 @@ namespace OpenSim.Region.Environment.Scenes
1042 } 1044 }
1043 } 1045 }
1044 } 1046 }
1045} 1047} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 763be03..f2d0219 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -455,7 +455,7 @@ namespace OpenSim.Region.Environment.Scenes
455 455
456 // Must check for standing up even when PhysicsActor is null, 456 // Must check for standing up even when PhysicsActor is null,
457 // since sitting currently removes avatar from physical scene 457 // since sitting currently removes avatar from physical scene
458 if ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) 458 if ((flags & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_STAND_UP) != 0)
459 { 459 {
460 StandUp(); 460 StandUp();
461 UpdateMovementAnimations(true); 461 UpdateMovementAnimations(true);
@@ -526,7 +526,8 @@ namespace OpenSim.Region.Environment.Scenes
526 SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID); 526 SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID);
527 LLVector3 pos = new LLVector3(); 527 LLVector3 pos = new LLVector3();
528 if (part != null) 528 if (part != null)
529 pos = part.AbsolutePosition + m_requestedSitOffset + new LLVector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight); 529 pos = part.AbsolutePosition + m_requestedSitOffset +
530 new LLVector3(0.0f, 0.0f, 2.0f*m_sitAvatarHeight);
530 MakeRootAgent(pos, false); 531 MakeRootAgent(pos, false);
531 m_parentID = 0; 532 m_parentID = 0;
532 SendFullUpdateToAllClients(); 533 SendFullUpdateToAllClients();
@@ -569,7 +570,7 @@ namespace OpenSim.Region.Environment.Scenes
569 570
570 remoteClient.OutPacket(avatarSitResponse); 571 remoteClient.OutPacket(avatarSitResponse);
571 } 572 }
572 573
573 public void HandleAgentRequestSit(IClientAPI remoteClient, LLUUID agentID, LLUUID targetID, LLVector3 offset) 574 public void HandleAgentRequestSit(IClientAPI remoteClient, LLUUID agentID, LLUUID targetID, LLVector3 offset)
574 { 575 {
575 SendSitResponse(remoteClient, targetID, offset); 576 SendSitResponse(remoteClient, targetID, offset);
@@ -597,7 +598,8 @@ namespace OpenSim.Region.Environment.Scenes
597 { 598 {
598 // these magic numbers come mostly from experimenting with ODE, 599 // these magic numbers come mostly from experimenting with ODE,
599 // and seeing what looks right 600 // and seeing what looks right
600 AbsolutePosition = m_requestedSitOffset + new LLVector3(m_physicsActor.Size.X / 2.7f, 0f, m_physicsActor.Size.Z / 1.45f); 601 AbsolutePosition = m_requestedSitOffset +
602 new LLVector3(m_physicsActor.Size.X/2.7f, 0f, m_physicsActor.Size.Z/1.45f);
601 m_parentID = m_requestedSitTargetID; 603 m_parentID = m_requestedSitTargetID;
602 MakeChildAgent(); 604 MakeChildAgent();
603 SendAnimPack(Animations.AnimsLLUUID["SIT"], 1); 605 SendAnimPack(Animations.AnimsLLUUID["SIT"], 1);
@@ -616,20 +618,21 @@ namespace OpenSim.Region.Environment.Scenes
616 } 618 }
617 else 619 else
618 { 620 {
619 if (((m_movementflag & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && PhysicsActor.IsColliding) 621 if (((m_movementflag & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) &&
622 PhysicsActor.IsColliding)
620 { 623 {
621 SendAnimPack(Animations.AnimsLLUUID["CROUCHWALK"], 1); 624 SendAnimPack(Animations.AnimsLLUUID["CROUCHWALK"], 1);
622 } 625 }
623 else 626 else
624 { 627 {
625 SendAnimPack(Animations.AnimsLLUUID["WALK"], 1); 628 SendAnimPack(Animations.AnimsLLUUID["WALK"], 1);
626 } 629 }
627
628 } 630 }
629 } 631 }
630 else 632 else
631 { 633 {
632 if (((m_movementflag & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && PhysicsActor.IsColliding) 634 if (((m_movementflag & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) &&
635 PhysicsActor.IsColliding)
633 { 636 {
634 SendAnimPack(Animations.AnimsLLUUID["CROUCH"], 1); 637 SendAnimPack(Animations.AnimsLLUUID["CROUCH"], 1);
635 } 638 }
@@ -656,7 +659,9 @@ namespace OpenSim.Region.Environment.Scenes
656 659
657 direc = direc*((0.03f)*128f); 660 direc = direc*((0.03f)*128f);
658 if (m_physicsActor.Flying) 661 if (m_physicsActor.Flying)
659 { direc *= 4; } 662 {
663 direc *= 4;
664 }
660 else 665 else
661 { 666 {
662 if (!m_physicsActor.Flying && m_physicsActor.IsColliding) 667 if (!m_physicsActor.Flying && m_physicsActor.IsColliding)
@@ -668,7 +673,6 @@ namespace OpenSim.Region.Environment.Scenes
668 //System.Console.WriteLine("Jump"); 673 //System.Console.WriteLine("Jump");
669 SendAnimPack(Animations.AnimsLLUUID["PRE_JUMP"], 1); 674 SendAnimPack(Animations.AnimsLLUUID["PRE_JUMP"], 1);
670 } 675 }
671
672 } 676 }
673 } 677 }
674 678
@@ -1093,4 +1097,4 @@ namespace OpenSim.Region.Environment.Scenes
1093 m_controllingClient.SendWearables(m_wearables, m_wearablesSerial++); 1097 m_controllingClient.SendWearables(m_wearables, m_wearablesSerial++);
1094 } 1098 }
1095 } 1099 }
1096} 1100} \ No newline at end of file