aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs16
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs4
2 files changed, 18 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();
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index 69584f4..1a7901e 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -400,6 +400,10 @@ namespace SimpleApp
400 return false; 400 return false;
401 } 401 }
402 402
403 public void SendSunPos(LLVector3 sunPos, LLVector3 sunVel)
404 {
405 }
406
403 public void SendViewerTime(int phase) 407 public void SendViewerTime(int phase)
404 { 408 {
405 } 409 }