OpenSim.Region.ScriptEngine.Shared.Api.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 ( ) : OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion
return OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion
        public LSL_Rotation llGetRootRotation()
        {
            m_host.AddScriptLPS(1);
            Quaternion q;
            if (m_host.ParentGroup.AttachmentPoint != 0)
            {
                ScenePresence avatar = World.GetScenePresence(m_host.ParentGroup.AttachedAvatar);
                if (avatar != null)
                    if ((avatar.AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0)
                        q = avatar.CameraRotation; // Mouselook
                    else
                        q = avatar.GetWorldRotation(); // Currently infrequently updated so may be inaccurate
                else
                    q = m_host.ParentGroup.GroupRotation; // Likely never get here but just in case
            }
            else
                q = m_host.ParentGroup.GroupRotation; // just the group rotation

            return new LSL_Rotation(q);
        }
LSL_Api