diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index c18216e6ec..11e6ae71f9 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -427,6 +427,7 @@ namespace OpenSim.Framework void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, string url); bool AddMoney(int debit); + void SendSunPos(LLVector3 sunPos, LLVector3 sunVel); void SendViewerTime(int phase); 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 1ffcd5ea3a..bbe07d2bdb 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs @@ -766,8 +766,18 @@ namespace OpenSim.Region.ClientStack OutPacket(sound); } + public void SendSunPos(LLVector3 sunPos, LLVector3 sunVel) + { + SimulatorViewerTimeMessagePacket viewertime = new SimulatorViewerTimeMessagePacket(); + viewertime.TimeInfo.SunDirection = sunPos; + viewertime.TimeInfo.SunAngVelocity = sunVel; + viewertime.TimeInfo.UsecSinceStart = (ulong) Util.UnixTimeSinceEpoch(); + OutPacket(viewertime); + } + public void SendViewerTime(int phase) { + Console.WriteLine("SunPhase: {0}", phase); SimulatorViewerTimeMessagePacket viewertime = new SimulatorViewerTimeMessagePacket(); //viewertime.TimeInfo.SecPerDay = 86400; // viewertime.TimeInfo.SecPerYear = 31536000; @@ -778,7 +788,7 @@ namespace OpenSim.Region.ClientStack if ((sunPhase < 6) || (sunPhase > 36)) { viewertime.TimeInfo.SunDirection = new LLVector3(0f, 0.8f, -0.8f); - //Console.WriteLine("sending night"); + Console.WriteLine("sending night"); } else { @@ -787,7 +797,9 @@ namespace OpenSim.Region.ClientStack sunPhase = 12; } sunPhase = sunPhase - 12; + float yValue = 0.1f*(sunPhase); + Console.WriteLine("Computed SunPhase: {0}, yValue: {1}", sunPhase, yValue); if (yValue > 1.2f) { yValue = yValue - 1.2f; @@ -809,7 +821,7 @@ namespace OpenSim.Region.ClientStack yValue *= -1; } viewertime.TimeInfo.SunDirection = new LLVector3(0f, yValue, 0.3f); - //Console.WriteLine("sending sun update " + yValue); + Console.WriteLine("sending sun update " + yValue); } viewertime.TimeInfo.SunAngVelocity = new LLVector3(0, 0.0f, 10.0f); viewertime.TimeInfo.UsecSinceStart = (ulong) Util.UnixTimeSinceEpoch(); diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index 69584f4ace..1a7901e88b 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs @@ -400,6 +400,10 @@ namespace SimpleApp return false; } + public void SendSunPos(LLVector3 sunPos, LLVector3 sunVel) + { + } + public void SendViewerTime(int phase) { }