Don't click here unless you want to be banned.

LSL Wiki : llSetCameraParams

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawling22.us.archive.org
llSetCameraParams(list rules)

Sets multiple camera parameters at once.
List format is [rule1, value1, rule2, value2 . . . ruleN, valueN]

Requires PERMISSION_CONTROL_CAMERA. The agent/avatar camera function targets the agent that gave PERMISSION_CONTROL_CAMERA to the script. (The UUID of which is returned by llGetPermissionsKey.)

For more information and example script see follow cam.

Rule Value Type Default Value Range Description
CAMERA_ACTIVE 12 integer isActive FALSE TRUE or FALSE Turns on or off scripted control of the camera.
CAMERA_BEHINDNESS_ANGLE 8 float degrees 10.0 0 to 180 Sets the angle in degrees within which the camera is not constrained by changes in target rotation.
CAMERA_BEHINDNESS_LAG 9 float seconds 0.0 0 to 3 Sets how strongly the camera is forced to stay behind the target if outside of behindness angle.
CAMERA_DISTANCE 7 float meters 3.0 0.5 to 10 Sets how far away the camera wants to be from its target.
CAMERA_FOCUS 17 vector position n/a n/a Sets camera focus (target position) in region coordinates.
CAMERA_FOCUS_LAG 6 float seconds 0.1 0 to 3 How much the camera lags as it tries to aim towards the target.
CAMERA_FOCUS_LOCKED 22 integer isLocked FALSE TRUE or FALSE Locks the camera focus so it will not move.
CAMERA_FOCUS_OFFSET 1 vector meters <0.0, 0.0, 0.0> <-10,-10,-10> to <10,10,10> Adjusts the camera focus position relative to the target.
CAMERA_FOCUS_THRESHOLD 11 float meters 1.0 0 to 4 Sets the radius of a sphere around the camera's target position within which its focus is not affected by target motion.
CAMERA_PITCH 0 float degrees 0.0 -45 to 80 Adjusts the angular amount that the camera aims straight ahead vs. straight down, maintaining the same distance; analogous to 'incidence'.
CAMERA_POSITION 13 vector position n/a n/a Sets camera position in region coordinates.
CAMERA_POSITION_LAG 5 float seconds 0.1 0 to 3 How much the camera lags as it tries to move towards its 'ideal' position.
CAMERA_POSITION_LOCKED 21 integer isLocked FALSE TRUE or FALSE Locks the camera position so it will not move.
CAMERA_POSITION_THRESHOLD 10 float meters 1.0 0 to 4 Sets the radius of a sphere around the camera's ideal position within which it is not affected by target motion.
Example using default values:

llSetCameraParams([
        CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive
        CAMERA_BEHINDNESS_ANGLE, 10.0, // (0 to 180) degrees
        CAMERA_BEHINDNESS_LAG, 0.0, // (0 to 3) seconds
        CAMERA_DISTANCE, 3.0, // ( 0.5 to 10) meters
        // CAMERA_FOCUS, <0,0,0>, // region-relative position
        CAMERA_FOCUS_LAG, 0.1 , // (0 to 3) seconds
        CAMERA_FOCUS_LOCKED, FALSE, // (TRUE or FALSE)
        CAMERA_FOCUS_THRESHOLD, 1.0, // (0 to 4) meters
        CAMERA_PITCH, 0.0, // (-45 to 80) degrees
        // CAMERA_POSITION, <0,0,0>, // region-relative position
        CAMERA_POSITION_LAG, 0.1, // (0 to 3) seconds
        CAMERA_POSITION_LOCKED, FALSE, // (TRUE or FALSE)
        CAMERA_POSITION_THRESHOLD, 1.0, // (0 to 4) meters
        CAMERA_FOCUS_OFFSET, ZERO_VECTOR // <-10,-10,-10> to <10,10,10> meters
    ]);

Q: How can you make the camera move smoothly from one CAMERA_POSITION to another? Or pan smoothly from one CAMERA_FOCUS to another?
A: Hmm thats a tough one. What you could do, is have a volume-detect prim as a vehical, then have the avatar sit on the vehical, next drop the camera at the static location. Make the box invisible and have the avatar underground (flip the box upside down). That may allow you to move the box, which should change the focus. If you made the camera follow instead, you could use that to change it's position. - BW

Q: It seems like the camera only moves into its position when the user touches a the Left or Right rotate key. Does this make any sense?
A: Sounds like an issue with one of the Threshold parameters - Anon


Functions | Agent/Avatar | Camera
Comments [Hide comments/form]
Hey all, I seperated Type/Default/Value Range column - my browser was linebreaking it where it shouldnt have broken. (Kinda confused me for a second).
-- ChristopherOmega (2006-02-10 14:04:35)
yeah i did that, i thought it would look better/easier to read. Though it didn't really
-- BlindWanderer (2006-02-10 16:48:47)
Again with ordering by values? I thought we discussed (and it was resolved to be) this in llParticleSystem that normal people don't sort by return value but by parameter name?
-- EepQuirk (2006-03-08 11:06:52)
Yes, dearly please order by parameter name, it makes more sense and is much easier to look at all of the parameters..
-- KairaOverdrive (2006-03-15 13:51:58)
I think the scripted camera is only active if it is not manually moved. Thats the reason why the params are only affecting your cam as soon as you start walking, rotating or press ESC which sets the cam to default. I havent found a way to fix that, but maybe moving or rotating the AV would help to trigger cam catching up.
-- p54A33926.dip0.t-ipconnect.de (2007-06-09 22:55:34)
Attach a comment to this page: