Difference between revisions of "LlGetCameraFOV"

From Second Life Wiki
Jump to navigation Jump to search
(Add llGetCmeraFOV() which is in Gingerbread server update scheduled for late Jan or early Feb 2024.)
 
m
Line 1: Line 1:
{{LSL_Function/permission|PERMISSION_TRACK_CAMERA}}{{LSL_Function
{{LSL_Function/permission|PERMISSION_TRACK_CAMERA}}{{LSL_Function
|func=llGetCameraFOV
|func=llGetCameraFOV
|sort=GetCameraAspect
|sort=GetCameraFOV
|func_id=546
|func_id=546
|func_sleep=0.0
|func_sleep=0.0

Revision as of 22:55, 17 January 2024

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();