aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
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
parentdisable profuse logging messages for not saving physical (diff)
downloadopensim-SC-65eb1852a3a9cf8d71a11ab8fdb30edb42888a59.zip
opensim-SC-65eb1852a3a9cf8d71a11ab8fdb30edb42888a59.tar.gz
opensim-SC-65eb1852a3a9cf8d71a11ab8fdb30edb42888a59.tar.bz2
opensim-SC-65eb1852a3a9cf8d71a11ab8fdb30edb42888a59.tar.xz
add SendSunPos function to IClientAPI to let us pull all the sun
calculation logic into a module
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/IClientAPI.cs1
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs16
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs4
3 files changed, 19 insertions, 2 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index c18216e..11e6ae7 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -427,6 +427,7 @@ namespace OpenSim.Framework
427 void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, string url); 427 void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, string url);
428 bool AddMoney(int debit); 428 bool AddMoney(int debit);
429 429
430 void SendSunPos(LLVector3 sunPos, LLVector3 sunVel);
430 void SendViewerTime(int phase); 431 void SendViewerTime(int phase);
431 432
432 void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, string flAbout, 433 void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember, string flAbout,
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 }