Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005941opensim[REGION] Script Functionspublic2012-03-21 07:202012-05-24 18:50
ReporterKayaker Magic 
Assigned Tojustincc 
PrioritynormalSeverityminorReproducibilityalways
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0005941: llGetObjectDetails returns ZERO_ROTATION for OBJECT_ROTATION of a seated avatar in mouselook mode
DescriptionIn SL, llGetObjectDetails(id,[OBJECT_ROTATION]); returns the rotation that describes the direction a seated avatar is looking when the avatar is in in mouselook mode. IN OpenSim this call returns <0,0,0,0> in this situation.
  This behavior in SL is useful for aiming weapons I suppose, although I use it for steering boats so that they go in the direction you are looking.
Steps To ReproduceCreate a prim, create a new script in it, paste the script below into it and save.
Sit on the prim, go into mouselook mode, and look around. On SL the second set of numbers changes as you look around. On OpenSim the second set of numbers is always <0,0,0,0>
Additional Informationdefault
{
    state_entry()
    {
        llSitTarget(<0,0,1>,ZERO_ROTATION);
        llSetTimerEvent(1.0);
        
    }
    timer()
    {
        key user=llAvatarOnSitTarget();
        if (user!=NULL_KEY)
        {
            if (llGetAgentInfo(user)&AGENT_MOUSELOOK)
            {
                rotation prot=llGetRot();
                rotation arot=llList2Rot(llGetObjectDetails(user,[OBJECT_ROT]),0);
                llOwnerSay((string)(llRot2Euler(prot)*RAD_TO_DEG)+(string)(llRot2Euler(arot)*RAD_TO_DEG));
            }
        }

    }

}
TagsNo tags attached.
Git Revision or version numberunknown
Run Mode Grid (Multiple Regions per Sim)
Physics EngineODE
EnvironmentUnknown
Mono VersionNone
Viewerimprudence
Attached Files

- Relationships

-  Notes
(0021153)
justincc (administrator)
2012-03-30 23:17

From a quick web search I can't see where this is documented behaviour for llGetObjectDetails(). Could you provide a link?

This could be fairly trivially done in LSL_Api.llGetObjectDetails() if ScenePresence.m_headrotation were exposed via a public property.
(0021526)
Kayaker Magic (reporter)
2012-05-24 18:50

http://wiki.secondlife.com/wiki/LlGetRot [^] has a mention of this now.
    I searched the Wiki and the WEB looking for documentation on this. I once saw a forum posting from someone saying approximately “In an attached object worn by an avatar in mouselook mode, llGetRot returns the rotation of the avatars HEAD instead of the rotation of the avatar body”. If you read weapons scripts, you see that they assume that this is true: The weapon fires in the direction the avatar is looking, not the direction the body is facing. I discovered that the same thing is true when llGetRot is called from a prim that the avatar is seated on.
    I begged the SL Scripting Forum crowd to help me find a reference to this, and they replied “You have useful information, add it to the Wiki yourself!” I figured if I added this documentation, I'd be accused of cheating! Finally Void Singer took pity on me and added one line to the llGetRot documentation (link above) that says:
“llGetRot will return an accurate facing for Avatars seated or in mouselook, but only a rough direction otherwise when called from an attached prim.”

- Issue History
Date Modified Username Field Change
2012-03-21 07:20 Kayaker Magic New Issue
2012-03-30 23:17 justincc Note Added: 0021153
2012-03-30 23:17 justincc Assigned To => justincc
2012-03-30 23:17 justincc Status new => feedback
2012-05-24 18:50 Kayaker Magic Note Added: 0021526
2012-05-24 18:50 Kayaker Magic Status feedback => assigned


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker