Skip to content

Camera ​

Group camera · 25 exports · from forks/gamexueren/scripthook.h (framework 1.0-beta7-wildm1, SH_API_VERSION 2)

Per field ownership, so plugins compose.

ExportSummary
ShCameraHookInstallRedirect the selector thunk.
ShCameraReadySee ShCameraHookInstall.
ShCameraCallsSee ShCameraHookInstall.
ShCameraWritesSee ShCameraHookInstall.
ShCameraViewMode—
ShCameraFirstPersonActiveShCameraViewMode() == SH_VIEW_FIRST_PERSON.
ShCameraHandoverClearDrop the "we just handed the camera back" grace, see ShCameraViewMode.
ShCameraAimRigOnWhether the eye is walked onto the engine's own aim seat while an aim is up, and the switch for it.
ShCameraAimRigSetSee ShCameraAimRigOn.
ShSetCameraBlurThe close range body blur, a hidden proximity fade the menu's DoF settings leave running.
ShCameraBlurOffSee ShSetCameraBlur.
ShGetCameraWhere the camera is, and how it is pointed.
ShSetCameraThe engine rebuilds the camera every frame, so an override is reapplied until it is released.
ShCameraOrbitSee ShSetCamera.
ShCameraOrbitAdvancedThe same orbit with a sideways axis: metres along the camera's right vector, which is what an over-the-shoulder offset is.
ShCameraFreeFree camera.
ShCameraAnglesSee ShCameraFree.
ShCameraReleaseSee ShCameraFree.
ShCameraReleaseFieldsOwnership is per field, so plugins compose.
ShCameraOwnedSee ShCameraReleaseFields.
ShCameraFirstPersonFirst person: the eye tracks the head bone every frame and eases onto the aim ray during ADS, so sights stay centered.
ShGetHeadPositionThe head in world space, from the bone named Head.
ShHeadBoneSee ShGetHeadPosition.
ShCameraApplyReapplied every frame until ShCameraRelease.
ShCameraMatrixThe 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

WildM is an independent community project. It is not affiliated with or endorsed by Ubisoft. Ghost Recon Wildlands is a trademark of Ubisoft Entertainment.