Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007373opensim[REGION] Script Functionspublic2014-11-16 11:592016-12-16 14:55
ReporterKayaker Magic 
Assigned ToUbitUmarov 
PlatformOperating SystemOperating System Version
Product Version 
Target VersionFixed in Versionmaster (dev code) 
Summary0007373: llGetCameraRot does not change for small mouse movements.
DescriptionIn mouselook mode, when trying to use llGetCameraRot for precisely picking objects, you want to move the cursor very slowly. Apparently llGetCameraRot does not change what it returns if the delta change is very small. If you move slow enough you can rotate all the way around without llGetCameraRot reporting any change in angle.

In SL, small mouse movements are reported by llGetCameraRot and it can be used for precise pointing. This suggests that the viewer is not at fault here because I use the same viewer in SL.
Steps To ReproduceIt is difficult to see because you assume the cursor is pointing where you are pointing it! To demonstrate the problem I wrote an attachment that you wear and go into mouse-look mode. It reports the camera angle over chat.

A second free-moving prim listens to the chat and moves to point in the direction that llGetCameraRot is pointing.
Additional Information      //pointer prim script
     //place this in a prim that is 10 meters long in the x direction
    //and narrow in y and z (0.01 is nice)
   //leave this prim lying nearby, wear the attachment (below)
  //go into mouselook mode and look around.
 //when you turnslowly, this prim does not track properly
    listen(integer channel, string name, key id, string message)
        list parse=llParseString2List(message,["|"],[]);
        rotation rot=(rotation)llList2String(parse,0);
        vector pos=(vector)llList2String(parse,1);

******************second script********************

    //llGetCameraRot test
   //rez the pointer prim object nearby,
  //place this script in a prim, wear the prim, go into mouselook,
 //look around.
    if (llGetAttached()!=0) //if we are not already attached
        llRequestPermissions(llGetOwner(), PERMISSION_TRACK_CAMERA);

    on_rez(integer param)
    attach(key id)
        if (id != NULL_KEY)
        if (llGetAgentInfo(llGetOwner())&AGENT_MOUSELOOK)
            //calculate a cast ray from this position
            rotation rot=llGetCameraRot(); //in mouselook, use direction you are looking!
            vector start=llGetPos()+<0.5,0,0.8>*rot; //start at avatar head level
            vector end = start+<10.0,0,0>*rot; //continue for 10 meters in that direction
            //transmit that position to the test ray prim
            llSay( -1234566,(string)rot+"|"+(string)((start+end)/2.0) );
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (Multiple Regions per Sim)
Physics EngineODE
Script Engine
Environment.NET / Windows64
Mono VersionNone
Attached Files

- Relationships

-  Notes
Kayaker Magic (reporter)
2014-11-19 11:57

Watching an avatar rotate from a second viewer, I see that as an avatar turns, there is hysteresis in the avatar rotation. The avatar's body freezes while the head turns slowly, then every once in a while (after a 10 degree turn?) the body suddenly rotates to catch up. So perhaps the problem with llGetCameraRot is that it is returning the avatar rotation instead of the camera rotation.
Kayaker Magic (reporter)
2016-12-16 14:53

I tested this again on OpenSim 0.9
(OpenSim Dev OSgrid (Dev) 7c4f2b0: 2016-10-25 (Unix/Mono))
And the problem is fixed! There is still a little hysteresis but it is a fraction of a degree now. As far as I am concerned this mantis can now be closed.
kcozens (administrator)
2016-12-16 14:55

Thanks for the update, Kayaker. Closing this report.

- Issue History
Date Modified Username Field Change
2014-11-16 11:59 Kayaker Magic New Issue
2014-11-19 11:57 Kayaker Magic Note Added: 0027003
2016-12-16 14:53 Kayaker Magic Note Added: 0031489
2016-12-16 14:54 UbitUmarov Status new => resolved
2016-12-16 14:54 UbitUmarov Resolution open => fixed
2016-12-16 14:54 UbitUmarov Assigned To => UbitUmarov
2016-12-16 14:55 kcozens Note Added: 0031490
2016-12-16 14:55 kcozens Status resolved => closed
2016-12-16 14:55 kcozens Fixed in Version => master (dev code)

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker