Skip to content
lsl.devlsl.devLSL Dev

llGetCameraFOV

function
Function syntax
float llGetCameraFOV();
Returns
float
Energy
10

Returns a float representing the camera's current field of view (FOV) in radians of the agent who granted PERMISSION_TRACK_CAMERA. Returns 0.0 if permissions are not granted.

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

How to use
float result = llGetCameraFOV();

Returns zero when permissions have not been granted.

Example 1
20 collapsed lines
// 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(integer num_touches)
{
if (has_perms)
{
float aspect = llGetCameraAspect();
float fov = llGetCameraFOV();
llOwnerSay("aspect = " + (string)aspect + " FOV = " + (string)fov);
}
6 collapsed lines
else
{
llRequestPermissions(llGetOwner(), PERMISSION_TRACK_CAMERA);
}
}
}
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.

From the Second Life Wiki

Community documentation adapted from LlGetCameraFOV, by Linden Research, Inc. and contributing residents.View contributors and history.

Imported wiki revision:

Licensed under CC BY-SA 3.0. Last wiki edit: .Formatting and links have been adapted for this site; API metadata follows the LSL definitions.