aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorUbitUmarov2016-08-27 22:33:16 +0100
committerUbitUmarov2016-08-27 22:33:16 +0100
commite7b0963db88060e3bf26474edceeb75da11311e7 (patch)
treec76c922decbbb161c547a4c9582b210103b6be12 /OpenSim/Region/Framework/Scenes/ScenePresence.cs
parentremove excess data (diff)
downloadopensim-SC_OLD-e7b0963db88060e3bf26474edceeb75da11311e7.zip
opensim-SC_OLD-e7b0963db88060e3bf26474edceeb75da11311e7.tar.gz
opensim-SC_OLD-e7b0963db88060e3bf26474edceeb75da11311e7.tar.bz2
opensim-SC_OLD-e7b0963db88060e3bf26474edceeb75da11311e7.tar.xz
reduce math on use of camerarotation (need to add a lock there). Fix a bug on sits AToffset for some reason ATaxis got in there (needs testing)
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs22
1 files changed, 14 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 28d4080..643a479 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -542,10 +542,7 @@ namespace OpenSim.Region.Framework.Scenes
542 542
543 public Vector3 CameraPosition { get; set; } 543 public Vector3 CameraPosition { get; set; }
544 544
545 public Quaternion CameraRotation 545 public Quaternion CameraRotation { get; private set; }
546 {
547 get { return Util.Axes2Rot(CameraAtAxis, CameraLeftAxis, CameraUpAxis); }
548 }
549 546
550 // Use these three vectors to figure out what the agent is looking at 547 // Use these three vectors to figure out what the agent is looking at
551 // Convert it to a Matrix and/or Quaternion 548 // Convert it to a Matrix and/or Quaternion
@@ -2696,9 +2693,13 @@ namespace OpenSim.Region.Framework.Scenes
2696 CameraPosition = agentData.CameraCenter; 2693 CameraPosition = agentData.CameraCenter;
2697 // Use these three vectors to figure out what the agent is looking at 2694 // Use these three vectors to figure out what the agent is looking at
2698 // Convert it to a Matrix and/or Quaternion 2695 // Convert it to a Matrix and/or Quaternion
2696
2697 // this my need lock
2699 CameraAtAxis = agentData.CameraAtAxis; 2698 CameraAtAxis = agentData.CameraAtAxis;
2700 CameraLeftAxis = agentData.CameraLeftAxis; 2699 CameraLeftAxis = agentData.CameraLeftAxis;
2701 CameraUpAxis = agentData.CameraUpAxis; 2700 CameraUpAxis = agentData.CameraUpAxis;
2701 Quaternion camRot = Util.Axes2Rot(CameraAtAxis, CameraLeftAxis, CameraUpAxis);
2702 CameraRotation = camRot;
2702 2703
2703 // The Agent's Draw distance setting 2704 // The Agent's Draw distance setting
2704 // When we get to the point of re-computing neighbors everytime this 2705 // When we get to the point of re-computing neighbors everytime this
@@ -3171,9 +3172,9 @@ namespace OpenSim.Region.Framework.Scenes
3171 offset = offset * part.RotationOffset; 3172 offset = offset * part.RotationOffset;
3172 offset += part.OffsetPosition; 3173 offset += part.OffsetPosition;
3173 3174
3174 if (CameraAtAxis == Vector3.Zero && cameraEyeOffset == Vector3.Zero) 3175 if (cameraAtOffset == Vector3.Zero && cameraEyeOffset == Vector3.Zero)
3175 { 3176 {
3176 CameraAtAxis = part.ParentGroup.RootPart.GetCameraAtOffset(); 3177 cameraAtOffset = part.ParentGroup.RootPart.GetCameraAtOffset();
3177 cameraEyeOffset = part.ParentGroup.RootPart.GetCameraEyeOffset(); 3178 cameraEyeOffset = part.ParentGroup.RootPart.GetCameraEyeOffset();
3178 } 3179 }
3179 else 3180 else
@@ -3311,9 +3312,9 @@ namespace OpenSim.Region.Framework.Scenes
3311 offset = offset * part.RotationOffset; 3312 offset = offset * part.RotationOffset;
3312 offset += part.OffsetPosition; 3313 offset += part.OffsetPosition;
3313 3314
3314 if (CameraAtAxis == Vector3.Zero && cameraEyeOffset == Vector3.Zero) 3315 if (cameraAtOffset == Vector3.Zero && cameraEyeOffset == Vector3.Zero)
3315 { 3316 {
3316 CameraAtAxis = part.ParentGroup.RootPart.GetCameraAtOffset(); 3317 cameraAtOffset = part.ParentGroup.RootPart.GetCameraAtOffset();
3317 cameraEyeOffset = part.ParentGroup.RootPart.GetCameraEyeOffset(); 3318 cameraEyeOffset = part.ParentGroup.RootPart.GetCameraEyeOffset();
3318 } 3319 }
3319 else 3320 else
@@ -4571,6 +4572,11 @@ namespace OpenSim.Region.Framework.Scenes
4571 CameraAtAxis = cAgent.AtAxis; 4572 CameraAtAxis = cAgent.AtAxis;
4572 CameraLeftAxis = cAgent.LeftAxis; 4573 CameraLeftAxis = cAgent.LeftAxis;
4573 CameraUpAxis = cAgent.UpAxis; 4574 CameraUpAxis = cAgent.UpAxis;
4575
4576 Quaternion camRot = Util.Axes2Rot(CameraAtAxis, CameraLeftAxis, CameraUpAxis);
4577 CameraRotation = camRot;
4578
4579
4574 ParentUUID = cAgent.ParentPart; 4580 ParentUUID = cAgent.ParentPart;
4575 PrevSitOffset = cAgent.SitOffset; 4581 PrevSitOffset = cAgent.SitOffset;
4576 4582