Skip to main content

samp_sdk/omp/generated/
player_object.rs

1//! `IPlayerObject` — generated by `cargo xtask gen-omp` from `Server/Components/Objects/objects.hpp`.
2//! Implemented by `PlayerObject` in the server's `Objects`.
3//!
4//! Do not edit: change `xtask/omp-wrappers.toml` or the generator and
5//! regenerate. Slots are clang's layout of the header for each ABI, checked
6//! against the official binaries by `cargo xtask check-abi --generated`.
7
8#![allow(unused_imports)]
9
10use crate::omp::containers::{FlatSet, HybridString, Pair, Span};
11use crate::omp::types::{
12    Colour, GTAQuat, Hours, Microseconds, Milliseconds, Minutes, Seconds, StringView, TimePoint,
13    UID, Vector2, Vector3, Vector4, WorldTimePoint,
14};
15use crate::omp::vtable::{call_vtable_small_struct, opaque, slots, virtual_fns};
16use crate::omp::*;
17
18slots! {
19    /// `void IBaseObject::setDrawDistance(float)`
20    SLOT_SET_DRAW_DISTANCE: usize = 6, 5;
21    /// `float IBaseObject::getDrawDistance()`
22    SLOT_GET_DRAW_DISTANCE: usize = 7, 6;
23    /// `void IBaseObject::setModel(int)`
24    SLOT_SET_MODEL: usize = 8, 7;
25    /// `int IBaseObject::getModel()`
26    SLOT_GET_MODEL: usize = 9, 8;
27    /// `void IBaseObject::setCameraCollision(bool)`
28    SLOT_SET_CAMERA_COLLISION: usize = 10, 9;
29    /// `bool IBaseObject::getCameraCollision()`
30    SLOT_GET_CAMERA_COLLISION: usize = 11, 10;
31    /// `void IBaseObject::move(const ObjectMoveData &)`
32    SLOT_MOVE: usize = 12, 11;
33    /// `bool IBaseObject::isMoving()`
34    SLOT_IS_MOVING: usize = 13, 12;
35    /// `void IBaseObject::stop()`
36    SLOT_STOP: usize = 14, 13;
37    /// `const ObjectMoveData & IBaseObject::getMovingData()`
38    SLOT_GET_MOVING_DATA: usize = 15, 14;
39    /// `void IBaseObject::attachToVehicle(IVehicle &, Vector3, Vector3)`
40    SLOT_ATTACH_TO_VEHICLE: usize = 16, 15;
41    /// `void IBaseObject::resetAttachment()`
42    SLOT_RESET_ATTACHMENT: usize = 17, 16;
43    /// `const ObjectAttachmentData & IBaseObject::getAttachmentData()`
44    SLOT_GET_ATTACHMENT_DATA: usize = 18, 17;
45    /// `bool IBaseObject::getMaterialData(uint32_t, const ObjectMaterialData *&)`
46    SLOT_GET_MATERIAL_DATA: usize = 19, 18;
47    /// `void IBaseObject::setMaterial(uint32_t, int, StringView, StringView, Colour)`
48    SLOT_SET_MATERIAL: usize = 20, 19;
49    /// `void IBaseObject::setMaterialText(uint32_t, StringView, ObjectMaterialSize, StringView, int, bool, Colour, Colour, ObjectMaterialTextAlign)`
50    SLOT_SET_MATERIAL_TEXT: usize = 21, 20;
51    /// `void IPlayerObject::attachToObject(IPlayerObject &, Vector3, Vector3)`
52    SLOT_ATTACH_TO_OBJECT: usize = 22, 21;
53    /// `void IPlayerObject::attachToPlayer(IPlayer &, Vector3, Vector3)`
54    SLOT_ATTACH_TO_PLAYER: usize = 23, 22;
55}
56
57virtual_fns! {
58    /// `void IBaseObject::setDrawDistance(float)`.
59    ///
60    /// # Safety
61    /// `player_object` must be a live `IPlayerObject`.
62    pub fn player_object_set_draw_distance(
63        player_object: IPlayerObject,
64        draw_distance: f32,
65    ) = [0, SLOT_SET_DRAW_DISTANCE];
66
67    /// `float IBaseObject::getDrawDistance()`.
68    ///
69    /// # Safety
70    /// `player_object` must be a live `IPlayerObject`.
71    #[must_use]
72    pub fn player_object_draw_distance(
73        player_object: IPlayerObject,
74    ) -> f32 = [0, SLOT_GET_DRAW_DISTANCE] or 0.0;
75
76    /// `void IBaseObject::setModel(int)`.
77    ///
78    /// # Safety
79    /// `player_object` must be a live `IPlayerObject`.
80    pub fn player_object_set_model(player_object: IPlayerObject, model: i32) = [0, SLOT_SET_MODEL];
81
82    /// `int IBaseObject::getModel()`.
83    ///
84    /// # Safety
85    /// `player_object` must be a live `IPlayerObject`.
86    #[must_use]
87    pub fn player_object_model(player_object: IPlayerObject) -> i32 = [0, SLOT_GET_MODEL] or 0;
88
89    /// `void IBaseObject::setCameraCollision(bool)`.
90    ///
91    /// # Safety
92    /// `player_object` must be a live `IPlayerObject`.
93    pub fn player_object_set_camera_collision(
94        player_object: IPlayerObject,
95        collision: bool,
96    ) = [0, SLOT_SET_CAMERA_COLLISION];
97
98    /// `bool IBaseObject::getCameraCollision()`.
99    ///
100    /// # Safety
101    /// `player_object` must be a live `IPlayerObject`.
102    #[must_use]
103    pub fn player_object_camera_collision(
104        player_object: IPlayerObject,
105    ) -> bool = [0, SLOT_GET_CAMERA_COLLISION] or false;
106
107    /// `void IBaseObject::move(const ObjectMoveData &)`.
108    ///
109    /// # Safety
110    /// `player_object` must be a live `IPlayerObject`.
111    pub fn player_object_move(player_object: IPlayerObject, data: &ObjectMoveData) = [0, SLOT_MOVE];
112
113    /// `bool IBaseObject::isMoving()`.
114    ///
115    /// # Safety
116    /// `player_object` must be a live `IPlayerObject`.
117    #[must_use]
118    pub fn player_object_is_moving(
119        player_object: IPlayerObject,
120    ) -> bool = [0, SLOT_IS_MOVING] or false;
121
122    /// `void IBaseObject::stop()`.
123    ///
124    /// # Safety
125    /// `player_object` must be a live `IPlayerObject`.
126    pub fn player_object_stop(player_object: IPlayerObject) = [0, SLOT_STOP];
127
128    /// `const ObjectMoveData & IBaseObject::getMovingData()`.
129    ///
130    /// # Safety
131    /// `player_object` must be a live `IPlayerObject`.
132    #[must_use]
133    pub fn player_object_moving_data(
134        player_object: IPlayerObject,
135    ) -> *const ObjectMoveData = [0, SLOT_GET_MOVING_DATA] or std::ptr::null();
136
137    /// `void IBaseObject::attachToVehicle(IVehicle &, Vector3, Vector3)`.
138    ///
139    /// # Safety
140    /// `player_object` must be a live `IPlayerObject`.
141    pub fn player_object_attach_to_vehicle(
142        player_object: IPlayerObject,
143        vehicle: *mut IVehicle,
144        offset: Vector3,
145        rotation: Vector3,
146    ) = [0, SLOT_ATTACH_TO_VEHICLE];
147
148    /// `void IBaseObject::resetAttachment()`.
149    ///
150    /// # Safety
151    /// `player_object` must be a live `IPlayerObject`.
152    pub fn player_object_reset_attachment(
153        player_object: IPlayerObject,
154    ) = [0, SLOT_RESET_ATTACHMENT];
155
156    /// `const ObjectAttachmentData & IBaseObject::getAttachmentData()`.
157    ///
158    /// # Safety
159    /// `player_object` must be a live `IPlayerObject`.
160    #[must_use]
161    pub fn player_object_attachment_data(
162        player_object: IPlayerObject,
163    ) -> *const ObjectAttachmentData = [0, SLOT_GET_ATTACHMENT_DATA] or std::ptr::null();
164
165    /// `bool IBaseObject::getMaterialData(uint32_t, const ObjectMaterialData *&)`.
166    ///
167    /// # Safety
168    /// `player_object` must be a live `IPlayerObject`.
169    #[must_use]
170    pub fn player_object_material_data(
171        player_object: IPlayerObject,
172        material_index: u32,
173        out: *mut *const ObjectMaterialData,
174    ) -> bool = [0, SLOT_GET_MATERIAL_DATA] or false;
175
176    /// `void IBaseObject::setMaterial(uint32_t, int, StringView, StringView, Colour)`.
177    ///
178    /// # Safety
179    /// `player_object` must be a live `IPlayerObject`.
180    pub fn player_object_set_material(
181        player_object: IPlayerObject,
182        material_index: u32,
183        model: i32,
184        texture_library: StringView,
185        texture_name: StringView,
186        colour: Colour,
187    ) = [0, SLOT_SET_MATERIAL];
188
189    /// `void IBaseObject::setMaterialText(uint32_t, StringView, ObjectMaterialSize, StringView, int, bool, Colour, Colour, ObjectMaterialTextAlign)`.
190    ///
191    /// # Safety
192    /// `player_object` must be a live `IPlayerObject`.
193    pub fn player_object_set_material_text(
194        player_object: IPlayerObject,
195        material_index: u32,
196        text: StringView,
197        material_size: i32,
198        font_face: StringView,
199        font_size: i32,
200        bold: bool,
201        font_colour: Colour,
202        background_colour: Colour,
203        align: i32,
204    ) = [0, SLOT_SET_MATERIAL_TEXT];
205
206    /// `void IPlayerObject::attachToObject(IPlayerObject &, Vector3, Vector3)`.
207    ///
208    /// # Safety
209    /// `player_object` must be a live `IPlayerObject`.
210    pub fn player_object_attach_to_object(
211        player_object: IPlayerObject,
212        object: *mut IPlayerObject,
213        offset: Vector3,
214        rotation: Vector3,
215    ) = [0, SLOT_ATTACH_TO_OBJECT];
216
217    /// `void IPlayerObject::attachToPlayer(IPlayer &, Vector3, Vector3)`.
218    ///
219    /// # Safety
220    /// `player_object` must be a live `IPlayerObject`.
221    pub fn player_object_attach_to_player(
222        player_object: IPlayerObject,
223        player: *mut IPlayer,
224        offset: Vector3,
225        rotation: Vector3,
226    ) = [0, SLOT_ATTACH_TO_PLAYER];
227}