aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorMelanie2012-06-28 22:06:02 +0200
committerMelanie2012-06-28 22:06:02 +0200
commit498820a74f6b288c26e2c33981297568c0c12d08 (patch)
treec87b1c20a3e3deeee56c33719ca8abed96499bdf /OpenSim/Region/Framework/Scenes
parentFix llRegionSayTo the right way (diff)
parent reactivate physics raycasts on llCastRay() until it's clear what is its prob... (diff)
downloadopensim-SC-498820a74f6b288c26e2c33981297568c0c12d08.zip
opensim-SC-498820a74f6b288c26e2c33981297568c0c12d08.tar.gz
opensim-SC-498820a74f6b288c26e2c33981297568c0c12d08.tar.bz2
opensim-SC-498820a74f6b288c26e2c33981297568c0c12d08.tar.xz
Merge branch 'ubitwork' into avination
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs18
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs56
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs23
4 files changed, 56 insertions, 45 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index b7466be..a600b86 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -585,12 +585,12 @@ namespace OpenSim.Region.Framework.Scenes
585 585
586 protected internal void AddPhysicalPrim(int number) 586 protected internal void AddPhysicalPrim(int number)
587 { 587 {
588 m_physicalPrim++; 588 m_physicalPrim += number;
589 } 589 }
590 590
591 protected internal void RemovePhysicalPrim(int number) 591 protected internal void RemovePhysicalPrim(int number)
592 { 592 {
593 m_physicalPrim--; 593 m_physicalPrim -= number;
594 } 594 }
595 595
596 protected internal void AddToScriptLPS(int number) 596 protected internal void AddToScriptLPS(int number)
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index aab6a49..96eeec4 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -631,6 +631,14 @@ namespace OpenSim.Region.Framework.Scenes
631 if (triggerScriptEvent) 631 if (triggerScriptEvent)
632 part.TriggerScriptChangedEvent(Changed.POSITION); 632 part.TriggerScriptChangedEvent(Changed.POSITION);
633 } 633 }
634
635/*
636 This seems not needed and should not be needed:
637 sp absolute position depends on sit part absolute position fixed above.
638 sp ParentPosition is not used anywhere.
639 Since presence is sitting, viewer considers it 'linked' to root prim, so it will move/rotate it
640 Sending a extra packet with avatar position is not only bandwidth waste, but may cause jitter in viewers due to UPD nature.
641
634 if (!m_dupeInProgress) 642 if (!m_dupeInProgress)
635 { 643 {
636 foreach (ScenePresence av in m_linkedAvatars) 644 foreach (ScenePresence av in m_linkedAvatars)
@@ -640,12 +648,12 @@ namespace OpenSim.Region.Framework.Scenes
640 { 648 {
641 Vector3 offset = p.GetWorldPosition() - av.ParentPosition; 649 Vector3 offset = p.GetWorldPosition() - av.ParentPosition;
642 av.AbsolutePosition += offset; 650 av.AbsolutePosition += offset;
643 av.ParentPosition = p.GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition 651// av.ParentPosition = p.GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
644 av.SendAvatarDataToAllAgents(); 652 av.SendAvatarDataToAllAgents();
645 } 653 }
646 } 654 }
647 } 655 }
648 656*/
649 //if (m_rootPart.PhysActor != null) 657 //if (m_rootPart.PhysActor != null)
650 //{ 658 //{
651 //m_rootPart.PhysActor.Position = 659 //m_rootPart.PhysActor.Position =
@@ -676,8 +684,8 @@ namespace OpenSim.Region.Framework.Scenes
676 if (agent.ParentUUID != UUID.Zero) 684 if (agent.ParentUUID != UUID.Zero)
677 { 685 {
678 agent.ParentPart = null; 686 agent.ParentPart = null;
679 agent.ParentPosition = Vector3.Zero; 687// agent.ParentPosition = Vector3.Zero;
680 // agent.ParentUUID = UUID.Zero; 688// agent.ParentUUID = UUID.Zero;
681 } 689 }
682 } 690 }
683 691
@@ -3752,7 +3760,7 @@ namespace OpenSim.Region.Framework.Scenes
3752 else 3760 else
3753 // ugly rotation update of all parts 3761 // ugly rotation update of all parts
3754 { 3762 {
3755 group.AbsolutePosition = AbsolutePosition; 3763 group.ResetChildPrimPhysicsPositions();
3756 } 3764 }
3757 3765
3758 } 3766 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 8e74dc8..a48605d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4496,7 +4496,8 @@ namespace OpenSim.Region.Framework.Scenes
4496 { 4496 {
4497 if (pa != null) 4497 if (pa != null)
4498 { 4498 {
4499 ParentGroup.Scene.RemovePhysicalPrim(1); 4499 if(wasUsingPhysics)
4500 ParentGroup.Scene.RemovePhysicalPrim(1);
4500 RemoveFromPhysics(); 4501 RemoveFromPhysics();
4501 } 4502 }
4502 4503
@@ -4513,38 +4514,37 @@ namespace OpenSim.Region.Framework.Scenes
4513 { 4514 {
4514 AddToPhysics(UsePhysics, SetPhantom, building, false); 4515 AddToPhysics(UsePhysics, SetPhantom, building, false);
4515 pa = PhysActor; 4516 pa = PhysActor;
4516 /* 4517/*
4517 if (pa != null) 4518 if (pa != null)
4518 { 4519 {
4519 if ( 4520 if (
4520 // ((AggregateScriptEvents & scriptEvents.collision) != 0) || 4521// ((AggregateScriptEvents & scriptEvents.collision) != 0) ||
4521 // ((AggregateScriptEvents & scriptEvents.collision_end) != 0) || 4522// ((AggregateScriptEvents & scriptEvents.collision_end) != 0) ||
4522 // ((AggregateScriptEvents & scriptEvents.collision_start) != 0) || 4523// ((AggregateScriptEvents & scriptEvents.collision_start) != 0) ||
4523 // ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) || 4524// ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) ||
4524 // ((AggregateScriptEvents & scriptEvents.land_collision) != 0) || 4525// ((AggregateScriptEvents & scriptEvents.land_collision) != 0) ||
4525 // ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) || 4526// ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) ||
4526 ((AggregateScriptEvents & PhysicsNeededSubsEvents) != 0) || 4527 ((AggregateScriptEvents & PhysicsNeededSubsEvents) != 0) ||
4527 ((ParentGroup.RootPart.AggregateScriptEvents & PhysicsNeededSubsEvents) != 0) || 4528 ((ParentGroup.RootPart.AggregateScriptEvents & PhysicsNeededSubsEvents) != 0) ||
4528 (CollisionSound != UUID.Zero) 4529 (CollisionSound != UUID.Zero)
4529 ) 4530 )
4530 { 4531 {
4531 pa.OnCollisionUpdate += PhysicsCollision; 4532 pa.OnCollisionUpdate += PhysicsCollision;
4532 pa.SubscribeEvents(1000); 4533 pa.SubscribeEvents(1000);
4533 } 4534 }
4534 } 4535 }
4535 */ 4536*/
4536 } 4537 }
4537 4538
4538 else // it already has a physical representation 4539 else // it already has a physical representation
4539 { 4540 {
4540 DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. 4541 DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status.
4541 /* moved into DoPhysicsPropertyUpdate 4542/* moved into DoPhysicsPropertyUpdate
4542 if(VolumeDetectActive) 4543 if(VolumeDetectActive)
4543 pa.SetVolumeDetect(1); 4544 pa.SetVolumeDetect(1);
4544 else 4545 else
4545 pa.SetVolumeDetect(0); 4546 pa.SetVolumeDetect(0);
4546 */ 4547*/
4547
4548 4548
4549 if (pa.Building != building) 4549 if (pa.Building != building)
4550 pa.Building = building; 4550 pa.Building = building;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 87b4d9f..4940063 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -433,7 +433,7 @@ namespace OpenSim.Region.Framework.Scenes
433 get { return (IClientCore)ControllingClient; } 433 get { return (IClientCore)ControllingClient; }
434 } 434 }
435 435
436 public Vector3 ParentPosition { get; set; } 436// public Vector3 ParentPosition { get; set; }
437 437
438 /// <summary> 438 /// <summary>
439 /// Position of this avatar relative to the region the avatar is in 439 /// Position of this avatar relative to the region the avatar is in
@@ -491,7 +491,7 @@ namespace OpenSim.Region.Framework.Scenes
491 if (ParentID == 0) 491 if (ParentID == 0)
492 { 492 {
493 m_pos = value; 493 m_pos = value;
494 ParentPosition = Vector3.Zero; 494// ParentPosition = Vector3.Zero;
495 } 495 }
496 496
497 //m_log.DebugFormat( 497 //m_log.DebugFormat(
@@ -857,11 +857,12 @@ namespace OpenSim.Region.Framework.Scenes
857 part.ParentGroup.AddAvatar(UUID); 857 part.ParentGroup.AddAvatar(UUID);
858 if (part.SitTargetPosition != Vector3.Zero) 858 if (part.SitTargetPosition != Vector3.Zero)
859 part.SitTargetAvatar = UUID; 859 part.SitTargetAvatar = UUID;
860 ParentPosition = part.GetWorldPosition(); 860// ParentPosition = part.GetWorldPosition();
861 ParentID = part.LocalId; 861 ParentID = part.LocalId;
862 ParentPart = part; 862 ParentPart = part;
863 m_pos = m_prevSitOffset; 863 m_pos = m_prevSitOffset;
864 pos = ParentPosition; 864// pos = ParentPosition;
865 pos = part.GetWorldPosition();
865 } 866 }
866 ParentUUID = UUID.Zero; 867 ParentUUID = UUID.Zero;
867 868
@@ -1933,11 +1934,12 @@ namespace OpenSim.Region.Framework.Scenes
1933 part.SitTargetAvatar = UUID.Zero; 1934 part.SitTargetAvatar = UUID.Zero;
1934 1935
1935 part.ParentGroup.DeleteAvatar(UUID); 1936 part.ParentGroup.DeleteAvatar(UUID);
1936 ParentPosition = part.GetWorldPosition(); 1937// ParentPosition = part.GetWorldPosition();
1937 ControllingClient.SendClearFollowCamProperties(part.ParentUUID); 1938 ControllingClient.SendClearFollowCamProperties(part.ParentUUID);
1938 1939
1939 m_pos += ParentPosition + new Vector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight); 1940// m_pos += ParentPosition + new Vector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight);
1940 ParentPosition = Vector3.Zero; 1941// ParentPosition = Vector3.Zero;
1942 m_pos += part.GetWorldPosition() + new Vector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight);
1941 1943
1942 ParentID = 0; 1944 ParentID = 0;
1943 ParentPart = null; 1945 ParentPart = null;
@@ -2388,13 +2390,13 @@ namespace OpenSim.Region.Framework.Scenes
2388 2390
2389// m_pos = sitTargetPos + SIT_TARGET_ADJUSTMENT - sitOffset; 2391// m_pos = sitTargetPos + SIT_TARGET_ADJUSTMENT - sitOffset;
2390 Rotation = sitTargetOrient; 2392 Rotation = sitTargetOrient;
2391 ParentPosition = part.AbsolutePosition; 2393// ParentPosition = part.AbsolutePosition;
2392 part.ParentGroup.AddAvatar(UUID); 2394 part.ParentGroup.AddAvatar(UUID);
2393 } 2395 }
2394 else 2396 else
2395 { 2397 {
2396 m_pos -= part.AbsolutePosition; 2398 m_pos -= part.AbsolutePosition;
2397 ParentPosition = part.AbsolutePosition; 2399// ParentPosition = part.AbsolutePosition;
2398 part.ParentGroup.AddAvatar(UUID); 2400 part.ParentGroup.AddAvatar(UUID);
2399 2401
2400// m_log.DebugFormat( 2402// m_log.DebugFormat(
@@ -3568,7 +3570,8 @@ namespace OpenSim.Region.Framework.Scenes
3568 // m_reprioritizationTimer.Dispose(); 3570 // m_reprioritizationTimer.Dispose();
3569 3571
3570 RemoveFromPhysicalScene(); 3572 RemoveFromPhysicalScene();
3571 Animator.Close(); 3573 if(Animator != null)
3574 Animator.Close();
3572 Animator = null; 3575 Animator = null;
3573 } 3576 }
3574 3577