diff options
Diffstat (limited to 'OpenSim/Region/Environment/Modules/World/Sun')
-rw-r--r-- | OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs | 61 |
1 files changed, 2 insertions, 59 deletions
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 | |||
127 | { | 127 | { |
128 | long m_addticks = (DateTime.Now.Ticks - m_start) * m_dilation; | 128 | long m_addticks = (DateTime.Now.Ticks - m_start) * m_dilation; |
129 | DateTime dt = new DateTime(m_start + m_addticks); | 129 | DateTime dt = new DateTime(m_start + m_addticks); |
130 | return (double) dt.Hour + ((double) dt.Minute / 60.0); | 130 | return dt.Hour + (dt.Minute / 60.0); |
131 | } | 131 | } |
132 | 132 | ||
133 | private LLVector3 SunPos(double hour) | 133 | private static LLVector3 SunPos(double hour) |
134 | { | 134 | { |
135 | // now we have our radian position | 135 | // now we have our radian position |
136 | double rad = (hour / m_real_day) * 2 * Math.PI - (Math.PI / 2.0); | 136 | double rad = (hour / m_real_day) * 2 * Math.PI - (Math.PI / 2.0); |
@@ -138,62 +138,5 @@ namespace OpenSim.Region.Environment.Modules.World.Sun | |||
138 | double x = Math.Cos(rad); | 138 | double x = Math.Cos(rad); |
139 | return new LLVector3((float) x, 0f, (float) z); | 139 | return new LLVector3((float) x, 0f, (float) z); |
140 | } | 140 | } |
141 | |||
142 | // TODO: clear this out. This is here so that I remember to | ||
143 | // figure out if we need those other packet fields that I've | ||
144 | // left out so far | ||
145 | // | ||
146 | // public void SendViewerTime(int phase) | ||
147 | // { | ||
148 | // Console.WriteLine("SunPhase: {0}", phase); | ||
149 | // SimulatorViewerTimeMessagePacket viewertime = new SimulatorViewerTimeMessagePacket(); | ||
150 | // //viewertime.TimeInfo.SecPerDay = 86400; | ||
151 | // // viewertime.TimeInfo.SecPerYear = 31536000; | ||
152 | // viewertime.TimeInfo.SecPerDay = 1000; | ||
153 | // viewertime.TimeInfo.SecPerYear = 365000; | ||
154 | // viewertime.TimeInfo.SunPhase = 1; | ||
155 | // int sunPhase = (phase + 2)/2; | ||
156 | // if ((sunPhase < 6) || (sunPhase > 36)) | ||
157 | // { | ||
158 | // viewertime.TimeInfo.SunDirection = new LLVector3(0f, 0.8f, -0.8f); | ||
159 | // Console.WriteLine("sending night"); | ||
160 | // } | ||
161 | // else | ||
162 | // { | ||
163 | // if (sunPhase < 12) | ||
164 | // { | ||
165 | // sunPhase = 12; | ||
166 | // } | ||
167 | // sunPhase = sunPhase - 12; | ||
168 | // | ||
169 | // float yValue = 0.1f*(sunPhase); | ||
170 | // Console.WriteLine("Computed SunPhase: {0}, yValue: {1}", sunPhase, yValue); | ||
171 | // if (yValue > 1.2f) | ||
172 | // { | ||
173 | // yValue = yValue - 1.2f; | ||
174 | // } | ||
175 | // if (yValue > 1) | ||
176 | // { | ||
177 | // yValue = 1; | ||
178 | // } | ||
179 | // if (yValue < 0) | ||
180 | // { | ||
181 | // yValue = 0; | ||
182 | // } | ||
183 | // if (sunPhase < 14) | ||
184 | // { | ||
185 | // yValue = 1 - yValue; | ||
186 | // } | ||
187 | // if (sunPhase < 12) | ||
188 | // { | ||
189 | // yValue *= -1; | ||
190 | // } | ||
191 | // viewertime.TimeInfo.SunDirection = new LLVector3(0f, yValue, 0.3f); | ||
192 | // Console.WriteLine("sending sun update " + yValue); | ||
193 | // } | ||
194 | // viewertime.TimeInfo.SunAngVelocity = new LLVector3(0, 0.0f, 10.0f); | ||
195 | // viewertime.TimeInfo.UsecSinceStart = (ulong) Util.UnixTimeSinceEpoch(); | ||
196 | // // OutPacket(viewertime); | ||
197 | // } | ||
198 | } | 141 | } |
199 | } \ No newline at end of file | 142 | } \ No newline at end of file |