public DateTime llSetRot(LSL_Rotation rot)
{
if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return DateTime.Now;
// try to let this work as in SL...
if (m_host.ParentID == 0)
{
// special case: If we are root, rotate complete SOG to new rotation
SetRot(m_host, Rot2Quaternion(rot));
}
else
{
// we are a child. The rotation values will be set to the one of root modified by rot, as in SL. Don't ask.
ISceneEntity group = m_host.ParentEntity;
if (group != null) // a bit paranoid, maybe
{
ISceneChildEntity rootPart = group.RootChild;
if (rootPart != null) // again, better safe than sorry
{
SetRot(m_host, rootPart.RotationOffset * Rot2Quaternion(rot));
}
}
}
return PScriptSleep(200);
}