aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorSean Dague2007-11-07 20:29:30 +0000
committerSean Dague2007-11-07 20:29:30 +0000
commit65eb1852a3a9cf8d71a11ab8fdb30edb42888a59 (patch)
treef2b0efcb34bff04f880bfe5dbd464ca306f9fa53 /OpenSim/Region/ClientStack
parentdisable profuse logging messages for not saving physical (diff)
downloadopensim-SC_OLD-65eb1852a3a9cf8d71a11ab8fdb30edb42888a59.zip
opensim-SC_OLD-65eb1852a3a9cf8d71a11ab8fdb30edb42888a59.tar.gz
opensim-SC_OLD-65eb1852a3a9cf8d71a11ab8fdb30edb42888a59.tar.bz2
opensim-SC_OLD-65eb1852a3a9cf8d71a11ab8fdb30edb42888a59.tar.xz
add SendSunPos function to IClientAPI to let us pull all the sun
calculation logic into a module
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs16
1 files changed, 14 insertions, 2 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 1ffcd5e..bbe07d2 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -766,8 +766,18 @@ namespace OpenSim.Region.ClientStack
766 OutPacket(sound); 766 OutPacket(sound);
767 } 767 }
768 768
769 public void SendSunPos(LLVector3 sunPos, LLVector3 sunVel)
770 {
771 SimulatorViewerTimeMessagePacket viewertime = new SimulatorViewerTimeMessagePacket();
772 viewertime.TimeInfo.SunDirection = sunPos;
773 viewertime.TimeInfo.SunAngVelocity = sunVel;
774 viewertime.TimeInfo.UsecSinceStart = (ulong) Util.UnixTimeSinceEpoch();
775 OutPacket(viewertime);
776 }
777
769 public void SendViewerTime(int phase) 778 public void SendViewerTime(int phase)
770 { 779 {
780 Console.WriteLine("SunPhase: {0}", phase);
771 SimulatorViewerTimeMessagePacket viewertime = new SimulatorViewerTimeMessagePacket(); 781 SimulatorViewerTimeMessagePacket viewertime = new SimulatorViewerTimeMessagePacket();
772 //viewertime.TimeInfo.SecPerDay = 86400; 782 //viewertime.TimeInfo.SecPerDay = 86400;
773 // viewertime.TimeInfo.SecPerYear = 31536000; 783 // viewertime.TimeInfo.SecPerYear = 31536000;
@@ -778,7 +788,7 @@ namespace OpenSim.Region.ClientStack
778 if ((sunPhase < 6) || (sunPhase > 36)) 788 if ((sunPhase < 6) || (sunPhase > 36))
779 { 789 {
780 viewertime.TimeInfo.SunDirection = new LLVector3(0f, 0.8f, -0.8f); 790 viewertime.TimeInfo.SunDirection = new LLVector3(0f, 0.8f, -0.8f);
781 //Console.WriteLine("sending night"); 791 Console.WriteLine("sending night");
782 } 792 }
783 else 793 else
784 { 794 {
@@ -787,7 +797,9 @@ namespace OpenSim.Region.ClientStack
787 sunPhase = 12; 797 sunPhase = 12;
788 } 798 }
789 sunPhase = sunPhase - 12; 799 sunPhase = sunPhase - 12;
800
790 float yValue = 0.1f*(sunPhase); 801 float yValue = 0.1f*(sunPhase);
802 Console.WriteLine("Computed SunPhase: {0}, yValue: {1}", sunPhase, yValue);
791 if (yValue > 1.2f) 803 if (yValue > 1.2f)
792 { 804 {
793 yValue = yValue - 1.2f; 805 yValue = yValue - 1.2f;
@@ -809,7 +821,7 @@ namespace OpenSim.Region.ClientStack
809 yValue *= -1; 821 yValue *= -1;
810 } 822 }
811 viewertime.TimeInfo.SunDirection = new LLVector3(0f, yValue, 0.3f); 823 viewertime.TimeInfo.SunDirection = new LLVector3(0f, yValue, 0.3f);
812 //Console.WriteLine("sending sun update " + yValue); 824 Console.WriteLine("sending sun update " + yValue);
813 } 825 }
814 viewertime.TimeInfo.SunAngVelocity = new LLVector3(0, 0.0f, 10.0f); 826 viewertime.TimeInfo.SunAngVelocity = new LLVector3(0, 0.0f, 10.0f);
815 viewertime.TimeInfo.UsecSinceStart = (ulong) Util.UnixTimeSinceEpoch(); 827 viewertime.TimeInfo.UsecSinceStart = (ulong) Util.UnixTimeSinceEpoch();