change osSetProjectionParams a bit and add a variant that atkes a linknumber argument. For now can only change one prim per call
parent
bd442208d8
commit
5314f375c5
|
@ -3818,15 +3818,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set parameters for light projection in host prim
|
/// Set parameters for light projection in host prim
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>
|
||||||
/// Set parameters for light projection with uuid of target prim
|
/// Set parameters for light projection with uuid of target prim
|
||||||
/// </summary>
|
/// </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");
|
CheckThreatLevel(ThreatLevel.High, "osSetProjectionParams");
|
||||||
|
|
||||||
|
@ -3841,7 +3866,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
return;
|
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.ProjectionEntry = projection;
|
||||||
obj.Shape.ProjectionTextureUUID = new UUID(texture);
|
obj.Shape.ProjectionTextureUUID = new UUID(texture);
|
||||||
obj.Shape.ProjectionFOV = (float)fov;
|
obj.Shape.ProjectionFOV = (float)fov;
|
||||||
|
|
|
@ -393,8 +393,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
void osForceOtherSit(string avatar, string target);
|
void osForceOtherSit(string avatar, string target);
|
||||||
LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules);
|
LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules);
|
||||||
void osSetPrimitiveParams(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_Integer projection, LSL_Key texture, LSL_Float fov, LSL_Float focus, LSL_Float amb);
|
||||||
void osSetProjectionParams(LSL_Key prim, bool projection, LSL_Key texture, double fov, double focus, double 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 osGetAvatarList();
|
||||||
LSL_List osGetNPCList();
|
LSL_List osGetNPCList();
|
||||||
|
|
|
@ -1035,16 +1035,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
m_OSSL_Functions.osSetPrimitiveParams(prim, rules);
|
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);
|
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);
|
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()
|
public LSL_List osGetAvatarList()
|
||||||
{
|
{
|
||||||
return m_OSSL_Functions.osGetAvatarList();
|
return m_OSSL_Functions.osGetAvatarList();
|
||||||
|
|
Loading…
Reference in New Issue