llGetCameraFOV

From Second Life Wiki
Revision as of 22:01, 17 January 2024 by Leviathan Linden (talk | contribs) (Add llGetCmeraFOV() which is in Gingerbread server update scheduled for late Jan or early Feb 2024.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Summary

Function: float llGetCameraFOV( );

Returns a float value for the current camera's field of view (FOV) in radians for which the agent the task has permissions.

To run this function the script must request the PERMISSION_TRACK_CAMERA permission with llRequestPermissions.

Caveats

Permissions
Returns zero when permissions have not been granted.
All Issues ~ Search JIRA for related Bugs

Examples

// say the camera aspect ratio and field of view (FOV)
integer has_perms = FALSE;
default
{
    on_rez(integer a)
    {
        llResetScript();
        has_perms = FALSE;
    }
    state_entry()
    {
        llRequestPermissions(llGetOwner(), PERMISSION_TRACK_CAMERA);
    }
    run_time_permissions(integer permission)
    {
        has_perms = (permission == PERMISSION_TRACK_CAMERA);
    }
    touch_start()
    {
        if (has_perms)
        {
            float aspect = llGetCameraAspect();
            float fov = llGetCameraFOV();
            llOwnerSay("aspect = " + (string)aspect + "  FOV = " + (string)fov);
        }
        else
        {
            llRequestPermissions(llGetOwner(), PERMISSION_TRACK_CAMERA);
        }
    }
}

See Also

Events

•  run_time_permissions Permission receiving event

Functions

•  llGetPermissions Get the permissions granted
•  llGetPermissionsKey Get the agent who granted permissions
•  llRequestPermissions Request permissions
•  llGetCameraAspect
•  llGetCameraPos
•  llGetCameraRot
•  llSetCameraParams
•  llSetCameraAtOffset
•  llSetCameraEyeOffset

Articles

•  Script permissions

Deep Notes

Search JIRA for related Issues

Signature

function float llGetCameraFOV();