Class: MockDevice
Mock of the X-Ray engine device() singleton for jest/node.
Implements
render_device
Constructors
Constructor
new MockDevice(): MockDevice;Returns
MockDevice
Methods
create()
static create(): MockDevice;Returns
MockDevice
getInstance()
static getInstance(): MockDevice;Returns
MockDevice
mock()
static mock(): render_device;Returns
render_device
Properties
aspect_ratio
aspect_ratio: number;Current viewport aspect ratio.
Implementation of
render_device.aspect_ratiocam_dir
cam_dir: vector;Camera forward direction.
Implementation of
render_device.cam_dircam_pos
cam_pos: vector;Camera world position.
Implementation of
render_device.cam_poscam_right
cam_right: vector;Camera right direction.
Implementation of
render_device.cam_rightcam_top
cam_top: vector;Camera up direction.
Implementation of
render_device.cam_topf_time_delta
f_time_delta: number = 0;Last frame time delta in seconds.
Remarks
This value is 0 while the game timer is paused.
Implementation of
render_device.f_time_deltafov
fov: number = 70;Current field of view.
Implementation of
render_device.fovframe
frame: number = 0;Current render frame number.
Implementation of
render_device.frameglobalTime
globalTime: number = 0;height
height: number = 1080;Backbuffer height in pixels.
Implementation of
render_device.heightis_paused
is_paused: Mock<() => boolean>;Check whether the render device is paused.
Returns
Whether game rendering is paused.
Implementation of
render_device.is_pausedisPaused
isPaused: boolean = false;pause
pause: Mock<(paused: boolean) => void>;Change game pause state.
Remarks
Pauses the game timer but not sound emitters. Dedicated servers and benchmark mode ignore pause requests.
Param
paused
Whether the game should be paused.
Implementation of
render_device.pauseprecache_frame
precache_frame: number = 0;Remaining precache frame count.
Implementation of
render_device.precache_frametime_delta
time_delta: number = 0;Last frame time delta in milliseconds.
Remarks
This value is 0 while the game timer is paused.
Implementation of
render_device.time_deltatime_global
time_global: Mock<() => number>;Get current game timestamp.
Remarks
Reads the frame-updated Device.dwTimeGlobal value.
Example
`29319`, `46297`Returns
Milliseconds from game start.
Implementation of
render_device.time_globalwidth
width: number = 1920;Backbuffer width in pixels.
Implementation of
render_device.widthinstance
protected static instance: MockDevice | null = null;