Example: mirv_calcs: move camera around player origin - advancedfx/advancedfx GitHub Wiki

// save in movie making config folder as pl.cfg, then exec pl to enable.

mirv_calcs handle add localPlayer localPlayer
mirv_calcs handle add observerTarget observerTarget localPlayer

mirv_calcs vecAng add handle observerTarget observerTarget

mirv_calcs vecAng add globalToLocal playerLocal observerTarget observerTarget

mirv_calcs vecAng add switchInterp playerLocalSmooth playerLocal observerTarget observerTarget 0.5 0.5

mirv_calcs cam add current current
mirv_calcs vecAng add cam current current
mirv_calcs fov add cam current current


mirv_calcs handle add value invalid -1
mirv_calcs cam add smooth currentSmooth current invalid

mirv_calcs cam edit currentSmooth halfTime 0.2 // sets all half life time for vec (position), and (rotation), fov (field of view) to same value in seconds.

// Uncomment to set independently:
// mirv_calcs cam edit smooth halfTimeVec 0.2
// mirv_calcs cam edit smooth halfTimeAng 0.2 // Tip: Use 0 value to disable smoothing, or use e.g. 0.1 value for lower delay and less smoothing.
// mirv_calcs cam edit smooth halfTimeFov 0.2

mirv_calcs vecAng add cam currentSmooth currentSmooth
mirv_calcs fov add cam currentSmooth currentSmooth


mirv_calcs vecAng add offset playerLocalOfs playerLocalSmooth currentSmooth 1

mirv_calcs vecAng add localToGlobal playerFinal playerLocalOfs observerTarget

mirv_cam source calcVecAng playerFinal

mirv_cam order default
mirv_cam order move input 0
mirv_cam order move camSource 1

mirv_input cfg offsetMode
mirv_input cfg offsetMode ownLast
mirv_input cfg ksens 0.5
mirv_input cfg msens 0.05
mirv_input camera
mirv_input position 50 0 60
mirv_input angles 0 -179.9 0
mirv_input fov 90

spec_mode 5

echo +----------------------------------------------------------+
echo | Camera player_local_config enabled.
echo +----------------------------------------------------------+
echo | Camera is controlled by observer target.
echo | To quit this whole mode enter: player_local_config_end
echo +----------------------------------------------------------+

alias player_local_config_end "mirv_cam source calcVecAngClear; mirv_cam order default; mirv_input cfg offsetMode current; mirv_input end"

See also