## Proposal
Very familiar syntax per
llSetKeyframedMotion
but for moving a camera through space with various options.
* Client-side moves smoothly through the keyframes specified
* KFM mode equivalent options available for e.g. forward, reverse, loop, ping pong
* KFM command equiv to pause, resume, stop
* Meant to be a single elegant function that achieves several usecases and familiar syntax
llSetKeyframedCamera
overrides (higher priority) but does not replace
llSetCameraParams
. If
llSetCameraParams
is set then pressing ESC should disable the keyframed camera and resume back to
llSetCameraParams
over
KFC_EASE_OUT
or
CAMERA_*_LAG
.
llSetKeyframedCamera( list keyframes, list options );
Keyframes is a strided list of keyframe same as per
llSetKeyframedMotion
.
KFC_*
constants duplicate of
KFM_*
s or reuse the KFM constants.
Requires
PERMISSION_CONTROL_CAMERA
or experience permissions.
Keyframe list is uploaded to client with the options. Ping / time of function call / region time dilation should all be taken into account: Viewer skips/seeks forward to the appropriate frame between keyframes based on when function was called. Also the time delta between frames is affected by region dilation. This is so that a good attempt is made so that scripts can sync up in terms of
llGetTime()
.
Calling
llSetKeyframedCamera
again should take into account the last keyframed camera position when it comes to
KFC_EASE_IN
.
Camera should obey roll rotations on keyframes. For mouselook this is similar to sitting on a tilted object.
Additionally:
* An option to specify absolute/local coordinates instead of relative deltas (as client-side has no physics engine tie-in to require the deltas, default to non-delta for ease of use)
*
KFC_EASE_IN, float time
— ease-in camera from current mode (mouselook, third person, alt-cam) over float seconds across beginning keyframes (equivalent to
ZoomTime
debug setting but for easing into the keyframed camera, default to
ZoomTime
, e.g. 0.4s)
*
KFC_EASE_OUT, float time
— ease-out over float seconds across end keyframes (similar per above)
*
KFC_MOUSELOOK, integer enabled
— whether user can look around in mouselook, rotation keyframes will still affect the base rotation unless decoupled
*
KFC_MOUSELOOK_FORCE, integer force
— whether to force into mouselook (equivalent to llForceMouselook but might be from a HUD)
*
KFC_MOUSELOOK_DECOUPLED, integer decoupled
— whether to decouple mouselook camera to prevent it from being rotated by keyframe rotations / target (usecase: if user does not enter mouselook to look around and instead uses third person camera and lets the keyframes rotate their camera; usecase #2: vehicle mouselook camera decoupling without mouslook steering)
*
KFC_TRACK_SIT, integer enabled
— whether camera motion is coupled to sitting object, so keyframed camera moves relative to sat object (default TRUE)
*
KFC_TRACK_TARGET, integer enabled
— similar to above but target an object/avatar by UUID to move keyframed camera relatively to
*
KFC_TRACK_ROTATE, integer enabled
— whether keyframes should be rotated relatively to targets orientation instead of only position (default TRUE)
*
KFC_EASE_CUBIC, integer enabled
— whether to use cubic interpolation between keyframes (default FALSE)
* (and/or implement something like B-Spline Interpolation with weight/bias/tension parameters, e.g.
KFC_EASE_SPLINE, float bias
)
## Usecases
  • Smooth scripted camera movements through region coordinates
  • Smooth camera movement relatively to object, avatar or sat object
  • Smooth movement between static camera coordinates (via new call to
    llSetKeyframedCamera
    with
    KFC_LOOP
    &
    KFC_EASE_IN
    to ease into new static, looping camera keyframe pos)
  • Camera that follows an object / avatar (
    KFC_TRACK_TARGET
    )
  • Camera that orbits an object / avatar (keyframe list of positions around the target with rotations set to look at the center point)
  • Camera follow/orbit an object / avatar but only in terms of position (e.g. if the object / avatar rotates it won't cause the camera to rotate, via
    KFC_TRACK_ROTATE, FALSE
    )
  • Vehicle mouselook repositioning (
    KFC_LOOP
    ,
    KFC_TRACK_SIT
    ,
    KFC_MOUSELOOK
    )
  • Pausing, stopping or resuming keyframed camera similar to
    KFM_COMMAND
    — (however take into account the time of function call to ease into the frame it was supposed to pause at or resume from)
  • Vehicle mouselook cameras that move along a scenic orbit around the vehicle for an occupant
  • KFC_TRACK_TARGET
    can target an individual child prim of a linkset, or an attachment of an avatar to follow specifically
  • Keyframed camera that follows a keyframed motion object
  • ??? Many more usecases via creative parameter mixing
Some usecases like being able to reposition vehicle mouselook cameras for occupants relatively to the vehicle is achievably by looping a position and enabling mouselook on the keyframed camera.
·