mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
add osSetLinkSitActiveRange
This commit is contained in:
@@ -5679,7 +5679,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
if (v > 128f)
|
||||
v = 128f;
|
||||
float old = m_host.SitActiveRange;
|
||||
m_host.SitActiveRange = (float)v;
|
||||
if(old != (float)v)
|
||||
m_host.ParentGroup.HasGroupChanged = true;
|
||||
}
|
||||
|
||||
public void osSetLinkSitActiveRange(LSL_Integer linkNumber, LSL_Float v)
|
||||
{
|
||||
if (v > 128f)
|
||||
v = 128f;
|
||||
|
||||
bool changed = false;
|
||||
InitLSL();
|
||||
List<SceneObjectPart> parts = m_LSL_Api.GetLinkParts(linkNumber);
|
||||
for(int i = 0; i < parts.Count; ++i)
|
||||
{
|
||||
SceneObjectPart sop = parts[i];
|
||||
float old = sop.SitActiveRange;
|
||||
sop.SitActiveRange = (float)v;
|
||||
if (old != (float)v)
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (changed)
|
||||
m_host.ParentGroup.HasGroupChanged = true;
|
||||
}
|
||||
|
||||
public LSL_Float osGetSitActiveRange()
|
||||
@@ -5690,7 +5714,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
public void osSetStandTarget(LSL_Vector v)
|
||||
{
|
||||
// todo add limits ?
|
||||
Vector3 old = m_host.StandOffset;
|
||||
m_host.StandOffset = v;
|
||||
if(!old.ApproxEquals(v))
|
||||
m_host.ParentGroup.HasGroupChanged = true;
|
||||
}
|
||||
|
||||
public LSL_Vector osGetStandTarget()
|
||||
|
||||
@@ -561,6 +561,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||
LSL_Integer osIsNotValidNumber(LSL_Float v);
|
||||
|
||||
void osSetSitActiveRange(LSL_Float v);
|
||||
void osSetLinkSitActiveRange(LSL_Integer linkNumber, LSL_Float v);
|
||||
LSL_Float osGetSitActiveRange();
|
||||
void osSetStandTarget(vector v);
|
||||
vector osGetStandTarget();
|
||||
|
||||
@@ -1427,6 +1427,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
m_OSSL_Functions.osSetSitActiveRange(v);
|
||||
}
|
||||
|
||||
public void osSetLinkSitActiveRange(LSL_Integer linkNumber, LSL_Float v)
|
||||
{
|
||||
m_OSSL_Functions.osSetLinkSitActiveRange(linkNumber, v);
|
||||
}
|
||||
|
||||
public LSL_Float osGetSitActiveRange()
|
||||
{
|
||||
return m_OSSL_Functions.osGetSitActiveRange();
|
||||
|
||||
Reference in New Issue
Block a user