llLinkSitTarget implementation http://wiki.secondlife.com/wiki/LlLinkSitTarget
parent
f034958bdc
commit
0b9f4d7e74
|
@ -6376,16 +6376,38 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
}
|
||||
}
|
||||
|
||||
public void llSitTarget(LSL_Vector offset, LSL_Rotation rot)
|
||||
protected void SitTarget(SceneObjectPart part, LSL_Vector offset, LSL_Rotation rot)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
// LSL quaternions can normalize to 0, normal Quaternions can't.
|
||||
if (rot.s == 0 && rot.x == 0 && rot.y == 0 && rot.z == 0)
|
||||
rot.z = 1; // ZERO_ROTATION = 0,0,0,1
|
||||
|
||||
m_host.SitTargetPosition = new Vector3((float)offset.x, (float)offset.y, (float)offset.z);
|
||||
m_host.SitTargetOrientation = Rot2Quaternion(rot);
|
||||
m_host.ParentGroup.HasGroupChanged = true;
|
||||
part.SitTargetPosition = new Vector3((float)offset.x, (float)offset.y, (float)offset.z);
|
||||
part.SitTargetOrientation = Rot2Quaternion(rot);
|
||||
part.ParentGroup.HasGroupChanged = true;
|
||||
}
|
||||
|
||||
public void llSitTarget(LSL_Vector offset, LSL_Rotation rot)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
SitTarget(m_host, offset, rot);
|
||||
}
|
||||
|
||||
public void llLinkSitTarget(LSL_Integer link, LSL_Vector offset, LSL_Rotation rot)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
if (link == ScriptBaseClass.LINK_ROOT)
|
||||
SitTarget(m_host.ParentGroup.RootPart, offset, rot);
|
||||
else if (link == ScriptBaseClass.LINK_THIS)
|
||||
SitTarget(m_host, offset, rot);
|
||||
else
|
||||
{
|
||||
SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(link);
|
||||
if (null != part)
|
||||
{
|
||||
SitTarget(part, offset, rot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public LSL_String llAvatarOnSitTarget()
|
||||
|
|
|
@ -218,6 +218,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
|||
LSL_String llGetDisplayName(string id);
|
||||
LSL_String llRequestDisplayName(string id);
|
||||
void llLinkParticleSystem(int linknum, LSL_List rules);
|
||||
void llLinkSitTarget(LSL_Integer link, LSL_Vector offset, LSL_Rotation rot);
|
||||
LSL_String llList2CSV(LSL_List src);
|
||||
LSL_Float llList2Float(LSL_List src, int index);
|
||||
LSL_Integer llList2Integer(LSL_List src, int index);
|
||||
|
|
|
@ -1688,6 +1688,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
|||
m_LSL_Functions.llSitTarget(offset, rot);
|
||||
}
|
||||
|
||||
public void llLinkSitTarget(LSL_Integer link, LSL_Vector offset, LSL_Rotation rot)
|
||||
{
|
||||
m_LSL_Functions.llLinkSitTarget(link, offset, rot);
|
||||
}
|
||||
|
||||
public void llSleep(double sec)
|
||||
{
|
||||
m_LSL_Functions.llSleep(sec);
|
||||
|
|
Loading…
Reference in New Issue