Theme
Camera
Per field ownership, so plugins compose.
| Export | Summary |
|---|---|
ShCameraHookInstall | Redirect the selector thunk. |
ShCameraReady | See ShCameraHookInstall. |
ShCameraCalls | See ShCameraHookInstall. |
ShCameraWrites | See ShCameraHookInstall. |
ShCameraViewMode | — |
ShCameraFirstPersonActive | ShCameraViewMode() == SH_VIEW_FIRST_PERSON. |
ShCameraHandoverClear | Drop the "we just handed the camera back" grace, see ShCameraViewMode. |
ShCameraAimRigOn | Whether the eye is walked onto the engine's own aim seat while an aim is up, and the switch for it. |
ShCameraAimRigSet | See ShCameraAimRigOn. |
ShSetCameraBlur | The close range body blur, a hidden proximity fade the menu's DoF settings leave running. |
ShCameraBlurOff | See ShSetCameraBlur. |
ShGetCamera | Where the camera is, and how it is pointed. |
ShSetCamera | The engine rebuilds the camera every frame, so an override is reapplied until it is released. |
ShCameraOrbit | See ShSetCamera. |
ShCameraOrbitAdvanced | The same orbit with a sideways axis: metres along the camera's right vector, which is what an over-the-shoulder offset is. |
ShCameraFree | Free camera. |
ShCameraAngles | See ShCameraFree. |
ShCameraRelease | See ShCameraFree. |
ShCameraReleaseFields | Ownership is per field, so plugins compose. |
ShCameraOwned | See ShCameraReleaseFields. |
ShCameraFirstPerson | First person: the eye tracks the head bone every frame and eases onto the aim ray during ADS, so sights stay centered. |
ShGetHeadPosition | The head in world space, from the bone named Head. |
ShHeadBone | See ShGetHeadPosition. |
ShCameraApply | Reapplied every frame until ShCameraRelease. |
ShCameraMatrix | The nine derived matrices at camera+0x420, view and projection and their inverses. |
ShCameraHookInstall
c
SH_API int ShCameraHookInstall(void);Redirect the selector thunk. Done for you on demand.
scripthook.h, line 1857
ShCameraReady
c
SH_API int ShCameraReady(void);Documented together with ShCameraHookInstall just above.
scripthook.h, line 1858
ShCameraCalls
c
SH_API uint64_t ShCameraCalls(void);Documented together with ShCameraHookInstall just above.
scripthook.h, line 1859
ShCameraWrites
c
SH_API uint64_t ShCameraWrites(void);Documented together with ShCameraHookInstall just above.
scripthook.h, line 1860
ShCameraViewMode
c
SH_API int ShCameraViewMode(void);No doc comment in the header.
scripthook.h, line 1887
ShCameraFirstPersonActive
c
SH_API int ShCameraFirstPersonActive(void);ShCameraViewMode() == SH_VIEW_FIRST_PERSON. A consumer that hides the head only while first person is really on camera reads this, so the head comes back when the engine takes the view away.
scripthook.h, line 1894
ShCameraHandoverClear
c
SH_API void ShCameraHandoverClear(void);Drop the "we just handed the camera back" grace, see ShCameraViewMode. Turning first person off is a change of view, not a hand over to the engine's aim camera.
scripthook.h, line 1900
ShCameraAimRigOn
c
SH_API int ShCameraAimRigOn(void);Whether the eye is walked onto the engine's own aim seat while an aim is up, and the switch for it. OFF by default.
What the walk is for: the engine places the weapon and its sights from a camera of its own, roughly 14 to 22 cm from the eye at the settled end of an aim, so with the eye left alone the reticle carries a small offset that differs per weapon. The walk measures that gap and moves the eye onto the engine's seat over the aim's own transition, which centres the sights and makes the frame the engine takes at the end of an aim a frame it already agrees with.
What it costs: for the whole aim the camera is no longer on the eye, and a moving offset reads far worse than a still one. That is why it ships off - see the note at g_aimRigOn in scripthook_camera.c.
Learning runs with the walk off and the log still reports what it would have moved, so the two settings can be compared inside one session. The learned slots are kept across a toggle.
scripthook.h, line 1921
ShCameraAimRigSet
c
SH_API int ShCameraAimRigSet(int on);Documented together with ShCameraAimRigOn just above.
scripthook.h, line 1922
ShSetCameraBlur
c
SH_API int ShSetCameraBlur(int on);The close range body blur, a hidden proximity fade the menu's DoF settings leave running. on=0 removes it, on=1 restores the engine default.
scripthook.h, line 1942
ShCameraBlurOff
c
SH_API int ShCameraBlurOff(void);Documented together with ShSetCameraBlur just above.
scripthook.h, line 1943
ShGetCamera
c
SH_API int ShGetCamera(ShCamera *out);Where the camera is, and how it is pointed.
scripthook.h, line 2075
ShSetCamera
c
SH_API int ShSetCamera(const ShVec3 *pos);The engine rebuilds the camera every frame, so an override is reapplied until it is released.
scripthook.h, line 2080
ShCameraOrbit
c
SH_API int ShCameraOrbit(float back, float up);Documented together with ShSetCamera just above.
scripthook.h, line 2081
ShCameraOrbitAdvanced
c
SH_API int ShCameraOrbitAdvanced(float back, float right, float up);The same orbit with a sideways axis: metres along the camera's right vector, which is what an over-the-shoulder offset is.
scripthook.h, line 2084
ShCameraFree
c
SH_API int ShCameraFree(const ShVec3 *pos, float yaw, float pitch);Free camera. Radians, yaw 0 faces +y, pitch up positive. ShCameraAngles reads the current view to start from.
scripthook.h, line 2089
ShCameraAngles
c
SH_API int ShCameraAngles(float *yaw, float *pitch);Documented together with ShCameraFree just above.
scripthook.h, line 2090
ShCameraRelease
c
SH_API void ShCameraRelease(void);Documented together with ShCameraFree just above.
scripthook.h, line 2091
ShCameraReleaseFields
c
SH_API void ShCameraReleaseFields(uint32_t fields);Ownership is per field, so plugins compose. Release only what you took and another plugin's fields keep running.
scripthook.h, line 2096
ShCameraOwned
c
SH_API uint32_t ShCameraOwned(void);Documented together with ShCameraReleaseFields just above.
scripthook.h, line 2097
ShCameraFirstPerson
c
SH_API int ShCameraFirstPerson(float forward, float up);First person: the eye tracks the head bone every frame and eases onto the aim ray during ADS, so sights stay centered. forward clears the face.
scripthook.h, line 2103
ShGetHeadPosition
c
SH_API int ShGetHeadPosition(ShVec3 *out);The head in world space, from the bone named Head. This is the eye. ShGetPlayerPosition is NOT: it was measured 1.71m above the feet once and 2.72m another time.
scripthook.h, line 2109
ShHeadBone
c
SH_API int ShHeadBone(void);Documented together with ShGetHeadPosition just above.
scripthook.h, line 2110
ShCameraApply
c
SH_API int ShCameraApply(const ShCameraOverride *o);Reapplied every frame until ShCameraRelease.
scripthook.h, line 2137
ShCameraMatrix
c
SH_API int ShCameraMatrix(int index, float *out16);The nine derived matrices at camera+0x420, view and projection and their inverses. Index 0 to 8, 16 floats.
scripthook.h, line 2142