commonlibsse_ng\re\p\PlayerCamera/
runtime_data.rs

1use crate::re::BSAtomic::BSSpinLock;
2use crate::re::BSCoreTypes::RefHandle;
3use crate::re::BSTArray::BSTSmallArray;
4use crate::re::BSTSmartPointer::BSTSmartPointer;
5use crate::re::CrosshairPickData::bhkSimpleShapePhantom;
6use crate::re::NiSmartPointer::NiPointer;
7use crate::re::TESCameraState::TESCameraState;
8use crate::re::bhkRigidBody;
9
10use super::{CameraStateSE_CEnum, CameraStateVR_CEnum};
11
12#[repr(C)]
13#[derive(Debug)]
14pub struct Unk120 {
15    pub unk00: NiPointer<bhkSimpleShapePhantom>,
16    pub unk08: NiPointer<bhkSimpleShapePhantom>,
17}
18const _: () = assert!(core::mem::size_of::<Unk120>() == 0x10);
19
20const TEMP_RETURN_STATES_TOTAL: usize = CameraStateSE_CEnum::count();
21const CAMERA_STATES_SIZE: usize = CameraStateSE_CEnum::count();
22
23#[repr(C)]
24#[derive(Debug)]
25pub struct RUNTIME_DATA {
26    pub tempReturnStates: BSTSmallArray<*mut TESCameraState, TEMP_RETURN_STATES_TOTAL>, // 0x040, VR 0x040
27    pub cameraStates: [BSTSmartPointer<TESCameraState>; CAMERA_STATES_SIZE], // 0x0B8, VR 0x0C0
28    pub unk120: *mut Unk120,                                                 // 0x120,
29    pub rigidBody: NiPointer<bhkRigidBody>,                                  // 0x128, VR 0x130
30    pub objectFadeHandle: RefHandle,                                         // 0x130, VR 0x138
31    pub lock: BSSpinLock,                                                    // 0x134, VR 0x13c
32}
33const _: () = {
34    assert!(core::mem::offset_of!(RUNTIME_DATA, cameraStates) == 0x78);
35    assert!(core::mem::offset_of!(RUNTIME_DATA, rigidBody) == 0xE8);
36    assert!(core::mem::offset_of!(RUNTIME_DATA, objectFadeHandle) == 0xF0);
37    assert!(core::mem::offset_of!(RUNTIME_DATA, lock) == 0xF4);
38
39    assert!(core::mem::size_of::<RUNTIME_DATA>() == 0x100);
40};
41
42const VR_TEMP_RETURN_STATES_TOTAL: usize = CameraStateVR_CEnum::count();
43const VR_CAMERA_STATES_SIZE: usize = CameraStateVR_CEnum::count();
44
45#[repr(C)]
46#[derive(Debug)]
47pub struct VR_RUNTIME_DATA {
48    pub tempReturnStates: BSTSmallArray<*mut TESCameraState, VR_TEMP_RETURN_STATES_TOTAL>, // 0x040, VR 0x040
49    pub cameraStates: [BSTSmartPointer<TESCameraState>; VR_CAMERA_STATES_SIZE], // 0x0B8, VR 0x0C0
50    pub rigidBody: NiPointer<bhkRigidBody>,                                     // 0x128, VR 0x130
51    pub objectFadeHandle: RefHandle,                                            // 0x130, VR 0x138
52    pub lock: BSSpinLock,                                                       // 0x134, VR 0x13c
53    pub VR_pad144: [u8; 14],
54}
55const _: () = {
56    assert!(core::mem::offset_of!(VR_RUNTIME_DATA, cameraStates) == 0x80);
57    assert!(core::mem::offset_of!(VR_RUNTIME_DATA, rigidBody) == 0xF0);
58    assert!(core::mem::offset_of!(VR_RUNTIME_DATA, objectFadeHandle) == 0xF8);
59    assert!(core::mem::offset_of!(VR_RUNTIME_DATA, lock) == 0xFC);
60
61    assert!(core::mem::size_of::<VR_RUNTIME_DATA>() == 0x118);
62};