Log Entries
• November 2007
• December 2007
• January 2008
• February 2008
• March 2008
• May 2008
• June 2008
• July 2008
• August 2008
• September 2008
• October 2008
• November 2008
• The history of the SL Dumpster
script by Moriash Moreau
// Simple Camera Lock // by // Moriash Moreau, 12/17/06 // // You may this script for whatever purpose you like, provided it's legal // and doesn't violate the SL TOS. Be excellent to each other. Party on. // Instructions: // Insert this script in a small prim. Attach the prim to any convenient HUD position. // Maneuver your camera to the desired camera position (see F1 Help->Basic Help->Camera Controls). // Say "/2 lock" to store the current camera position. Then, to return your camera to that // position, either touch the HUD prim or say "/2 camera". Touch or say "/2 camera" again // to release camera control. Note that your avatar must be within approximately 50 meters // of the stored camera position for the camera lock to function properly. // INTERNAL VARIABLES integer Toggle; integer Listener; vector CamPos; rotation CamRot; vector CamFoc; // Ask for permissions. Start up the Listen again (to deal with changes in ownership). Init() { llRequestPermissions(llGetOwner(), PERMISSION_CONTROL_CAMERA | PERMISSION_ATTACH | PERMISSION_TRACK_CAMERA ); llListenRemove(Listener); Listener = llListen(2, "", llGetOwner() , "" ); Toggle = FALSE; llSetColor(<1,0,0>,ALL_SIDES); } // Toggle the camera lock on and off. CamToggle() { if (Toggle) { llClearCameraParams(); //llSetAlpha(1.0,ALL_SIDES); //Add this line if you are photographing with HUDs on. llSetColor(<1,0,0>,ALL_SIDES); llOwnerSay("Releasing camera control."); Toggle = FALSE; } else { Toggle = TRUE; //llSetAlpha(0.0,ALL_SIDES); //Add this line if you are photographing with HUDs on. llSetColor(<0,1,0>,ALL_SIDES); llOwnerSay("Returning to locked camera position."); llSetCameraParams([ CAMERA_ACTIVE, TRUE, CAMERA_FOCUS, CamFoc, CAMERA_FOCUS_LOCKED, TRUE, CAMERA_POSITION, CamPos, CAMERA_POSITION_LOCKED, TRUE ]); } } default { state_entry() { Init(); } attach(key id) { // If we're detaching, clear the camera. if (id == NULL_KEY) { if (llGetPermissions() & PERMISSION_CONTROL_CAMERA) { llClearCameraParams(); } } // If we're attaching, initialize the camera lock. else { Init(); } } // Sort through required permissions. run_time_permissions(integer perm) { if (perm & PERMISSION_CONTROL_CAMERA | PERMISSION_ATTACH | PERMISSION_TRACK_CAMERA ) { llOwnerSay("Camera control enabled."); } else { llOwnerSay("Camera control refused. Detaching."); llDetachFromAvatar(); } } // Turn the camera lock on and off. touch_start(integer total_number) { CamToggle(); } listen( integer channel, string name, key id, string message ) { // Alternate method of turning the camera lock on and off. if (message == "camera") { CamToggle(); } // Read and store the current camera position. else if (message == "lock") { llOwnerSay("Storing current camera position."); CamPos = llGetCameraPos(); CamRot = llGetCameraRot(); CamFoc = CamPos + llRot2Fwd(CamRot); } } }