... osSetLinkStandTarget

This commit is contained in:
UbitUmarov
2020-01-25 15:51:36 +00:00
parent 8df27ba2a1
commit 76987fb647
4 changed files with 64 additions and 29 deletions

View File

@@ -5734,6 +5734,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.ParentGroup.HasGroupChanged = true;
}
public void osSetLinkStandTarget(LSL_Integer linkNumber, LSL_Vector v)
{
// todo add limits ?
SceneObjectPart target = null;
if (linkNumber == ScriptBaseClass.LINK_THIS)
target = m_host;
else if (linkNumber < 0)
return;
else if (linkNumber < 2)
target = m_host.ParentGroup.RootPart;
else
target = m_host.ParentGroup.GetLinkNumPart(linkNumber);
if (target == null)
return;
Vector3 old = target.StandOffset;
target.StandOffset = v;
if (!old.ApproxEquals(v))
m_host.ParentGroup.HasGroupChanged = true;
}
public LSL_Vector osGetStandTarget()
{
return m_host.StandOffset;

View File

@@ -565,6 +565,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
LSL_Float osGetSitActiveRange();
LSL_Float osGetLinkSitActiveRange(LSL_Integer linkNumber);
void osSetStandTarget(vector v);
void osSetLinkStandTarget(LSL_Integer linkNumber, vector v);
vector osGetStandTarget();
vector osGetLinkStandTarget(LSL_Integer linkNumber);
}

View File

@@ -1447,6 +1447,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
m_OSSL_Functions.osSetStandTarget(v);
}
public void osSetLinkStandTarget(LSL_Integer linkNumber, vector v)
{
m_OSSL_Functions.osSetLinkStandTarget(linkNumber, v);
}
public vector osGetStandTarget()
{
return m_OSSL_Functions.osGetStandTarget();