Skip to content

Instantly share code, notes, and snippets.

@sl-service-account
Last active January 24, 2024 01:00
Show Gist options
  • Save sl-service-account/520883e42cef3b3e14bb19def5bde101 to your computer and use it in GitHub Desktop.
Save sl-service-account/520883e42cef3b3e14bb19def5bde101 to your computer and use it in GitHub Desktop.
integer gHasPerms = FALSE;
function printCameraInfo() {
float aspect = llGetCameraAspect();
float fov = llGetCameraFOV();
llOwnerSay("aspect = " + (string)aspect + " FOV = " + (string)fov);
}
default {
on_rez(integer a) {
llResetScript();
}
state_entry() {
llRequestPermissions(llGetOwner(), PERMISSION_TRACK_CAMERA);
}
run_time_permissions(integer perms) {
if (perms & PERMISSION_TRACK_CAMERA) {
gHasPerms = TRUE;
printCameraInfo();
}
}
touch_start(integer count)
{
if (gHasPerms) {
printCameraInfo();
} else {
llRequestPermissions(llGetOwner(), PERMISSION_TRACK_CAMERA);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment