commonlibsse_ng\re\t/
TESCameraState.rs

1use crate::re::BGSLoadFormBuffer::BGSLoadFormBuffer;
2use crate::re::BGSSaveFormBuffer::BGSSaveFormBuffer;
3use crate::re::BSIntrusiveRefCounted::BSIntrusiveRefCounted;
4use crate::re::BSTSmartPointer::BSTSmartPointer;
5use crate::re::NiPoint3::NiPoint3;
6use crate::re::NiQuaternion::NiQuaternion;
7use crate::re::PlayerCamera::CameraState;
8use crate::re::TESCamera::TESCamera;
9use crate::re::offsets_rtti::RTTI_TESCameraState;
10use crate::re::offsets_vtable::VTABLE_TESCameraState;
11use crate::rel::id::VariantID;
12use core::ffi::c_void;
13
14#[repr(C)]
15#[derive(Debug)]
16pub struct TESCameraState {
17    pub vtable: *const TESCameraStateVtbl, // 0x00
18    pub __base: BSIntrusiveRefCounted,     // 0x08
19    pub pad0C: u8,                         // 0x0C
20    pub camera: *mut TESCamera,            // 0x10
21    pub id: CameraState,                   // 0x18
22    pub pad34: u32,                        // 0x1C
23}
24const _: () = assert!(std::mem::size_of::<TESCameraState>() == 0x20);
25
26impl TESCameraState {
27    /// Address & offset of the runtime type information (RTTI) identifier.
28    pub const RTTI: VariantID = RTTI_TESCameraState;
29
30    /// Address & offset of the virtual function table.
31    pub const VTABLE: [VariantID; 1] = VTABLE_TESCameraState;
32}
33
34impl crate::re::BSIntrusiveRefCounted::BSIntrusiveRefCountedTrait for TESCameraState {
35    #[inline]
36    fn inc_ref(&self) -> u32 {
37        self.__base.inc_ref()
38    }
39
40    #[inline]
41    fn dec_ref(&self) -> u32 {
42        self.__base.dec_ref()
43    }
44}
45
46#[repr(C)]
47#[derive(Debug)]
48pub struct TESCameraStateVtbl {
49    /// C++ Destructor `~TESCamera`
50    pub CxxDrop: fn(this: *mut c_void), // 0x00
51    pub Begin: fn(this: *mut c_void), // 0x01
52    pub End: fn(this: *mut c_void),   // 0x02
53
54    pub Unk_03: fn(this: *mut c_void), // 0x03 - VR only
55
56    pub Update: fn(this: *mut c_void, nextState: &BSTSmartPointer<TESCameraState>), // 0x03
57    pub GetRotation: fn(this: *mut c_void, rotation: &NiQuaternion),                // 0x04
58    pub GetTranslation: fn(this: *mut c_void, translation: &NiPoint3),              // 0x05
59    pub SaveGame: fn(this: *mut c_void, buf: &BGSSaveFormBuffer),                   // 0x06
60    pub LoadGame: fn(this: *mut c_void, buf: *mut BGSLoadFormBuffer),               // 0x07
61    pub Revert: fn(this: *mut c_void, buf: *mut BGSLoadFormBuffer),                 // 0x08
62}
63const _: () = {
64    const VFUNC_COUNT: usize = 0x9 + 1;
65
66    const EXPECTED_SIZE: usize = VFUNC_COUNT * core::mem::size_of::<usize>();
67    assert!(core::mem::size_of::<TESCameraStateVtbl>() == EXPECTED_SIZE);
68};