From 87b313792821cb842fd54b568302b6877c4e53f8 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sat, 3 May 2008 20:00:35 +0000 Subject: * Cleaned up code in Terrain, Tree and Map modules. * Fixed a bug with Terragen loader where it would do bad things on a non 256x256 sized terrain. Now loads the array correctly. * Moved MapImageModule.cs to Modules/World/WorldMap * Changed Location.RegionHandle to use Helpers.GetUlong instead of doing it ourselves. --- .../Environment/Modules/World/Sun/SunModule.cs | 61 +--------------------- 1 file changed, 2 insertions(+), 59 deletions(-) (limited to 'OpenSim/Region/Environment/Modules/World/Sun') diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs index 47ce258..7d9bdd9 100644 --- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs @@ -127,10 +127,10 @@ namespace OpenSim.Region.Environment.Modules.World.Sun { long m_addticks = (DateTime.Now.Ticks - m_start) * m_dilation; DateTime dt = new DateTime(m_start + m_addticks); - return (double) dt.Hour + ((double) dt.Minute / 60.0); + return dt.Hour + (dt.Minute / 60.0); } - private LLVector3 SunPos(double hour) + private static LLVector3 SunPos(double hour) { // now we have our radian position double rad = (hour / m_real_day) * 2 * Math.PI - (Math.PI / 2.0); @@ -138,62 +138,5 @@ namespace OpenSim.Region.Environment.Modules.World.Sun double x = Math.Cos(rad); return new LLVector3((float) x, 0f, (float) z); } - - // TODO: clear this out. This is here so that I remember to - // figure out if we need those other packet fields that I've - // left out so far - // - // public void SendViewerTime(int phase) - // { - // Console.WriteLine("SunPhase: {0}", phase); - // SimulatorViewerTimeMessagePacket viewertime = new SimulatorViewerTimeMessagePacket(); - // //viewertime.TimeInfo.SecPerDay = 86400; - // // viewertime.TimeInfo.SecPerYear = 31536000; - // viewertime.TimeInfo.SecPerDay = 1000; - // viewertime.TimeInfo.SecPerYear = 365000; - // viewertime.TimeInfo.SunPhase = 1; - // int sunPhase = (phase + 2)/2; - // if ((sunPhase < 6) || (sunPhase > 36)) - // { - // viewertime.TimeInfo.SunDirection = new LLVector3(0f, 0.8f, -0.8f); - // Console.WriteLine("sending night"); - // } - // else - // { - // if (sunPhase < 12) - // { - // 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; - // } - // if (yValue > 1) - // { - // yValue = 1; - // } - // if (yValue < 0) - // { - // yValue = 0; - // } - // if (sunPhase < 14) - // { - // yValue = 1 - yValue; - // } - // if (sunPhase < 12) - // { - // yValue *= -1; - // } - // viewertime.TimeInfo.SunDirection = new LLVector3(0f, yValue, 0.3f); - // Console.WriteLine("sending sun update " + yValue); - // } - // viewertime.TimeInfo.SunAngVelocity = new LLVector3(0, 0.0f, 10.0f); - // viewertime.TimeInfo.UsecSinceStart = (ulong) Util.UnixTimeSinceEpoch(); - // // OutPacket(viewertime); - // } } } \ No newline at end of file -- cgit v1.1