Attached is a patch for adding the llGetSunDirection functionality. It was implemented by adding a parameter to estate settings for storing the sun position. The sun position is calculated and stored via the sun module everytime the client's sun position is updated. It was tested with several different srcipts on Linux and Windows
This commit is contained in:
Justin Clarke Casey
2008-04-23 10:16:26 +00:00
parent 2eb542dc59
commit 6efb16689a
3 changed files with 27 additions and 2 deletions

View File

@@ -2444,8 +2444,18 @@ namespace OpenSim.Region.ScriptEngine.Common
public LSL_Types.Vector3 llGetSunDirection()
{
m_host.AddScriptLPS(1);
NotImplemented("llGetSunDirection");
return new LSL_Types.Vector3();
LSL_Types.Vector3 SunDoubleVector3;
LLVector3 SunFloatVector3;
// sunPosition estate setting is set in OpenSim.Region.Environment.Modules.SunModule
// have to convert from LLVector3 (float) to LSL_Types.Vector3 (double)
SunFloatVector3 = World.RegionInfo.EstateSettings.sunPosition;
SunDoubleVector3.x = (double)SunFloatVector3.X;
SunDoubleVector3.y = (double)SunFloatVector3.Y;
SunDoubleVector3.z = (double)SunFloatVector3.Z;
return SunDoubleVector3;
}
public LSL_Types.Vector3 llGetTextureOffset(int face)