change osSetProjectionParams a bit and add a variant that atkes a linknumber argument. For now can only change one prim per call

0.9.1.0-post-fixes
UbitUmarov 2019-04-18 15:26:27 +01:00
parent bd442208d8
commit 5314f375c5
3 changed files with 43 additions and 7 deletions

View File

@ -3818,15 +3818,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// <summary>
/// Set parameters for light projection in host prim
/// </summary>
public void osSetProjectionParams(bool projection, LSL_Key texture, double fov, double focus, double amb)
public void osSetProjectionParams(LSL_Integer projection, LSL_Key texture, LSL_Float fov, LSL_Float focus, LSL_Float amb)
{
osSetProjectionParams(UUID.Zero.ToString(), projection, texture, fov, focus, amb);
SetProjectionParams(m_host, projection, texture, fov, focus, amb);
}
/// <summary>
/// Set parameters for light projection of a linkset prim
/// </summary>
public void osSetProjectionParams(LSL_Integer linknum, LSL_Integer projection, LSL_Key texture, LSL_Float fov, LSL_Float focus, LSL_Float amb)
{
if (linknum == ScriptBaseClass.LINK_THIS || linknum == m_host.LinkNum)
{
SetProjectionParams(m_host, projection, texture, fov, focus, amb);
return;
}
if (linknum < 0 || linknum > m_host.ParentGroup.PrimCount)
return;
if(linknum < 2 && m_host.LinkNum < 2)
{
SetProjectionParams(m_host, projection, texture, fov, focus, amb);
return;
}
SceneObjectPart obj = m_host.ParentGroup.GetLinkNumPart(linknum);
if(obj != null)
SetProjectionParams(obj, projection, texture, fov, focus, amb);
}
/// <summary>
/// Set parameters for light projection with uuid of target prim
/// </summary>
public void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb)
public void osSetProjectionParams(LSL_Key prim, LSL_Integer llprojection, LSL_Key texture, LSL_Float fov, LSL_Float focus, LSL_Float amb)
{
CheckThreatLevel(ThreatLevel.High, "osSetProjectionParams");
@ -3841,7 +3866,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (obj == null)
return;
}
SetProjectionParams(obj, llprojection, texture, fov, focus, amb);
}
private void SetProjectionParams(SceneObjectPart obj, LSL_Integer llprojection, LSL_Key texture, LSL_Float fov, LSL_Float focus, LSL_Float amb)
{
bool projection = llprojection != 0;
obj.Shape.ProjectionEntry = projection;
obj.Shape.ProjectionTextureUUID = new UUID(texture);
obj.Shape.ProjectionFOV = (float)fov;

View File

@ -393,8 +393,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osForceOtherSit(string avatar, string target);
LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules);
void osSetPrimitiveParams(LSL_Key prim, LSL_List rules);
void osSetProjectionParams(bool projection, LSL_Key texture, double fov, double focus, double amb);
void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb);
void osSetProjectionParams(LSL_Integer projection, LSL_Key texture, LSL_Float fov, LSL_Float focus, LSL_Float amb);
void osSetProjectionParams(LSL_Key prim, LSL_Integer projection, LSL_Key texture, LSL_Float fov, LSL_Float focus, LSL_Float amb);
void osSetProjectionParams(LSL_Integer linknumber, LSL_Integer projection, LSL_Key texture, LSL_Float fov, LSL_Float focus, LSL_Float amb);
LSL_List osGetAvatarList();
LSL_List osGetNPCList();

View File

@ -1035,16 +1035,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osSetPrimitiveParams(prim, rules);
}
public void osSetProjectionParams(bool projection, LSL_Key texture, double fov, double focus, double amb)
public void osSetProjectionParams(LSL_Integer projection, LSL_Key texture, double fov, double focus, double amb)
{
m_OSSL_Functions.osSetProjectionParams(projection, texture, fov, focus, amb);
}
public void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double amb)
public void osSetProjectionParams(LSL_Key prim, LSL_Integer projection, LSL_Key texture, double fov, double focus, double amb)
{
m_OSSL_Functions.osSetProjectionParams(prim, projection, texture, fov, focus, amb);
}
public void osSetProjectionParams(LSL_Integer linknumber, LSL_Integer projection, LSL_Key texture, LSL_Float fov, LSL_Float focus, LSL_Float amb)
{
m_OSSL_Functions.osSetProjectionParams(linknumber, projection, texture, fov, focus, amb);
}
public LSL_List osGetAvatarList()
{
return m_OSSL_Functions.osGetAvatarList();