Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: Simple Camera Attachment

Frost White
Second Life Resident
Join date: 3 Nov 2004
Posts: 44
03-17-2006 15:04
Before people start making you pay a lot of linden for a simple script like this, i decided to hand out a free open source one. I used the available script from the LSL wiki, made mods so it simulates regular camera movement but with a little swing to it. This is something that shield users will love since you no longer have to worry about your inner shield zooming your camera up to your neck. I post this here in hopes it wil be usefull, and hopes that any bugs in it can be fixed and re posted here to correct it. The more perfected it is the better it is for you to use. pass it along and enjoy.

-Frostfox

CODE

key id;
default
{
attach(key id)
{
if (id == NULL_KEY)
{
if (llGetPermissions() & PERMISSION_CONTROL_CAMERA)llClearCameraParams();
}
else
{
llRequestPermissions(id, PERMISSION_CONTROL_CAMERA);
llInstantMessage(id,"Online! Camera will be facing down on you until you start walking.");
}
}
run_time_permissions(integer perm)
{
if (perm & PERMISSION_CONTROL_CAMERA)
{
llSetCameraParams([

CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
CAMERA_DISTANCE, 5.0, // ( 0.5 to 10) meters
CAMERA_PITCH, 10.0, // (-45 to 80) degrees

CAMERA_BEHINDNESS_ANGLE, 0.0, // (0 to 180) degrees
CAMERA_BEHINDNESS_LAG, 0.1, // (0 to 3) seconds

CAMERA_FOCUS_OFFSET, <0.0,0.0,1.5>, // <-10,-10,-10> to <10,10,10> meters

CAMERA_FOCUS, llGetPos(), // region-relative position
CAMERA_FOCUS_LAG, 0.1, // (0 to 3) seconds
CAMERA_FOCUS_THRESHOLD, 0.1, // (0 to 4) meters
CAMERA_FOCUS_LOCKED, FALSE, // (TRUE or FALSE)

CAMERA_POSITION, llGetPos(), // region-relative position
CAMERA_POSITION_LAG, 0.5, // (0 to 3) seconds
CAMERA_POSITION_THRESHOLD, 0.5, // (0 to 4) meters
CAMERA_POSITION_LOCKED, FALSE // (TRUE or FALSE)

]);
}
}
}
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Original Thread
03-20-2006 08:34
/15/d4/94301/1.html
_____________________
i've got nothing. ;)
Pericat Aquitaine
Registered User
Join date: 26 Feb 2006
Posts: 24
works like a charm
03-22-2006 10:40
Very nice! I've integrated your code into both of my boats with no difficulty whatsoever. Thanks for taking the time to post it.
_____________________
I like ducks. They're just so... ducky.