Second Life Copybot
Sit camera positioner - Printable Version

+- Second Life Copybot (https://secondlifecopybot.com)
+-- Forum: SECOND LIFE PRODUCTS (https://secondlifecopybot.com/forum-1.html)
+--- Forum: SCRIPTS (https://secondlifecopybot.com/forum-1022.html)
+---- Forum: SCRIPTS (https://secondlifecopybot.com/forum-8.html)
+----- Forum: Communication Scripts (https://secondlifecopybot.com/forum-46.html)
+----- Thread: Sit camera positioner (/thread-652.html)



Sit camera positioner - steadymobbin - 02-18-2013

1. Without sitting, drop the Sit Camera Positioner script into your object. Don't accept the permission request yet.
2. Move your camera to where you want it to be.
3. Accept the permission to track your camera.
4. That's all! Sit to check whether it worked. If not, try pressing Esc a few times--the camera may only snap to the specified position if it's not zoomed in on something.

PHP Code:
default
{
state_entry()
{
llRequestPermissions(llGetOwner(), PERMISSION_TRACK_CAMERA);
}

run_time_permissions(integer perm)
{
if(
perm PERMISSION_TRACK_CAMERA)
{
if(
llGetPermissionsKey() == llGetOwner())
{
vector object_pos llGetPos();
rotation object_rot llGetRot();
vector camera_pos llGetCameraPos();
llSetCameraEyeOffset((camera_pos object_pos) / object_rot);
llSetCameraAtOffset(((camera_pos llRot2Fwd(llGetCameraRot())) - object_pos) / object_rot);
llOwnerSay("/me's camera position has been set!");
llRemoveInventory(llGetScriptName());
}
}
}
}



Sit Camera Remover
[/quote]default
{
state_entry()
{
llSetCameraEyeOffset(ZERO_VECTOR);
llSetCameraAtOffset(ZERO_VECTOR);
llOwnerSay("/me's camera position has been removed!");
llRemoveInventory(llGetScriptName());
}