float llGetCameraFOV();
Forced delay: 0.0 seconds. Energy: 10.0.
Returns a float value for the current camera's field of view (FOV), in radians, of the agent for which the task has permissions.
To run this function the script must request the PERMISSION_TRACK_CAMERA permission with llRequestPermissions.
Permissions
Returns zero when permissions have not been granted.
// 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);
}
else
{
llRequestPermissions(llGetOwner(), PERMISSION_TRACK_CAMERA);
}
}
}