From 6efb16689aa2ca364f738342a1173c27fef54b86 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 23 Apr 2008 10:16:26 +0000 Subject: From: Kurt Taylor 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 --- OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 41c3956..f4a3bd3 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -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) -- cgit v1.1