Merge branch 'opensim:master' into master

This commit is contained in:
AdilElFarissi
2024-03-29 03:52:41 +00:00
committed by GitHub
11 changed files with 98 additions and 20 deletions

View File

@@ -13339,6 +13339,45 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return LSL_Rotation.Identity;
}
public LSL_Float llGetCameraFOV()
{
if (m_item.PermsGranter.IsZero())
return LSL_Float.Zero;
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0)
{
Error("llGetCameraAspect", "No permissions to track the camera");
return LSL_Float.Zero;
}
ScenePresence presence = World.GetScenePresence(m_item.PermsGranter);
if (presence is not null && presence.ControllingClient is not null)
{
return new LSL_Float(presence.ControllingClient.FOV);
}
return 1.4f;
}
public LSL_Float llGetCameraAspect()
{
if (m_item.PermsGranter.IsZero())
return 1f;
if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0)
{
Error("llGetCameraAspect", "No permissions to track the camera");
return 1f;
}
ScenePresence presence = World.GetScenePresence(m_item.PermsGranter);
if (presence is not null && presence.ControllingClient is not null)
{
int h = presence.ControllingClient.viewHeight;
return new LSL_Float(h > 0 ? (float)presence.ControllingClient.viewWidth / h : 1.0f);
}
return 1f;
}
public void llSetPrimURL(string url)
{
Deprecated("llSetPrimURL", "Use llSetPrimMediaParams instead");

View File

@@ -129,6 +129,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_Integer llGetAttached();
LSL_List llGetAttachedList(LSL_Key id);
LSL_List llGetBoundingBox(string obj);
LSL_Float llGetCameraAspect();
LSL_Float llGetCameraFOV();
LSL_Vector llGetCameraPos();
LSL_Rotation llGetCameraRot();
LSL_Vector llGetCenterOfMass();

View File

@@ -512,6 +512,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_LSL_Functions.llGetBoundingBox(obj);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public LSL_Float llGetCameraAspect()
{
return m_LSL_Functions.llGetCameraAspect();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public LSL_Float llGetCameraFOV()
{
return m_LSL_Functions.llGetCameraFOV();
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public LSL_Vector llGetCameraPos()
{

View File

@@ -1398,6 +1398,10 @@ namespace OpenSim.Region.ScriptEngine.Shared
LSLString r = (LSLString)right;
ret = string.CompareOrdinal(lsl.m_string, r.m_string);
}
else if (left is string ssl)
{
ret = string.CompareOrdinal(ssl, right as string);
}
else if (left is LSLFloat fl)
{
LSLFloat r = (LSLFloat)right;
@@ -1418,10 +1422,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
return 0;
}
if (ascending)
return ret;
return -ret;
return ascending ? ret : -ret;
}
class HomogeneousComparer : IComparer
@@ -1449,6 +1450,10 @@ namespace OpenSim.Region.ScriptEngine.Shared
LSLString r = (LSLString)right;
ret = string.CompareOrdinal(lsl.m_string, r.m_string);
}
else if (left is string ssl)
{
ret = string.CompareOrdinal(ssl, right as string);
}
else if (left is LSLFloat fl)
{
LSLFloat r = (LSLFloat)right;
@@ -1491,6 +1496,10 @@ namespace OpenSim.Region.ScriptEngine.Shared
LSLString r = (LSLString)right;
return string.CompareOrdinal(lsl.m_string, r.m_string) > 0;
}
else if (left is string ssl)
{
return string.CompareOrdinal(ssl, right as string) > 0;
}
if (left is LSLFloat lf)
{
LSLFloat r = (LSLFloat)right;
@@ -1524,6 +1533,11 @@ namespace OpenSim.Region.ScriptEngine.Shared
LSLString r = (LSLString)right;
return string.CompareOrdinal(lsl.m_string, r.m_string) < 0;
}
else if (left is string ssl)
{
string sr = right as string;
return string.CompareOrdinal(ssl, sr) < 0;
}
if (left is LSLFloat lf)
{
LSLFloat r = (LSLFloat)right;