mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 22:26:09 +08:00
From: Kurt Taylor <krtaylor@us.ibm.com>
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user