From df8e2bce9735af7f49016bc6632d582787978c3b Mon Sep 17 00:00:00 2001 From: RayZopf Date: Fri, 4 Apr 2014 16:18:49 +0200 Subject: [PATCH] repo cleanup --- LSL/2.)_track_their_camera.txt | 70 ----------- LSL/RequestCameraData.lsl | 213 --------------------------------- 2 files changed, 283 deletions(-) delete mode 100644 LSL/2.)_track_their_camera.txt delete mode 100644 LSL/RequestCameraData.lsl diff --git a/LSL/2.)_track_their_camera.txt b/LSL/2.)_track_their_camera.txt deleted file mode 100644 index 2033c16..0000000 --- a/LSL/2.)_track_their_camera.txt +++ /dev/null @@ -1,70 +0,0 @@ -// Camera Sharing v0.3 -// Original written by Adeon Writer and idea by Sylvie Link -// This script is open source. Wall of Text here: -// http://www.opensource.org/licenses/gpl-3.0.html - -// Script name: "2.) Track their Camera" -// This script goes into a prim along with the script called "1.) Request Camera Data" -// Once both scripts are in the same prim, wear it. - -custom_camera(vector pos, vector look) -{ - llSetCameraParams([CAMERA_ACTIVE, 1, CAMERA_FOCUS, look, CAMERA_FOCUS_LOCKED, TRUE, CAMERA_POSITION, pos, CAMERA_POSITION_LOCKED, TRUE]); -} - -default -{ - on_rez(integer start) - { - llResetScript(); - } - - state_entry() - { - - if(llGetAttached() == 0) // Rezzed, not worn - { - llSetTexture(TEXTURE_BLANK, ALL_SIDES); - llSetAlpha(1, ALL_SIDES); - llOwnerSay("Sorry, SecondLife only supports camera control for worn objects. To use Camera Sharing, delete this and wear it instead."); - } - else - { - llSetTexture(TEXTURE_TRANSPARENT, ALL_SIDES); - llSetAlpha(0, ALL_SIDES); - llRequestPermissions(llGetOwner(), PERMISSION_CONTROL_CAMERA); - } - } - - run_time_permissions(integer perm) - { - if(perm & PERMISSION_CONTROL_CAMERA) - { - llClearCameraParams(); - llReleaseCamera(llGetOwner()); - state grantedPermissions; - } - } -} - -state grantedPermissions -{ - on_rez(integer start) - { - llResetScript(); - } - - link_message(integer link, integer num, string str, key id) - { - custom_camera((vector)str, (vector)((string)id)); - } - - attach(key id) - { - if(id==NULL_KEY) - { - llClearCameraParams(); - llReleaseCamera(llGetOwner()); - } - } -} \ No newline at end of file diff --git a/LSL/RequestCameraData.lsl b/LSL/RequestCameraData.lsl deleted file mode 100644 index 0dc4e25..0000000 --- a/LSL/RequestCameraData.lsl +++ /dev/null @@ -1,213 +0,0 @@ -// Camera Sharing v0.3 -// Original written by Adeon Writer and idea by Sylvie Link -// This script is open source. Wall of Text here: -// http://www.opensource.org/licenses/gpl-3.0.html - -// Script name: "1.) Request Camera Data" -// This script goes into a prim along with the script called "2.) Track their Camera" -// Once both scripts are in the same prim, wear it. - -vector pos; -key target; -string targetFirstName; -string ownerFirstName; -//string cameraScript = "2.) Track their Camera"; // Name of the script that controls camera position/rotation. (Must be in with this script) -list avatars; - - -any_state_on_rez(integer start) -{ - llSetLinkPrimitiveParamsFast(5, [PRIM_TEXT, "", ZERO_VECTOR, 0]); - llResetScript(); -} - -any_state_listen(integer channel, string name, key id, string message) -{ - if(channel == 1) - { - if(llToLower(message) == "stop") - { - // Only listen to two people who say stop on channel 1: Either the owner, or the current target. - if(id==llGetOwner()) - { - llOwnerSay("Stopping. Your camera has been returned to you."); - llInstantMessage(target, ownerFirstName + " has stopped viewing your camera."); - llSetLinkPrimitiveParamsFast(5, [PRIM_TEXT, "", ZERO_VECTOR, 0]); - llMessageLinked(LINK_THIS, 2, "0", ""); - llResetScript(); - } - else if(id==target) - { - llOwnerSay(targetFirstName + " has requested that you stop viewing their camera. Your camera is being returned to you."); - llInstantMessage(target, "At your request, " + ownerFirstName + " has stopped viewing your camera and permissions have been revoked."); - llSetLinkPrimitiveParamsFast(5, [PRIM_TEXT, "", ZERO_VECTOR, 0]); - llMessageLinked(LINK_THIS, 2, "0", ""); - llResetScript(); - } - } - } -} - -default -{ - on_rez(integer start) - { - any_state_on_rez(start); - } - - state_entry() - { - llSetLinkPrimitiveParamsFast(5, [PRIM_TEXT, "", ZERO_VECTOR, 0]); - llMessageLinked(LINK_THIS, 2, "0", ""); - llOwnerSay("Type /1 start to begin viewing someone's camera."); - llListen(1, "", llGetOwner(), "start"); - ownerFirstName = llGetSubString(llKey2Name(llGetOwner()), 0, llSubStringIndex(llKey2Name(llGetOwner()), " ")-1); // Note to self: Request a llGetFirstName function - if(llGetAttached() != 0) - { - //llResetOtherScript(cameraScript); // Housekeeping. All llResetScripts();'s in this script rely on the fact that it will also reset this script too. - } - } - - sensor(integer num) - { - integer i; - avatars = []; - for(i=0; i, 1]); - state tracking; - } - else - { - llOwnerSay(targetFirstName + " declined your request to view their camera."); - llMessageLinked(LINK_THIS, 2, "0", ""); - llResetScript(); - } - } -} - -state tracking // Assumes target, targetFirstName, and ownerFirstName have expected values, and that script has obtained PERMISSION_TRACK_CAMERA from target -{ - on_rez(integer start) - { - any_state_on_rez(start); - } - - - link_message(integer link, integer num, string str, key id) - { - any_state_listen(num, id, id, str); // global listen event - } - - - listen(integer channel, string name, key id, string message) - { - any_state_listen(channel, name, id, message); // global listen event - } - - state_entry() - { - llListen(1, "", NULL_KEY, "stop"); // Listen for stop command - llInstantMessage(target, llKey2Name(llGetOwner()) + " has started viewing your camera. Say /1 stop at any time to revoke permission."); - llSetTimerEvent(0.05); - } - - attach(key id) - { - if(id==NULL_KEY) - { - llInstantMessage(target, llKey2Name(llGetOwner()) + " has stopped viewing your camera."); - llSetTimerEvent(0); - } - } - - timer() - { - pos = llGetCameraPos(); - llMessageLinked(LINK_THIS, 0, (string)pos, (string)(pos+llRot2Fwd(llGetCameraRot()))); - } -} \ No newline at end of file