OpenSim.Region.ScriptEngine.Shared.Api.LSL_Api.llSetRot C# (CSharp) Method

llSetRot() public method

public llSetRot ( OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion rot ) : void
rot OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion
return void
        public void llSetRot(LSL_Rotation rot)
        {
            m_host.AddScriptLPS(1);
          
            // try to let this work as in SL...
            if (m_host.ParentID == 0 || (m_host.ParentGroup != null && m_host == m_host.ParentGroup.RootPart))
            {
                // special case: If we are root, rotate complete SOG to new rotation
                SetRot(m_host, 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.
                SceneObjectPart rootPart = m_host.ParentGroup.RootPart;
                if (rootPart != null) // better safe than sorry
                {
                    SetRot(m_host, rootPart.RotationOffset * (Quaternion)rot);
                }
            }

            ScriptSleep(m_sleepMsOnSetRot);
        }
LSL_Api