Last active
January 24, 2024 01:00
-
-
Save sl-service-account/520883e42cef3b3e14bb19def5bde101 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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