GRW ScriptHook 0.11.0
Plugin API for Ghost Recon Wildlands
Loading...
Searching...
No Matches
Camera

Per field ownership, so plugins compose. More...

Data Structures

struct  ShCamera
 Rows of the pose matrix: right, forward, up, then position. More...
struct  ShCameraOverride

Macros

#define SH_CAM_POS   0x01
 Everything the camera object exposes, in one call.
#define SH_CAM_ROT   0x02
#define SH_CAM_FOV   0x04
#define SH_CAM_SKEW   0x08
#define SH_CAM_MODE   0x10

Functions

SH_API int ShCameraHookInstall (void)
 Redirect the selector thunk.
SH_API int ShCameraReady (void)
SH_API uint64_t ShCameraCalls (void)
SH_API uint64_t ShCameraWrites (void)
SH_API int ShSetCameraBlur (int on)
 The close range body blur, a hidden proximity fade the menu's DoF settings leave running.
SH_API int ShCameraBlurOff (void)
SH_API int ShGetCamera (ShCamera *out)
 Where the camera is, and how it is pointed.
SH_API int ShSetCamera (const ShVec3 *pos)
 The engine rebuilds the camera every frame, so an override is reapplied until it is released.
SH_API int ShCameraOrbit (float back, float up)
SH_API int ShCameraFree (const ShVec3 *pos, float yaw, float pitch)
 Free camera.
SH_API int ShCameraAngles (float *yaw, float *pitch)
SH_API void ShCameraRelease (void)
SH_API void ShCameraReleaseFields (uint32_t fields)
 Ownership is per field, so plugins compose.
SH_API uint32_t ShCameraOwned (void)
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.
SH_API int ShGetHeadPosition (ShVec3 *out)
 The head in world space, from the bone named Head.
SH_API int ShHeadBone (void)
SH_API int ShCameraApply (const ShCameraOverride *o)
 Reapplied every frame until ShCameraRelease.
SH_API int ShCameraMatrix (int index, float *out16)
 The nine derived matrices at camera+0x420, view and projection and their inverses.

Detailed Description

Per field ownership, so plugins compose.

Macro Definition Documentation

◆ SH_CAM_POS

#define SH_CAM_POS   0x01

Everything the camera object exposes, in one call.

Set only the bits you want; the engine keeps the rest.

◆ SH_CAM_ROT

#define SH_CAM_ROT   0x02

◆ SH_CAM_FOV

#define SH_CAM_FOV   0x04

◆ SH_CAM_SKEW

#define SH_CAM_SKEW   0x08

◆ SH_CAM_MODE

#define SH_CAM_MODE   0x10

Function Documentation

◆ ShCameraHookInstall()

SH_API int ShCameraHookInstall ( void )

Redirect the selector thunk.

Done for you on demand.

◆ ShCameraReady()

SH_API int ShCameraReady ( void )

◆ ShCameraCalls()

SH_API uint64_t ShCameraCalls ( void )

◆ ShCameraWrites()

SH_API uint64_t ShCameraWrites ( void )

◆ ShSetCameraBlur()

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.

◆ ShCameraBlurOff()

SH_API int ShCameraBlurOff ( void )

◆ ShGetCamera()

SH_API int ShGetCamera ( ShCamera * out)

Where the camera is, and how it is pointed.

◆ ShSetCamera()

SH_API int ShSetCamera ( const ShVec3 * pos)

The engine rebuilds the camera every frame, so an override is reapplied until it is released.

◆ ShCameraOrbit()

SH_API int ShCameraOrbit ( float back,
float up )

◆ ShCameraFree()

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.

◆ ShCameraAngles()

SH_API int ShCameraAngles ( float * yaw,
float * pitch )

◆ ShCameraRelease()

SH_API void ShCameraRelease ( void )

◆ ShCameraReleaseFields()

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.

◆ ShCameraOwned()

SH_API uint32_t ShCameraOwned ( void )

◆ ShCameraFirstPerson()

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.

◆ ShGetHeadPosition()

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.

◆ ShHeadBone()

SH_API int ShHeadBone ( void )

◆ ShCameraApply()

SH_API int ShCameraApply ( const ShCameraOverride * o)

Reapplied every frame until ShCameraRelease.

◆ ShCameraMatrix()

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.