Aurora.ScriptEngine.AuroraDotNetEngine.APIs.LSL_Api.llGetRootRotation C# (CSharp) Method

llGetRootRotation() public method

http://lslwiki.net/lslwiki/wakka.php?wakka=llGetRot http://lslwiki.net/lslwiki/wakka.php?wakka=ChildRotation Also tested in sl in regards to the behaviour in attachments/mouselook In the root prim:- Returns the object rotation if not attached Returns the avatars rotation if attached Returns the camera rotation if attached and the avatar is in mouselook
public llGetRootRotation ( ) : Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Quaternion
return Aurora.ScriptEngine.AuroraDotNetEngine.LSL_Types.Quaternion
        public LSL_Rotation llGetRootRotation()
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.None, "LSL", m_host, "LSL", m_itemID)) return new LSL_Rotation();

            Quaternion q;
            if (m_host.ParentEntity.RootChild.AttachmentPoint != 0)
            {
                IScenePresence avatar = World.GetScenePresence(m_host.AttachedAvatar);
                if (avatar != null)
                    q = (avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0
                            ? avatar.CameraRotation
                            : avatar.Rotation;
                else
                    q = m_host.ParentEntity.GroupRotation; // Likely never get here but just in case
            }
            else
                q = m_host.ParentEntity.GroupRotation; // just the group rotation
            return new LSL_Rotation(q.X, q.Y, q.Z, q.W);
        }
LSL_Api