CCamera::SetDeviceTransforms
function · camera · primitive
- Address
0x7ac640· 449 bytes, up to0x7ac800- Signature
void __thiscall (CCamera *this, const float *rect, uint32_t unused)- Meaning
- Sets the device projection from fov, rect aspect, near and far, and the view from target - eye, roll and yaw
- Confidence
- verified, proof one
- Finding
- camera#view-and-projection
- Test
camera::camera_view_lookat
Finding: View and projection in camera
0x7ada40 checks the camera and calls 0x7ac640, which sets the device's two matrices from the
camera and a viewport rectangle r of four floats. The projection is 0x5c3cc0 with the field
of view, the aspect (r[3] − r[1]) / (r[2] − r[0]), near and far; it scales x by
1/(aspect · tan θ) and y by 1/tan θ, with θ = fov / (2·√(aspect² + 1)). The view is
0x5c3e70 looking from the origin along target − eye, with up
(sin yaw · sin roll, −cos yaw · sin roll, cos roll). The eye position is not in the view.
The derivation is in the doc.
Callers 1
- CameraSetDeviceTransforms camera
Callees 4
- SetDeviceProjection gx
- SetDeviceView gx
- BuildPerspectiveMatrix gxumath
- BuildLookAtMatrix gxumath
Calls and jumps by a bare address, from tables/calls.tsv.