1#[repr(C)]
2#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
3pub struct __BindgenBitfieldUnit<Storage> {
4 storage: Storage,
5}
6impl<Storage> __BindgenBitfieldUnit<Storage> {
7 #[inline]
8 pub const fn new(storage: Storage) -> Self {
9 Self { storage }
10 }
11}
12impl<Storage> __BindgenBitfieldUnit<Storage>
13where
14 Storage: AsRef<[u8]> + AsMut<[u8]>,
15{
16 #[inline]
17 pub fn get_bit(&self, index: usize) -> bool {
18 debug_assert!(index / 8 < self.storage.as_ref().len());
19 let byte_index = index / 8;
20 let byte = self.storage.as_ref()[byte_index];
21 let bit_index = if cfg!(target_endian = "big") {
22 7 - (index % 8)
23 } else {
24 index % 8
25 };
26 let mask = 1 << bit_index;
27 byte & mask == mask
28 }
29 #[inline]
30 pub fn set_bit(&mut self, index: usize, val: bool) {
31 debug_assert!(index / 8 < self.storage.as_ref().len());
32 let byte_index = index / 8;
33 let byte = &mut self.storage.as_mut()[byte_index];
34 let bit_index = if cfg!(target_endian = "big") {
35 7 - (index % 8)
36 } else {
37 index % 8
38 };
39 let mask = 1 << bit_index;
40 if val {
41 *byte |= mask;
42 } else {
43 *byte &= !mask;
44 }
45 }
46 #[inline]
47 pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
48 debug_assert!(bit_width <= 64);
49 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
50 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
51 let mut val = 0;
52 for i in 0..(bit_width as usize) {
53 if self.get_bit(i + bit_offset) {
54 let index = if cfg!(target_endian = "big") {
55 bit_width as usize - 1 - i
56 } else {
57 i
58 };
59 val |= 1 << index;
60 }
61 }
62 val
63 }
64 #[inline]
65 pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
66 debug_assert!(bit_width <= 64);
67 debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
68 debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
69 for i in 0..(bit_width as usize) {
70 let mask = 1 << i;
71 let val_bit_is_set = val & mask == mask;
72 let index = if cfg!(target_endian = "big") {
73 bit_width as usize - 1 - i
74 } else {
75 i
76 };
77 self.set_bit(index + bit_offset, val_bit_is_set);
78 }
79 }
80}
81#[repr(C)]
82#[derive(Default)]
83pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]);
84impl<T> __IncompleteArrayField<T> {
85 #[inline]
86 pub const fn new() -> Self {
87 __IncompleteArrayField(::std::marker::PhantomData, [])
88 }
89 #[inline]
90 pub fn as_ptr(&self) -> *const T {
91 self as *const _ as *const T
92 }
93 #[inline]
94 pub fn as_mut_ptr(&mut self) -> *mut T {
95 self as *mut _ as *mut T
96 }
97 #[inline]
98 pub unsafe fn as_slice(&self, len: usize) -> &[T] {
99 ::std::slice::from_raw_parts(self.as_ptr(), len)
100 }
101 #[inline]
102 pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
103 ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
104 }
105}
106impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
107 fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
108 fmt.write_str("__IncompleteArrayField")
109 }
110}
111#[repr(C)]
112pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>);
113impl<T> __BindgenUnionField<T> {
114 #[inline]
115 pub const fn new() -> Self {
116 __BindgenUnionField(::std::marker::PhantomData)
117 }
118 #[inline]
119 pub unsafe fn as_ref(&self) -> &T {
120 ::std::mem::transmute(self)
121 }
122 #[inline]
123 pub unsafe fn as_mut(&mut self) -> &mut T {
124 ::std::mem::transmute(self)
125 }
126}
127impl<T> ::std::default::Default for __BindgenUnionField<T> {
128 #[inline]
129 fn default() -> Self {
130 Self::new()
131 }
132}
133impl<T> ::std::clone::Clone for __BindgenUnionField<T> {
134 #[inline]
135 fn clone(&self) -> Self {
136 Self::new()
137 }
138}
139impl<T> ::std::marker::Copy for __BindgenUnionField<T> {}
140impl<T> ::std::fmt::Debug for __BindgenUnionField<T> {
141 fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
142 fmt.write_str("__BindgenUnionField")
143 }
144}
145impl<T> ::std::hash::Hash for __BindgenUnionField<T> {
146 fn hash<H: ::std::hash::Hasher>(&self, _state: &mut H) {}
147}
148impl<T> ::std::cmp::PartialEq for __BindgenUnionField<T> {
149 fn eq(&self, _other: &__BindgenUnionField<T>) -> bool {
150 true
151 }
152}
153impl<T> ::std::cmp::Eq for __BindgenUnionField<T> {}
154pub const __SAL_H_VERSION: u32 = 180000000;
155pub const __bool_true_false_are_defined: u32 = 1;
156pub const TM_TT_TYPE__CAMERA_COMPONENT: &'static [u8; 20usize] = b"tm_camera_component\0";
157pub const TM_TT_TYPE__CONSTRAINT_COMPONENT: &'static [u8; 24usize] = b"tm_constraint_component\0";
158pub const TM_TT_TYPE__AIM_CONSTRAINT: &'static [u8; 18usize] = b"tm_aim_constraint\0";
159pub const TM_TT_TYPE__FABRIK_CONSTRAINT: &'static [u8; 21usize] = b"tm_fabrik_constraint\0";
160pub const TM_TT_TYPE__VERLET_CONSTRAINT__COLLISION_SHAPE: &'static [u8; 37usize] =
161 b"tm_verlet_constraint_collision_shape\0";
162pub const TM_TT_TYPE__VERLET_CONSTRAINT: &'static [u8; 21usize] = b"tm_verlet_constraint\0";
163pub const TM_TT_TYPE__ENTITY_SORT_VALUE: &'static [u8; 21usize] = b"tm_entity_sort_value\0";
164pub const TM_TT_TYPE__ENTITY: &'static [u8; 10usize] = b"tm_entity\0";
165pub const TM_MAX_COMPONENTS_IN_CONTEXT: u32 = 1024;
166pub const TM_MAX_COMPONENTS_FOR_ENGINE: u32 = 16;
167pub const TM_TT_TYPE__OWNER_COMPONENT: &'static [u8; 19usize] = b"tm_owner_component\0";
168pub const TM_TT_TYPE__SCENE_TREE_COMPONENT: &'static [u8; 24usize] = b"tm_scene_tree_component\0";
169pub const TM_TT_TYPE__TAG_COMPONENT: &'static [u8; 17usize] = b"tm_tag_component\0";
170pub const TM_TT_TYPE__TAG: &'static [u8; 7usize] = b"tm_tag\0";
171pub const TM_TT_TYPE__TRANSFORM_COMPONENT: &'static [u8; 23usize] = b"tm_transform_component\0";
172extern "C" {
173 pub fn __va_start(arg1: *mut *mut ::std::os::raw::c_char, ...);
174}
175pub type __vcrt_bool = bool;
176extern "C" {
177 pub fn __security_init_cookie();
178}
179extern "C" {
180 pub fn __security_check_cookie(_StackCookie: usize);
181}
182extern "C" {
183 pub fn __report_gsfailure(_StackCookie: usize);
184}
185extern "C" {
186 pub static mut __security_cookie: usize;
187}
188#[repr(C)]
189#[derive(Copy, Clone)]
190pub union TtIdTBindgenTy1 {
191 pub u64_: u64,
192 pub __bindgen_anon_1: TtIdTBindgenTy1BindgenTy1,
193}
194#[repr(C)]
195#[repr(align(8))]
196#[derive(Default, Copy, Clone)]
197pub struct TtIdTBindgenTy1BindgenTy1 {
198 pub _bitfield_align_1: [u32; 0],
199 pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>,
200}
201impl TtIdTBindgenTy1BindgenTy1 {
202 #[inline]
203 pub fn type_(&self) -> u64 {
204 unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 10u8) as u64) }
205 }
206 #[inline]
207 pub fn set_type(&mut self, val: u64) {
208 unsafe {
209 let val: u64 = ::std::mem::transmute(val);
210 self._bitfield_1.set(0usize, 10u8, val as u64)
211 }
212 }
213 #[inline]
214 pub fn generation(&self) -> u64 {
215 unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 22u8) as u64) }
216 }
217 #[inline]
218 pub fn set_generation(&mut self, val: u64) {
219 unsafe {
220 let val: u64 = ::std::mem::transmute(val);
221 self._bitfield_1.set(10usize, 22u8, val as u64)
222 }
223 }
224 #[inline]
225 pub fn index(&self) -> u64 {
226 unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 32u8) as u64) }
227 }
228 #[inline]
229 pub fn set_index(&mut self, val: u64) {
230 unsafe {
231 let val: u64 = ::std::mem::transmute(val);
232 self._bitfield_1.set(32usize, 32u8, val as u64)
233 }
234 }
235 #[inline]
236 pub fn new_bitfield_1(
237 type_: u64,
238 generation: u64,
239 index: u64,
240 ) -> __BindgenBitfieldUnit<[u8; 8usize]> {
241 let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default();
242 __bindgen_bitfield_unit.set(0usize, 10u8, {
243 let type_: u64 = unsafe { ::std::mem::transmute(type_) };
244 type_ as u64
245 });
246 __bindgen_bitfield_unit.set(10usize, 22u8, {
247 let generation: u64 = unsafe { ::std::mem::transmute(generation) };
248 generation as u64
249 });
250 __bindgen_bitfield_unit.set(32usize, 32u8, {
251 let index: u64 = unsafe { ::std::mem::transmute(index) };
252 index as u64
253 });
254 __bindgen_bitfield_unit
255 }
256}
257impl Default for TtIdTBindgenTy1 {
258 fn default() -> Self {
259 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
260 unsafe {
261 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
262 s.assume_init()
263 }
264 }
265}
266pub const TM_TT_PROP__CAMERA_COMPONENT__PROJECTION_MODE: ::std::os::raw::c_int = 0;
267pub const TM_TT_PROP__CAMERA_COMPONENT__NEAR_PLANE: ::std::os::raw::c_int = 1;
268pub const TM_TT_PROP__CAMERA_COMPONENT__FAR_PLANE: ::std::os::raw::c_int = 2;
269pub const TM_TT_PROP__CAMERA_COMPONENT__VERTICAL_FOV_OR_BOX_HEIGHT: ::std::os::raw::c_int = 3;
270pub const TM_TT_PROP__CAMERA_COMPONENT__SHUTTER_SPEED: ::std::os::raw::c_int = 4;
271pub const TM_TT_PROP__CAMERA_COMPONENT__APERTURE: ::std::os::raw::c_int = 5;
272pub const TM_TT_PROP__CAMERA_COMPONENT__ISO: ::std::os::raw::c_int = 6;
273pub type _bindgen_ty_1 = ::std::os::raw::c_int;
274pub type CameraComponentT = CameraSettingsT;
275#[repr(C)]
276#[derive(Copy, Clone)]
277pub union EntityT {
278 pub __bindgen_anon_1: EntityTBindgenTy1,
279 pub u64_: u64,
280}
281#[repr(C)]
282#[derive(Default, Copy, Clone)]
283pub struct EntityTBindgenTy1 {
284 pub index: u32,
285 pub generation: u32,
286}
287impl Default for EntityT {
288 fn default() -> Self {
289 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
290 unsafe {
291 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
292 s.assume_init()
293 }
294 }
295}
296#[repr(C)]
297#[derive(Default, Copy, Clone)]
298pub struct ComponentTypeT {
299 pub index: u32,
300}
301#[repr(C)]
302#[derive(Copy, Clone)]
303pub struct SetEntityT {
304 _unused: [u8; 0],
305}
306#[repr(C)]
307#[derive(Copy, Clone)]
308pub struct EntityContextO {
309 _unused: [u8; 0],
310}
311pub const TM_CONSTRAINT_TYPE__NONE: ConstraintType = 0;
312pub const TM_CONSTRAINT_TYPE__LOCK: ConstraintType = 1;
313pub const TM_CONSTRAINT_TYPE__AIM: ConstraintType = 2;
314pub const TM_CONSTRAINT_TYPE__FABRIK: ConstraintType = 3;
315pub const TM_CONSTRAINT_TYPE__VERLET: ConstraintType = 4;
316pub const TM_CONSTRAINT_TYPE__COUNT: ConstraintType = 5;
317pub type ConstraintType = ::std::os::raw::c_int;
318pub const TM_CONSTRAINT_COMPONENT_NOT_LINKED_TO_SCENE_TREE_NODE: ::std::os::raw::c_int = -1;
319pub type _bindgen_ty_2 = ::std::os::raw::c_int;
320pub const TM_TT_PROP__CONSTRAINT_COMPONENT__ENABLED: ::std::os::raw::c_int = 0;
321pub const TM_TT_PROP__CONSTRAINT_COMPONENT__BLEND_TIME: ::std::os::raw::c_int = 1;
322pub const TM_TT_PROP__CONSTRAINT_COMPONENT__CONSTRAINED_ENTITY: ::std::os::raw::c_int = 2;
323pub const TM_TT_PROP__CONSTRAINT_COMPONENT__CONSTRAINED_NODE: ::std::os::raw::c_int = 3;
324pub const TM_TT_PROP__CONSTRAINT_COMPONENT__GOAL_ENTITY: ::std::os::raw::c_int = 4;
325pub const TM_TT_PROP__CONSTRAINT_COMPONENT__GOAL_NODE: ::std::os::raw::c_int = 5;
326pub const TM_TT_PROP__CONSTRAINT_COMPONENT__GOAL_POSITION: ::std::os::raw::c_int = 6;
327pub const TM_TT_PROP__CONSTRAINT_COMPONENT__MATCH_ROTATION: ::std::os::raw::c_int = 7;
328pub const TM_TT_PROP__CONSTRAINT_COMPONENT__GOAL_ROTATION: ::std::os::raw::c_int = 8;
329pub const TM_TT_PROP__CONSTRAINT_COMPONENT__TYPE: ::std::os::raw::c_int = 9;
330pub const TM_TT_PROP__CONSTRAINT_COMPONENT__CONSTRAINT: ::std::os::raw::c_int = 10;
331pub type _bindgen_ty_3 = ::std::os::raw::c_int;
332pub const TM_TT_PROP__AIM_CONSTRAINT__AXIS: ::std::os::raw::c_int = 0;
333pub const TM_TT_PROP__AIM_CONSTRAINT__MAX_ANGLE: ::std::os::raw::c_int = 1;
334pub type _bindgen_ty_4 = ::std::os::raw::c_int;
335pub const TM_TT_PROP__FABRIK_CONSTRAINT__IK_CHAIN_LENGTH: ::std::os::raw::c_int = 0;
336pub type _bindgen_ty_5 = ::std::os::raw::c_int;
337pub const TM_VERLET_CONSTRAINT_COLLISION_SHAPE_TYPE__PLANE: VerletConstraintCollisionShapeType = 0;
338pub const TM_VERLET_CONSTRAINT_COLLISION_SHAPE_TYPE__SPHERE: VerletConstraintCollisionShapeType = 1;
339pub const TM_VERLET_CONSTRAINT_COLLISION_SHAPE_TYPE__COUNT: VerletConstraintCollisionShapeType = 2;
340pub type VerletConstraintCollisionShapeType = ::std::os::raw::c_int;
341pub const TM_TT_PROP__VERLET_CONSTRAINT__COLLISION_SHAPE__TYPE: ::std::os::raw::c_int = 0;
342pub const TM_TT_PROP__VERLET_CONSTRAINT__COLLISION_SHAPE__NODE: ::std::os::raw::c_int = 1;
343pub const TM_TT_PROP__VERLET_CONSTRAINT__COLLISION_SHAPE__POSITION: ::std::os::raw::c_int = 2;
344pub const TM_TT_PROP__VERLET_CONSTRAINT__COLLISION_SHAPE__ROTATION: ::std::os::raw::c_int = 3;
345pub const TM_TT_PROP__VERLET_CONSTRAINT__COLLISION_SHAPE__RADIUS: ::std::os::raw::c_int = 4;
346pub type _bindgen_ty_6 = ::std::os::raw::c_int;
347pub const TM_TT_PROP__VERLET_CONSTRAINT__CHAIN_LENGTH: ::std::os::raw::c_int = 0;
348pub const TM_TT_PROP__VERLET_CONSTRAINT__DAMPING: ::std::os::raw::c_int = 1;
349pub const TM_TT_PROP__VERLET_CONSTRAINT__COLLISION_SHAPES: ::std::os::raw::c_int = 2;
350pub type _bindgen_ty_7 = ::std::os::raw::c_int;
351#[repr(C)]
352pub struct AimConstraintT {
353 pub axis: Vec3T,
354 pub max_angle: f32,
355}
356impl Default for AimConstraintT {
357 fn default() -> Self {
358 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
359 unsafe {
360 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
361 s.assume_init()
362 }
363 }
364}
365#[repr(C)]
366#[derive(Default, Copy, Clone)]
367pub struct FabrikConstraintT {
368 pub ik_chain_length: u32,
369}
370#[repr(C)]
371#[derive(Copy, Clone)]
372pub struct VerletConstraintDataT {
373 _unused: [u8; 0],
374}
375#[repr(C)]
376#[derive(Copy, Clone)]
377pub struct VerletConstraintT {
378 pub chain_length: u32,
379 pub damping: f32,
380 pub data: *mut VerletConstraintDataT,
381}
382impl Default for VerletConstraintT {
383 fn default() -> Self {
384 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
385 unsafe {
386 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
387 s.assume_init()
388 }
389 }
390}
391#[repr(C)]
392pub struct ConstraintComponentT {
393 pub type_: ConstraintType,
394 pub enabled: bool,
395 pub was_enabled: bool,
396 pub _padding_226: [::std::os::raw::c_char; 2usize],
397 pub blend_time: f32,
398 pub blend: f32,
399 pub constrained_entity: EntityT,
400 pub constrained_node_idx: u32,
401 pub _padding_239: [::std::os::raw::c_char; 4usize],
402 pub goal_entity: EntityT,
403 pub goal_node_idx: u32,
404 pub _padding_246: [::std::os::raw::c_char; 4usize],
405 pub goal_position: Vec3T,
406 pub match_rotation: bool,
407 pub _padding_254: [::std::os::raw::c_char; 3usize],
408 pub goal_rotation: Vec4T,
409 pub __bindgen_anon_1: ConstraintComponentTBindgenTy1,
410}
411#[repr(C)]
412pub struct ConstraintComponentTBindgenTy1 {
413 pub aim: __BindgenUnionField<AimConstraintT>,
414 pub fabrik: __BindgenUnionField<FabrikConstraintT>,
415 pub verlet: __BindgenUnionField<VerletConstraintT>,
416 pub bindgen_union_field: [u64; 2usize],
417}
418impl Default for ConstraintComponentTBindgenTy1 {
419 fn default() -> Self {
420 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
421 unsafe {
422 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
423 s.assume_init()
424 }
425 }
426}
427impl Default for ConstraintComponentT {
428 fn default() -> Self {
429 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
430 unsafe {
431 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
432 s.assume_init()
433 }
434 }
435}
436#[repr(C)]
437#[derive(Copy, Clone)]
438pub struct ConstraintComponentManagerO {
439 _unused: [u8; 0],
440}
441#[repr(C)]
442#[derive(Copy, Clone)]
443pub struct PrimitiveDrawerBufferT {
444 _unused: [u8; 0],
445}
446#[repr(C)]
447#[derive(Copy, Clone)]
448pub struct GamestateO {
449 _unused: [u8; 0],
450}
451#[repr(C)]
452#[derive(Copy, Clone)]
453pub struct GamestateObjectIdT {
454 _unused: [u8; 0],
455}
456#[repr(C)]
457#[derive(Copy, Clone)]
458pub struct GamestateStructIdT {
459 _unused: [u8; 0],
460}
461#[repr(C)]
462#[derive(Copy, Clone)]
463pub struct GamestateMemberT {
464 _unused: [u8; 0],
465}
466#[repr(C)]
467#[derive(Copy, Clone)]
468pub struct GamestatePersistentBufferT {
469 _unused: [u8; 0],
470}
471pub const TM_TT_PROP__ENTITY__SORT_VALUE_CHILD: TM_TT_PROP__ENTITY_SORT_VALUE = 0;
472pub const TM_TT_PROP__ENTITY__SORT_VALUE_VALUE: TM_TT_PROP__ENTITY_SORT_VALUE = 1;
473pub type TM_TT_PROP__ENTITY_SORT_VALUE = ::std::os::raw::c_int;
474pub const TM_TT_PROP__ENTITY__NAME: TM_TT_PROP__ENTITY = 0;
475pub const TM_TT_PROP__ENTITY__COMPONENTS: TM_TT_PROP__ENTITY = 1;
476pub const TM_TT_PROP__ENTITY__CHILDREN: TM_TT_PROP__ENTITY = 2;
477pub const TM_TT_PROP__ENTITY__CHILD_SORT_VALUES: TM_TT_PROP__ENTITY = 3;
478pub const TM_TT_PROP__ENTITY__PERSISTENCE: TM_TT_PROP__ENTITY = 4;
479pub type TM_TT_PROP__ENTITY = ::std::os::raw::c_int;
480pub const TM_ENTITY_PERSISTENCE__INHERIT: EntityPersistence = 0;
481pub const TM_ENTITY_PERSISTENCE__PERSISTENT: EntityPersistence = 1;
482pub const TM_ENTITY_PERSISTENCE__PERSISTENT_REPLICATED: EntityPersistence = 2;
483pub const TM_ENTITY_PERSISTENCE__NON_PERSISTENT: EntityPersistence = 3;
484pub type EntityPersistence = ::std::os::raw::c_int;
485#[repr(C)]
486#[derive(Copy, Clone)]
487pub struct EntityCommandsO {
488 _unused: [u8; 0],
489}
490#[repr(C)]
491#[derive(Default, Copy, Clone)]
492pub struct ComponentMaskT {
493 pub bits: [u64; 16usize],
494}
495#[repr(C)]
496#[derive(Copy, Clone)]
497pub struct ComponentManagerO {
498 _unused: [u8; 0],
499}
500#[repr(C)]
501#[derive(Copy, Clone)]
502pub struct ComponentGamestateRepresentationI {
503 pub size: u32,
504 pub compute_initial_hash_immediately: bool,
505 pub lazy_component_serialization: bool,
506 pub _padding_158: [::std::os::raw::c_char; 2usize],
507 pub restore_sort_order: f32,
508 pub _padding_169: [::std::os::raw::c_char; 4usize],
509 pub user_data: *mut ::std::os::raw::c_void,
510 pub serialize: ::std::option::Option<
511 unsafe extern "C" fn(
512 ctx: *mut EntityContextO,
513 e: EntityT,
514 component: ComponentTypeT,
515 buffer: *mut ::std::os::raw::c_void,
516 buffer_size: u32,
517 ),
518 >,
519 pub deserialize: ::std::option::Option<
520 unsafe extern "C" fn(
521 ctx: *mut EntityContextO,
522 e: EntityT,
523 component: ComponentTypeT,
524 buffer: *const ::std::os::raw::c_void,
525 buffer_size: u32,
526 ),
527 >,
528 pub compute_hash: ::std::option::Option<
529 unsafe extern "C" fn(
530 ctx: *mut EntityContextO,
531 e: EntityT,
532 component: ComponentTypeT,
533 data: *const ::std::os::raw::c_void,
534 size: u32,
535 ) -> u64,
536 >,
537 pub compute_asset_hash: ::std::option::Option<
538 unsafe extern "C" fn(
539 ctx: *mut EntityContextO,
540 tt: *mut TheTruthO,
541 component: ComponentTypeT,
542 asset: TtIdT,
543 ) -> u64,
544 >,
545 pub loaded: ::std::option::Option<
546 unsafe extern "C" fn(
547 manager: *mut ComponentManagerO,
548 e: EntityT,
549 data: *mut ::std::os::raw::c_void,
550 ),
551 >,
552 pub num_shared_members: u32,
553 pub _padding_217: [::std::os::raw::c_char; 4usize],
554 pub shared_members: *mut GamestateMemberT,
555}
556impl Default for ComponentGamestateRepresentationI {
557 fn default() -> Self {
558 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
559 unsafe {
560 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
561 s.assume_init()
562 }
563 }
564}
565#[repr(C)]
566#[derive(Copy, Clone)]
567pub struct ComponentPersistenceI {
568 pub manual_tracking: bool,
569 pub _padding_235: [::std::os::raw::c_char; 3usize],
570 pub num_members: u32,
571 pub members: *mut GamestateMemberT,
572}
573impl Default for ComponentPersistenceI {
574 fn default() -> Self {
575 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
576 unsafe {
577 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
578 s.assume_init()
579 }
580 }
581}
582#[repr(C)]
583#[derive(Default, Copy, Clone)]
584pub struct MemberNetworkReplicationT {
585 pub watch_timer: f64,
586 pub raw_component_offset: u32,
587 pub _padding_259: [::std::os::raw::c_char; 4usize],
588}
589#[repr(C)]
590#[derive(Copy, Clone)]
591pub struct ComponentNetworkReplicationI {
592 pub watch_timer: f64,
593 pub num_members: u32,
594 pub _padding_271: [::std::os::raw::c_char; 4usize],
595 pub members: *mut GamestateMemberT,
596 pub member_replication: *mut MemberNetworkReplicationT,
597}
598impl Default for ComponentNetworkReplicationI {
599 fn default() -> Self {
600 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
601 unsafe {
602 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
603 s.assume_init()
604 }
605 }
606}
607#[repr(C)]
608pub struct ComponentI {
609 pub name: *const ::std::os::raw::c_char,
610 pub bytes: u32,
611 pub _padding_285: [::std::os::raw::c_char; 4usize],
612 pub default_data: *const ::std::os::raw::c_void,
613 pub manager: *mut ComponentManagerO,
614 pub components_created:
615 ::std::option::Option<unsafe extern "C" fn(manager: *mut ComponentManagerO)>,
616 pub load_asset: ::std::option::Option<
617 unsafe extern "C" fn(
618 manager: *mut ComponentManagerO,
619 commands: *mut EntityCommandsO,
620 e: EntityT,
621 data: *mut ::std::os::raw::c_void,
622 tt: *const TheTruthO,
623 asset: TtIdT,
624 ) -> bool,
625 >,
626 pub asset_loaded: ::std::option::Option<
627 unsafe extern "C" fn(
628 manager: *mut ComponentManagerO,
629 commands: *mut EntityCommandsO,
630 e: EntityT,
631 data: *mut ::std::os::raw::c_void,
632 ),
633 >,
634 pub asset_loaded_sort_order: f64,
635 pub asset_reloaded: ::std::option::Option<
636 unsafe extern "C" fn(
637 manager: *mut ComponentManagerO,
638 commands: *mut EntityCommandsO,
639 e: EntityT,
640 data: *mut ::std::os::raw::c_void,
641 ),
642 >,
643 pub add: ::std::option::Option<
644 unsafe extern "C" fn(
645 manager: *mut ComponentManagerO,
646 commands: *mut EntityCommandsO,
647 e: EntityT,
648 data: *mut ::std::os::raw::c_void,
649 ),
650 >,
651 pub remove: ::std::option::Option<
652 unsafe extern "C" fn(
653 manager: *mut ComponentManagerO,
654 commands: *mut EntityCommandsO,
655 e: EntityT,
656 data: *mut ::std::os::raw::c_void,
657 ),
658 >,
659 pub destroy: ::std::option::Option<unsafe extern "C" fn(manager: *mut ComponentManagerO)>,
660 pub debug_draw: ::std::option::Option<
661 unsafe extern "C" fn(
662 manager: *mut ComponentManagerO,
663 e: *mut EntityT,
664 data: *mut *const ::std::os::raw::c_void,
665 n: u32,
666 pbuf: *mut PrimitiveDrawerBufferT,
667 vbuf: *mut PrimitiveDrawerBufferT,
668 allocator: *mut AllocatorI,
669 camera: *const CameraT,
670 viewport: RectT,
671 ),
672 >,
673 pub debug_draw_settings: TtIdT,
674 pub gamestate_representation: *mut ComponentGamestateRepresentationI,
675 pub persistence: *mut ComponentPersistenceI,
676 pub network_replication: *mut ComponentNetworkReplicationI,
677}
678impl Default for ComponentI {
679 fn default() -> Self {
680 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
681 unsafe {
682 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
683 s.assume_init()
684 }
685 }
686}
687pub type EntityCreateComponentI =
688 ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO)>;
689#[repr(C)]
690#[derive(Copy, Clone)]
691pub struct EngineUpdateArrayT {
692 pub entities: *mut EntityT,
693 pub components: [*mut ::std::os::raw::c_void; 16usize],
694 pub component_bytes: [u32; 16usize],
695 pub n: u32,
696 pub _padding_373: [::std::os::raw::c_char; 4usize],
697}
698impl Default for EngineUpdateArrayT {
699 fn default() -> Self {
700 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
701 unsafe {
702 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
703 s.assume_init()
704 }
705 }
706}
707#[repr(C)]
708pub struct EntityBlackboardValueT {
709 pub id: StrhashT,
710 pub __bindgen_anon_1: EntityBlackboardValueTBindgenTy1,
711}
712#[repr(C)]
713#[derive(Copy, Clone)]
714pub union EntityBlackboardValueTBindgenTy1 {
715 pub double_value: f64,
716 pub ptr_value: *mut ::std::os::raw::c_void,
717}
718impl Default for EntityBlackboardValueTBindgenTy1 {
719 fn default() -> Self {
720 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
721 unsafe {
722 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
723 s.assume_init()
724 }
725 }
726}
727impl Default for EntityBlackboardValueT {
728 fn default() -> Self {
729 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
730 unsafe {
731 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
732 s.assume_init()
733 }
734 }
735}
736#[repr(C)]
737pub struct EngineUpdateSetT {
738 pub engine: *const EngineI,
739 pub total_entities: u32,
740 pub _padding_396: [::std::os::raw::c_char; 4usize],
741 pub blackboard_start: *const EntityBlackboardValueT,
742 pub blackboard_end: *const EntityBlackboardValueT,
743 pub num_arrays: u32,
744 pub _padding_401: [::std::os::raw::c_char; 4usize],
745 pub arrays: __IncompleteArrayField<EngineUpdateArrayT>,
746}
747impl Default for EngineUpdateSetT {
748 fn default() -> Self {
749 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
750 unsafe {
751 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
752 s.assume_init()
753 }
754 }
755}
756#[repr(C)]
757#[derive(Copy, Clone)]
758pub struct EngineO {
759 _unused: [u8; 0],
760}
761pub const TM_MAX_DEPENDENCIES_FOR_ENGINE: ::std::os::raw::c_int = 16;
762pub type _bindgen_ty_8 = ::std::os::raw::c_int;
763#[repr(C)]
764pub struct EngineSystemCommonI {
765 pub ui_name: *const ::std::os::raw::c_char,
766 pub hash: StrhashT,
767 pub disabled: bool,
768 pub exclusive: bool,
769 pub _padding_448: [::std::os::raw::c_char; 2usize],
770 pub num_components: u32,
771 pub components: [ComponentTypeT; 16usize],
772 pub writes: [bool; 16usize],
773 pub before_me: [StrhashT; 16usize],
774 pub after_me: [StrhashT; 16usize],
775 pub phase: StrhashT,
776}
777impl Default for EngineSystemCommonI {
778 fn default() -> Self {
779 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
780 unsafe {
781 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
782 s.assume_init()
783 }
784 }
785}
786#[repr(C)]
787pub struct EngineI {
788 pub super_: EngineSystemCommonI,
789 pub inst: *mut EngineO,
790 pub update: ::std::option::Option<
791 unsafe extern "C" fn(
792 inst: *mut EngineO,
793 data: *mut EngineUpdateSetT,
794 commands: *mut EntityCommandsO,
795 ),
796 >,
797 pub num_excluded: u32,
798 pub _padding_504: [::std::os::raw::c_char; 4usize],
799 pub excluded: [ComponentTypeT; 16usize],
800 pub filter: ::std::option::Option<
801 unsafe extern "C" fn(
802 inst: *mut EngineO,
803 components: *const ComponentTypeT,
804 num_components: u32,
805 mask: *const ComponentMaskT,
806 ) -> bool,
807 >,
808}
809impl Default for EngineI {
810 fn default() -> Self {
811 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
812 unsafe {
813 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
814 s.assume_init()
815 }
816 }
817}
818#[repr(C)]
819#[derive(Copy, Clone)]
820pub struct EntitySystemO {
821 _unused: [u8; 0],
822}
823#[repr(C)]
824pub struct EntitySystemI {
825 pub super_: EngineSystemCommonI,
826 pub inst: *mut EntitySystemO,
827 pub inited: bool,
828 pub _padding_553: [::std::os::raw::c_char; 7usize],
829 pub init: ::std::option::Option<
830 unsafe extern "C" fn(
831 ctx: *mut EntityContextO,
832 inst: *mut EntitySystemO,
833 commands: *mut EntityCommandsO,
834 ),
835 >,
836 pub update: ::std::option::Option<
837 unsafe extern "C" fn(
838 ctx: *mut EntityContextO,
839 inst: *mut EntitySystemO,
840 commands: *mut EntityCommandsO,
841 ),
842 >,
843 pub shutdown: ::std::option::Option<
844 unsafe extern "C" fn(
845 ctx: *mut EntityContextO,
846 inst: *mut EntitySystemO,
847 commands: *mut EntityCommandsO,
848 ),
849 >,
850 pub hot_reload: ::std::option::Option<
851 unsafe extern "C" fn(
852 ctx: *mut EntityContextO,
853 inst: *mut EntitySystemO,
854 commands: *mut EntityCommandsO,
855 ),
856 >,
857}
858impl Default for EntitySystemI {
859 fn default() -> Self {
860 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
861 unsafe {
862 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
863 s.assume_init()
864 }
865 }
866}
867pub type EntityRegisterEnginesI =
868 ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO)>;
869pub type EntityRegisterEnginesSimulationI = EntityRegisterEnginesI;
870pub type EntityRegisterEnginesEditorI = EntityRegisterEnginesI;
871pub const TM_ENTITY_CREATE_COMPONENTS_NONE: EntityCreateComponents = 0;
872pub const TM_ENTITY_CREATE_COMPONENTS_ALL: EntityCreateComponents = 1;
873pub const TM_ENTITY_CREATE_COMPONENTS_EDITOR: EntityCreateComponents = 2;
874pub type EntityCreateComponents = ::std::os::raw::c_int;
875#[repr(C)]
876#[derive(Copy, Clone)]
877pub struct EntityListenerI {
878 pub man: *mut ComponentManagerO,
879 pub notify_e: EntityT,
880 pub notify_c: ComponentTypeT,
881 pub _padding_666: [::std::os::raw::c_char; 4usize],
882 pub notify: ::std::option::Option<
883 unsafe extern "C" fn(
884 ctx: *mut EntityContextO,
885 man: *mut ComponentManagerO,
886 e: EntityT,
887 c: *mut ::std::os::raw::c_void,
888 notify_e: EntityT,
889 notify_c: *mut ::std::os::raw::c_void,
890 ),
891 >,
892}
893impl Default for EntityListenerI {
894 fn default() -> Self {
895 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
896 unsafe {
897 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
898 s.assume_init()
899 }
900 }
901}
902#[repr(C)]
903#[derive(Copy, Clone)]
904pub struct EntityEventListenerI {
905 pub inst: *mut ::std::os::raw::c_void,
906 pub user_data: *mut ::std::os::raw::c_void,
907 pub notify: ::std::option::Option<
908 unsafe extern "C" fn(
909 inst: *mut ::std::os::raw::c_void,
910 ctx: *mut EntityContextO,
911 event: StrhashT,
912 e: EntityT,
913 event_data: *const ::std::os::raw::c_void,
914 event_data_bytes: u32,
915 user_data: *mut ::std::os::raw::c_void,
916 ),
917 >,
918}
919impl Default for EntityEventListenerI {
920 fn default() -> Self {
921 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
922 unsafe {
923 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
924 s.assume_init()
925 }
926 }
927}
928#[repr(C)]
929#[derive(Copy, Clone)]
930pub struct EntityArrayT {
931 pub entities: *mut EntityT,
932 pub n: u32,
933 pub _padding_694: [::std::os::raw::c_char; 4usize],
934}
935impl Default for EntityArrayT {
936 fn default() -> Self {
937 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
938 unsafe {
939 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
940 s.assume_init()
941 }
942 }
943}
944#[repr(C)]
945pub struct EntitySetT {
946 pub total_entities: u32,
947 pub num_arrays: u32,
948 pub arrays: __IncompleteArrayField<EntityArrayT>,
949}
950impl Default for EntitySetT {
951 fn default() -> Self {
952 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
953 unsafe {
954 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
955 s.assume_init()
956 }
957 }
958}
959#[repr(C)]
960#[derive(Default, Copy, Clone)]
961pub struct EntityApi {
962 pub create_truth_types: ::std::option::Option<unsafe extern "C" fn(tt: *mut TheTruthO)>,
963 pub create_context: ::std::option::Option<
964 unsafe extern "C" fn(
965 a: *mut AllocatorI,
966 tt: *mut TheTruthO,
967 create_components: EntityCreateComponents,
968 ) -> *mut EntityContextO,
969 >,
970 pub create_components: ::std::option::Option<
971 unsafe extern "C" fn(ctx: *mut EntityContextO, create_components: EntityCreateComponents),
972 >,
973 pub destroy_context: ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO)>,
974 pub register_component: ::std::option::Option<
975 unsafe extern "C" fn(ctx: *mut EntityContextO, com: *const ComponentI) -> ComponentTypeT,
976 >,
977 pub disable_component: ::std::option::Option<
978 unsafe extern "C" fn(ctx: *mut EntityContextO, component_hash: StrhashT),
979 >,
980 pub num_components:
981 ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO) -> u32>,
982 pub component: ::std::option::Option<
983 unsafe extern "C" fn(
984 ctx: *mut EntityContextO,
985 component_type: ComponentTypeT,
986 ) -> *const ComponentI,
987 >,
988 pub register_engine: ::std::option::Option<
989 unsafe extern "C" fn(ctx: *mut EntityContextO, engine: *const EngineI),
990 >,
991 pub remove_engine: ::std::option::Option<
992 unsafe extern "C" fn(ctx: *mut EntityContextO, engine_hash: StrhashT),
993 >,
994 pub registered_engines: ::std::option::Option<
995 unsafe extern "C" fn(ctx: *mut EntityContextO, count: *mut u32) -> *mut EngineI,
996 >,
997 pub register_system: ::std::option::Option<
998 unsafe extern "C" fn(ctx: *mut EntityContextO, system: *const EntitySystemI),
999 >,
1000 pub remove_system: ::std::option::Option<
1001 unsafe extern "C" fn(ctx: *mut EntityContextO, system_hash: StrhashT),
1002 >,
1003 pub registered_systems: ::std::option::Option<
1004 unsafe extern "C" fn(ctx: *mut EntityContextO, count: *mut u32) -> *mut EntitySystemI,
1005 >,
1006 pub create_child_allocator: ::std::option::Option<
1007 unsafe extern "C" fn(
1008 ctx: *mut EntityContextO,
1009 name: *const ::std::os::raw::c_char,
1010 a: *mut AllocatorI,
1011 ),
1012 >,
1013 pub destroy_child_allocator:
1014 ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO, a: *mut AllocatorI)>,
1015 pub the_truth:
1016 ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO) -> *mut TheTruthO>,
1017 pub create_entity:
1018 ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO) -> EntityT>,
1019 pub batch_create_entity: ::std::option::Option<
1020 unsafe extern "C" fn(ctx: *mut EntityContextO, es: *mut EntityT, n: u32),
1021 >,
1022 pub create_entity_from_mask: ::std::option::Option<
1023 unsafe extern "C" fn(ctx: *mut EntityContextO, mask: *const ComponentMaskT) -> EntityT,
1024 >,
1025 pub batch_create_entity_from_mask: ::std::option::Option<
1026 unsafe extern "C" fn(
1027 ctx: *mut EntityContextO,
1028 mask: *const ComponentMaskT,
1029 es: *mut EntityT,
1030 n: u32,
1031 ),
1032 >,
1033 pub create_entity_from_asset: ::std::option::Option<
1034 unsafe extern "C" fn(ctx: *mut EntityContextO, asset: TtIdT) -> EntityT,
1035 >,
1036 pub batch_create_entity_from_asset: ::std::option::Option<
1037 unsafe extern "C" fn(ctx: *mut EntityContextO, asset: TtIdT, es: *mut EntityT, n: u32),
1038 >,
1039 pub destroy_entity:
1040 ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO, e: EntityT)>,
1041 pub batch_destroy_entity: ::std::option::Option<
1042 unsafe extern "C" fn(ctx: *mut EntityContextO, es: *const EntityT, n: u32),
1043 >,
1044 pub clear_world: ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO)>,
1045 pub queue_destroy_entities: ::std::option::Option<
1046 unsafe extern "C" fn(ctx: *mut EntityContextO, es: *const EntityT, n: u32),
1047 >,
1048 pub is_alive:
1049 ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO, e: EntityT) -> bool>,
1050 pub num_entities: ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO) -> u32>,
1051 pub entities_matching: ::std::option::Option<
1052 unsafe extern "C" fn(
1053 ctx: *mut EntityContextO,
1054 required: *const ComponentMaskT,
1055 ta: *mut TempAllocatorI,
1056 ) -> *mut EntitySetT,
1057 >,
1058 pub entities_matching_with_forbidden: ::std::option::Option<
1059 unsafe extern "C" fn(
1060 ctx: *mut EntityContextO,
1061 required: *const ComponentMaskT,
1062 forbidden: *const ComponentMaskT,
1063 ta: *mut TempAllocatorI,
1064 ) -> *mut EntitySetT,
1065 >,
1066 pub flatten_set:
1067 ::std::option::Option<unsafe extern "C" fn(entities: *mut EntityT, set: *const EntitySetT)>,
1068 pub lookup_component_type: ::std::option::Option<
1069 unsafe extern "C" fn(ctx: *mut EntityContextO, name_hash: StrhashT) -> ComponentTypeT,
1070 >,
1071 pub component_manager: ::std::option::Option<
1072 unsafe extern "C" fn(
1073 ctx: *mut EntityContextO,
1074 component_type: ComponentTypeT,
1075 ) -> *mut ComponentManagerO,
1076 >,
1077 pub component_manager_by_hash: ::std::option::Option<
1078 unsafe extern "C" fn(
1079 ctx: *mut EntityContextO,
1080 name_hash: StrhashT,
1081 ) -> *mut ComponentManagerO,
1082 >,
1083 pub create_component_mask: ::std::option::Option<
1084 unsafe extern "C" fn(components: *const ComponentTypeT, n: u32) -> ComponentMaskT,
1085 >,
1086 pub component_mask: ::std::option::Option<
1087 unsafe extern "C" fn(ctx: *mut EntityContextO, e: EntityT) -> *const ComponentMaskT,
1088 >,
1089 pub add_component: ::std::option::Option<
1090 unsafe extern "C" fn(
1091 ctx: *mut EntityContextO,
1092 e: EntityT,
1093 component: ComponentTypeT,
1094 ) -> *mut ::std::os::raw::c_void,
1095 >,
1096 pub get_component: ::std::option::Option<
1097 unsafe extern "C" fn(
1098 ctx: *mut EntityContextO,
1099 e: EntityT,
1100 component: ComponentTypeT,
1101 ) -> *mut ::std::os::raw::c_void,
1102 >,
1103 pub get_component_by_hash: ::std::option::Option<
1104 unsafe extern "C" fn(
1105 ctx: *mut EntityContextO,
1106 e: EntityT,
1107 name_hash: StrhashT,
1108 ) -> *mut ::std::os::raw::c_void,
1109 >,
1110 pub remove_component: ::std::option::Option<
1111 unsafe extern "C" fn(ctx: *mut EntityContextO, e: EntityT, component: ComponentTypeT),
1112 >,
1113 pub call_remove_on_all_entities: ::std::option::Option<
1114 unsafe extern "C" fn(ctx: *mut EntityContextO, component: ComponentTypeT),
1115 >,
1116 pub asset_parent: ::std::option::Option<
1117 unsafe extern "C" fn(ctx: *mut EntityContextO, e: EntityT) -> EntityT,
1118 >,
1119 pub children: ::std::option::Option<
1120 unsafe extern "C" fn(
1121 ctx: *mut EntityContextO,
1122 e: EntityT,
1123 ta: *mut TempAllocatorI,
1124 ) -> *mut EntityT,
1125 >,
1126 pub asset:
1127 ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO, e: EntityT) -> TtIdT>,
1128 pub find_entity_from_asset: ::std::option::Option<
1129 unsafe extern "C" fn(ctx: *mut EntityContextO, asset: TtIdT) -> EntityT,
1130 >,
1131 pub resolve_asset_reference: ::std::option::Option<
1132 unsafe extern "C" fn(ctx: *mut EntityContextO, e: EntityT, asset: TtIdT) -> EntityT,
1133 >,
1134 pub resolve_path: ::std::option::Option<
1135 unsafe extern "C" fn(
1136 ctx: *mut EntityContextO,
1137 e: EntityT,
1138 path: *const ::std::os::raw::c_char,
1139 ) -> EntityT,
1140 >,
1141 pub propagate_asset_changes:
1142 ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO)>,
1143 pub propagate_listen_to: ::std::option::Option<
1144 unsafe extern "C" fn(ctx: *mut EntityContextO, e: EntityT, object: TtIdT),
1145 >,
1146 pub set_blackboard_double: ::std::option::Option<
1147 unsafe extern "C" fn(ctx: *mut EntityContextO, id: StrhashT, value: f64),
1148 >,
1149 pub set_blackboard_ptr: ::std::option::Option<
1150 unsafe extern "C" fn(
1151 ctx: *mut EntityContextO,
1152 id: StrhashT,
1153 value: *mut ::std::os::raw::c_void,
1154 ),
1155 >,
1156 pub has_blackboard:
1157 ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO, id: StrhashT) -> bool>,
1158 pub get_blackboard_double: ::std::option::Option<
1159 unsafe extern "C" fn(ctx: *mut EntityContextO, id: StrhashT, def: f64) -> f64,
1160 >,
1161 pub get_blackboard_ptr: ::std::option::Option<
1162 unsafe extern "C" fn(ctx: *mut EntityContextO, id: StrhashT) -> *mut ::std::os::raw::c_void,
1163 >,
1164 pub run_engine: ::std::option::Option<
1165 unsafe extern "C" fn(ctx: *mut EntityContextO, engine: *const EngineI),
1166 >,
1167 pub run_engine_with_commands: ::std::option::Option<
1168 unsafe extern "C" fn(
1169 ctx: *mut EntityContextO,
1170 engine: *const EngineI,
1171 commands: *mut EntityCommandsO,
1172 ),
1173 >,
1174 pub update: ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO)>,
1175 pub listen: ::std::option::Option<
1176 unsafe extern "C" fn(
1177 ctx: *mut EntityContextO,
1178 e: EntityT,
1179 c: ComponentTypeT,
1180 listener: *const EntityListenerI,
1181 ),
1182 >,
1183 pub unlisten: ::std::option::Option<
1184 unsafe extern "C" fn(
1185 ctx: *mut EntityContextO,
1186 e: EntityT,
1187 c: ComponentTypeT,
1188 listener: *const EntityListenerI,
1189 ),
1190 >,
1191 pub notify: ::std::option::Option<
1192 unsafe extern "C" fn(
1193 ctx: *mut EntityContextO,
1194 component_type: ComponentTypeT,
1195 entities: *const EntityT,
1196 num_entities: u32,
1197 ),
1198 >,
1199 pub listen_event: ::std::option::Option<
1200 unsafe extern "C" fn(
1201 ctx: *mut EntityContextO,
1202 e: EntityT,
1203 event: StrhashT,
1204 listener: *const EntityEventListenerI,
1205 ),
1206 >,
1207 pub unlisten_event: ::std::option::Option<
1208 unsafe extern "C" fn(
1209 ctx: *mut EntityContextO,
1210 e: EntityT,
1211 event: StrhashT,
1212 listener: *const EntityEventListenerI,
1213 ),
1214 >,
1215 pub unlisten_all: ::std::option::Option<
1216 unsafe extern "C" fn(ctx: *mut EntityContextO, instance: *mut ::std::os::raw::c_void),
1217 >,
1218 pub notify_event: ::std::option::Option<
1219 unsafe extern "C" fn(
1220 ctx: *mut EntityContextO,
1221 event: StrhashT,
1222 e: *mut EntityT,
1223 entity_stride: u32,
1224 data: *mut ::std::os::raw::c_void,
1225 data_stride: u32,
1226 n: u32,
1227 ),
1228 >,
1229 pub hot_reload: ::std::option::Option<unsafe extern "C" fn()>,
1230 pub set_debug_draw: ::std::option::Option<
1231 unsafe extern "C" fn(
1232 ctx: *mut EntityContextO,
1233 component_type: ComponentTypeT,
1234 tag: StrhashT,
1235 debug_draw: bool,
1236 ),
1237 >,
1238 pub get_all_debug_draws: ::std::option::Option<
1239 unsafe extern "C" fn(
1240 ctx: *mut EntityContextO,
1241 component_types: *mut *mut ComponentTypeT,
1242 tags: *mut *mut StrhashT,
1243 ta: *mut TempAllocatorI,
1244 ),
1245 >,
1246 pub has_debug_draw: ::std::option::Option<
1247 unsafe extern "C" fn(
1248 ctx: *mut EntityContextO,
1249 component_type: ComponentTypeT,
1250 tag: StrhashT,
1251 ) -> bool,
1252 >,
1253 pub clear_debug_draw: ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO)>,
1254 pub debug_draw: ::std::option::Option<
1255 unsafe extern "C" fn(
1256 ctx: *mut EntityContextO,
1257 pbuf: *mut PrimitiveDrawerBufferT,
1258 vbuf: *mut PrimitiveDrawerBufferT,
1259 allocator: *mut AllocatorI,
1260 camera: *const CameraT,
1261 viewport: RectT,
1262 ),
1263 >,
1264 pub gamestate:
1265 ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO) -> *mut GamestateO>,
1266 pub override_component_persistence: ::std::option::Option<
1267 unsafe extern "C" fn(
1268 ctx: *mut EntityContextO,
1269 c: ComponentTypeT,
1270 persistence: *mut ComponentPersistenceI,
1271 ),
1272 >,
1273 pub override_component_network_replication: ::std::option::Option<
1274 unsafe extern "C" fn(
1275 ctx: *mut EntityContextO,
1276 c: ComponentTypeT,
1277 replication: *mut ComponentNetworkReplicationI,
1278 ),
1279 >,
1280 pub propagate_persistence_changes_to_gamestate:
1281 ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO)>,
1282 pub propagate_network_replication_changes_to_gamestate:
1283 ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO)>,
1284 pub ensure_entity_is_persistent:
1285 ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO, e: EntityT)>,
1286 pub ensure_entity_is_replicated:
1287 ::std::option::Option<unsafe extern "C" fn(ctx: *mut EntityContextO, e: EntityT)>,
1288 pub get_entity_persistent_id: ::std::option::Option<
1289 unsafe extern "C" fn(
1290 ctx: *mut EntityContextO,
1291 e: EntityT,
1292 output: *mut GamestateObjectIdT,
1293 ) -> bool,
1294 >,
1295 pub get_entity_network_id: ::std::option::Option<
1296 unsafe extern "C" fn(
1297 ctx: *mut EntityContextO,
1298 e: EntityT,
1299 output: *mut GamestateObjectIdT,
1300 ) -> bool,
1301 >,
1302 pub get_component_persistent_id: ::std::option::Option<
1303 unsafe extern "C" fn(
1304 ctx: *mut EntityContextO,
1305 e: EntityT,
1306 c: ComponentTypeT,
1307 output: *mut GamestateStructIdT,
1308 ) -> bool,
1309 >,
1310 pub get_component_network_id: ::std::option::Option<
1311 unsafe extern "C" fn(
1312 ctx: *mut EntityContextO,
1313 e: EntityT,
1314 c: ComponentTypeT,
1315 output: *mut GamestateStructIdT,
1316 ) -> bool,
1317 >,
1318 pub lookup_entity_from_gamestate_id: ::std::option::Option<
1319 unsafe extern "C" fn(ctx: *mut EntityContextO, id: *const GamestateObjectIdT) -> EntityT,
1320 >,
1321}
1322#[repr(C)]
1323#[derive(Copy, Clone)]
1324pub union EntityCommandEntityHandleT {
1325 pub __bindgen_anon_1: EntityCommandEntityHandleTBindgenTy1,
1326 pub u64_: u64,
1327}
1328#[repr(C)]
1329#[derive(Default, Copy, Clone)]
1330pub struct EntityCommandEntityHandleTBindgenTy1 {
1331 pub entity_index: u32,
1332 pub asset_index: u32,
1333}
1334impl Default for EntityCommandEntityHandleT {
1335 fn default() -> Self {
1336 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
1337 unsafe {
1338 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1339 s.assume_init()
1340 }
1341 }
1342}
1343#[repr(C)]
1344#[derive(Default, Copy, Clone)]
1345pub struct EntityCommandsApi {
1346 pub create_entity_from_mask: ::std::option::Option<
1347 unsafe extern "C" fn(
1348 commands: *mut EntityCommandsO,
1349 mask: *const ComponentMaskT,
1350 ) -> EntityCommandEntityHandleT,
1351 >,
1352 pub batch_create_entity_from_mask: ::std::option::Option<
1353 unsafe extern "C" fn(
1354 commands: *mut EntityCommandsO,
1355 mask: *const ComponentMaskT,
1356 n: u32,
1357 ta: *mut TempAllocatorI,
1358 ) -> *mut EntityCommandEntityHandleT,
1359 >,
1360 pub create_entity_from_asset: ::std::option::Option<
1361 unsafe extern "C" fn(
1362 commands: *mut EntityCommandsO,
1363 asset: TtIdT,
1364 ) -> EntityCommandEntityHandleT,
1365 >,
1366 pub batch_create_entity_from_asset: ::std::option::Option<
1367 unsafe extern "C" fn(
1368 commands: *mut EntityCommandsO,
1369 asset: *mut TtIdT,
1370 n: u32,
1371 ta: *mut TempAllocatorI,
1372 ) -> *mut EntityCommandEntityHandleT,
1373 >,
1374 pub destroy_entity:
1375 ::std::option::Option<unsafe extern "C" fn(commands: *mut EntityCommandsO, e: EntityT)>,
1376 pub batch_destroy_entity: ::std::option::Option<
1377 unsafe extern "C" fn(commands: *mut EntityCommandsO, es: *const EntityT, n: u32),
1378 >,
1379 pub clear_world: ::std::option::Option<unsafe extern "C" fn(commands: *mut EntityCommandsO)>,
1380 pub add_component: ::std::option::Option<
1381 unsafe extern "C" fn(
1382 commands: *mut EntityCommandsO,
1383 e: EntityT,
1384 component: ComponentTypeT,
1385 ) -> *mut ::std::os::raw::c_void,
1386 >,
1387 pub remove_component: ::std::option::Option<
1388 unsafe extern "C" fn(commands: *mut EntityCommandsO, e: EntityT, component: ComponentTypeT),
1389 >,
1390 pub add_component_by_handle: ::std::option::Option<
1391 unsafe extern "C" fn(
1392 commands: *mut EntityCommandsO,
1393 e: EntityCommandEntityHandleT,
1394 component: ComponentTypeT,
1395 ) -> *mut ::std::os::raw::c_void,
1396 >,
1397}
1398#[repr(C)]
1399#[derive(Default, Copy, Clone)]
1400pub struct OwnerComponentT {
1401 pub num_children: u32,
1402 pub inst: u32,
1403}
1404#[repr(C)]
1405#[derive(Copy, Clone)]
1406pub struct OwnerComponentManagerO {
1407 _unused: [u8; 0],
1408}
1409#[repr(C)]
1410#[derive(Default, Copy, Clone)]
1411pub struct OwnerComponentApi {
1412 pub children: ::std::option::Option<
1413 unsafe extern "C" fn(
1414 manager: *const OwnerComponentManagerO,
1415 c: *const OwnerComponentT,
1416 children: *mut EntityT,
1417 ),
1418 >,
1419 pub add_children: ::std::option::Option<
1420 unsafe extern "C" fn(
1421 manager: *mut OwnerComponentManagerO,
1422 c: *mut OwnerComponentT,
1423 e: *const EntityT,
1424 n: u32,
1425 ),
1426 >,
1427 pub remove_children: ::std::option::Option<
1428 unsafe extern "C" fn(
1429 manager: *mut OwnerComponentManagerO,
1430 c: *mut OwnerComponentT,
1431 e: *const EntityT,
1432 n: u32,
1433 ),
1434 >,
1435 pub remove_all_children: ::std::option::Option<
1436 unsafe extern "C" fn(manager: *mut OwnerComponentManagerO, c: *mut OwnerComponentT),
1437 >,
1438 pub descendants: ::std::option::Option<
1439 unsafe extern "C" fn(
1440 manager: *const OwnerComponentManagerO,
1441 c: *const OwnerComponentT,
1442 ta: *mut TempAllocatorI,
1443 ) -> *mut EntityT,
1444 >,
1445}
1446pub const TM_TT_PROP__SCENE_TREE_COMPONENT__NODES: ::std::os::raw::c_int = 0;
1447pub const TM_TT_PROP__SCENE_TREE_COMPONENT__NODE_NAMES: ::std::os::raw::c_int = 1;
1448pub const TM_TT_PROP__SCENE_TREE_COMPONENT__ASSET: ::std::os::raw::c_int = 2;
1449pub type _bindgen_ty_9 = ::std::os::raw::c_int;
1450pub const TM_SCENE_TREE_COMPONENT_ROOT_NODE_PARENT: ::std::os::raw::c_int = -1;
1451pub type _bindgen_ty_10 = ::std::os::raw::c_int;
1452#[repr(C)]
1453pub struct SceneTreeNodeT {
1454 pub name: StrhashT,
1455 pub parent_idx: u32,
1456 pub local_transform: TransformT,
1457 pub _padding_53: [::std::os::raw::c_char; 4usize],
1458}
1459impl Default for SceneTreeNodeT {
1460 fn default() -> Self {
1461 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
1462 unsafe {
1463 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1464 s.assume_init()
1465 }
1466 }
1467}
1468#[repr(C)]
1469#[derive(Copy, Clone)]
1470pub struct SceneTreeNodeNamesT {
1471 pub hash: u64,
1472 pub n: u32,
1473 pub _padding_71: [::std::os::raw::c_char; 4usize],
1474 pub node_names: *const StrhashT,
1475}
1476impl Default for SceneTreeNodeNamesT {
1477 fn default() -> Self {
1478 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
1479 unsafe {
1480 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1481 s.assume_init()
1482 }
1483 }
1484}
1485#[repr(C)]
1486#[derive(Copy, Clone)]
1487pub struct SceneTreeComponentT {
1488 _unused: [u8; 0],
1489}
1490#[repr(C)]
1491#[derive(Copy, Clone)]
1492pub struct SceneTreeComponentManagerO {
1493 _unused: [u8; 0],
1494}
1495#[repr(C)]
1496#[derive(Default, Copy, Clone)]
1497pub struct SceneTreeComponentApi {
1498 pub setup_nodes: ::std::option::Option<
1499 unsafe extern "C" fn(
1500 manager: *mut SceneTreeComponentManagerO,
1501 st: *mut SceneTreeComponentT,
1502 nodes: *const SceneTreeNodeT,
1503 num_nodes: u32,
1504 debug_names: *const ::std::os::raw::c_char,
1505 ),
1506 >,
1507 pub node_names: ::std::option::Option<
1508 unsafe extern "C" fn(st: *const SceneTreeComponentT) -> SceneTreeNodeNamesT,
1509 >,
1510 pub node_index_from_name: ::std::option::Option<
1511 unsafe extern "C" fn(
1512 component: *const SceneTreeComponentT,
1513 node_name: StrhashT,
1514 not_found: u32,
1515 ) -> u32,
1516 >,
1517 pub node_debug_name_from_index: ::std::option::Option<
1518 unsafe extern "C" fn(
1519 component: *const SceneTreeComponentT,
1520 node_idx: u32,
1521 ) -> *const ::std::os::raw::c_char,
1522 >,
1523 pub world_matrices: ::std::option::Option<
1524 unsafe extern "C" fn(component: *const SceneTreeComponentT) -> *const Mat44T,
1525 >,
1526 pub local_matrices: ::std::option::Option<
1527 unsafe extern "C" fn(component: *const SceneTreeComponentT) -> *const Mat44T,
1528 >,
1529 pub local_transform: ::std::option::Option<
1530 unsafe extern "C" fn(component: *const SceneTreeComponentT, node_idx: u32) -> TransformT,
1531 >,
1532 pub world_transform: ::std::option::Option<
1533 unsafe extern "C" fn(component: *const SceneTreeComponentT, node_idx: u32) -> TransformT,
1534 >,
1535 pub set_local_transform: ::std::option::Option<
1536 unsafe extern "C" fn(
1537 component: *mut SceneTreeComponentT,
1538 node_idx: u32,
1539 t: *const TransformT,
1540 ),
1541 >,
1542 pub set_local_matrix: ::std::option::Option<
1543 unsafe extern "C" fn(component: *mut SceneTreeComponentT, node_idx: u32, tm: *const Mat44T),
1544 >,
1545 pub set_world_transform: ::std::option::Option<
1546 unsafe extern "C" fn(
1547 component: *mut SceneTreeComponentT,
1548 trans: *const TransformT,
1549 node_idx: u32,
1550 t: *const TransformT,
1551 ),
1552 >,
1553 pub transform: ::std::option::Option<
1554 unsafe extern "C" fn(st: *mut SceneTreeComponentT, trans: *const TransformT, version: u64),
1555 >,
1556 pub transform_subtree:
1557 ::std::option::Option<unsafe extern "C" fn(st: *mut SceneTreeComponentT, node_idx: u32)>,
1558 pub set_debug_color: ::std::option::Option<
1559 unsafe extern "C" fn(st: *mut SceneTreeComponentT, color: ColorSrgbT),
1560 >,
1561 pub node_parent_index: ::std::option::Option<
1562 unsafe extern "C" fn(st: *mut SceneTreeComponentT, node_idx: u32) -> u32,
1563 >,
1564}
1565pub const TM_TT_PROP__TAG_COMPONENT__TAGS: ::std::os::raw::c_int = 0;
1566pub type _bindgen_ty_11 = ::std::os::raw::c_int;
1567#[repr(C)]
1568#[derive(Default, Copy, Clone)]
1569pub struct TagComponentT {
1570 pub first_ti: u32,
1571}
1572#[repr(C)]
1573#[derive(Copy, Clone)]
1574pub struct TagComponentManagerO {
1575 _unused: [u8; 0],
1576}
1577#[repr(C)]
1578#[derive(Default, Copy, Clone)]
1579pub struct TagComponentApi {
1580 pub tag_assets: ::std::option::Option<
1581 unsafe extern "C" fn(tt: *mut TheTruthO, ta: *mut TempAllocatorI) -> *mut TtIdT,
1582 >,
1583 pub add_tag: ::std::option::Option<
1584 unsafe extern "C" fn(tcm: *mut TagComponentManagerO, e: EntityT, tag: StrhashT),
1585 >,
1586 pub add_tag_optional: ::std::option::Option<
1587 unsafe extern "C" fn(tcm: *mut TagComponentManagerO, e: EntityT, tag: StrhashT),
1588 >,
1589 pub remove_tag: ::std::option::Option<
1590 unsafe extern "C" fn(tcm: *mut TagComponentManagerO, e: EntityT, tag: StrhashT),
1591 >,
1592 pub has_tag: ::std::option::Option<
1593 unsafe extern "C" fn(tcm: *const TagComponentManagerO, e: EntityT, tag: StrhashT) -> bool,
1594 >,
1595 pub find_all: ::std::option::Option<
1596 unsafe extern "C" fn(
1597 tcm: *const TagComponentManagerO,
1598 tag: StrhashT,
1599 ta: *mut TempAllocatorI,
1600 ) -> *mut EntityT,
1601 >,
1602 pub find_first: ::std::option::Option<
1603 unsafe extern "C" fn(tcm: *const TagComponentManagerO, tag: StrhashT) -> EntityT,
1604 >,
1605}
1606pub const TM_TT_PROP__TRANSFORM_COMPONENT__LOCAL_POSITION: ::std::os::raw::c_int = 0;
1607pub const TM_TT_PROP__TRANSFORM_COMPONENT__LOCAL_ROTATION: ::std::os::raw::c_int = 1;
1608pub const TM_TT_PROP__TRANSFORM_COMPONENT__LOCAL_SCALE: ::std::os::raw::c_int = 2;
1609pub const TM_TT_PROP__TRANSFORM_COMPONENT__SCENE_TREE_NODE: ::std::os::raw::c_int = 3;
1610pub type _bindgen_ty_12 = ::std::os::raw::c_int;
1611pub const TM_TRANSFORM_COMPONENT_NOT_LINKED_TO_SCENE_TREE_NODE: ::std::os::raw::c_int = -1;
1612pub type _bindgen_ty_13 = ::std::os::raw::c_int;
1613#[repr(C)]
1614pub struct TransformComponentT {
1615 pub world: TransformT,
1616 pub local: TransformT,
1617 pub parent: EntityT,
1618 pub version: u32,
1619 pub scene_tree_node_idx: u32,
1620 pub scene_tree_node_name: StrhashT,
1621}
1622impl Default for TransformComponentT {
1623 fn default() -> Self {
1624 let mut s = ::std::mem::MaybeUninit::<Self>::uninit();
1625 unsafe {
1626 ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1);
1627 s.assume_init()
1628 }
1629 }
1630}
1631#[repr(C)]
1632#[derive(Copy, Clone)]
1633pub struct TransformComponentManagerO {
1634 _unused: [u8; 0],
1635}
1636#[repr(C)]
1637#[derive(Default, Copy, Clone)]
1638pub struct TransformComponentApi {
1639 pub get_position: ::std::option::Option<
1640 unsafe extern "C" fn(man: *mut TransformComponentManagerO, e: EntityT) -> Vec3T,
1641 >,
1642 pub get_rotation: ::std::option::Option<
1643 unsafe extern "C" fn(man: *mut TransformComponentManagerO, e: EntityT) -> Vec4T,
1644 >,
1645 pub get_scale: ::std::option::Option<
1646 unsafe extern "C" fn(man: *mut TransformComponentManagerO, e: EntityT) -> Vec3T,
1647 >,
1648 pub get_transform: ::std::option::Option<
1649 unsafe extern "C" fn(man: *mut TransformComponentManagerO, e: EntityT) -> *const TransformT,
1650 >,
1651 pub set_position: ::std::option::Option<
1652 unsafe extern "C" fn(man: *mut TransformComponentManagerO, e: EntityT, pos: Vec3T),
1653 >,
1654 pub set_rotation: ::std::option::Option<
1655 unsafe extern "C" fn(man: *mut TransformComponentManagerO, e: EntityT, rot: Vec4T),
1656 >,
1657 pub set_scale: ::std::option::Option<
1658 unsafe extern "C" fn(man: *mut TransformComponentManagerO, e: EntityT, scl: Vec3T),
1659 >,
1660 pub set_transform: ::std::option::Option<
1661 unsafe extern "C" fn(
1662 man: *mut TransformComponentManagerO,
1663 e: EntityT,
1664 transform: *const TransformT,
1665 ),
1666 >,
1667 pub get_local_position: ::std::option::Option<
1668 unsafe extern "C" fn(man: *mut TransformComponentManagerO, e: EntityT) -> Vec3T,
1669 >,
1670 pub get_local_rotation: ::std::option::Option<
1671 unsafe extern "C" fn(man: *mut TransformComponentManagerO, e: EntityT) -> Vec4T,
1672 >,
1673 pub get_local_scale: ::std::option::Option<
1674 unsafe extern "C" fn(man: *mut TransformComponentManagerO, e: EntityT) -> Vec3T,
1675 >,
1676 pub get_local_transform: ::std::option::Option<
1677 unsafe extern "C" fn(man: *mut TransformComponentManagerO, e: EntityT) -> *const TransformT,
1678 >,
1679 pub set_local_position: ::std::option::Option<
1680 unsafe extern "C" fn(man: *mut TransformComponentManagerO, e: EntityT, local_pos: Vec3T),
1681 >,
1682 pub set_local_rotation: ::std::option::Option<
1683 unsafe extern "C" fn(man: *mut TransformComponentManagerO, e: EntityT, local_rot: Vec4T),
1684 >,
1685 pub set_local_scale: ::std::option::Option<
1686 unsafe extern "C" fn(man: *mut TransformComponentManagerO, e: EntityT, local_scl: Vec3T),
1687 >,
1688 pub set_local_transform: ::std::option::Option<
1689 unsafe extern "C" fn(
1690 man: *mut TransformComponentManagerO,
1691 e: EntityT,
1692 local_transform: *const TransformT,
1693 ),
1694 >,
1695 pub update_world_transform: ::std::option::Option<
1696 unsafe extern "C" fn(man: *mut TransformComponentManagerO, e: EntityT),
1697 >,
1698 pub update_local_transform: ::std::option::Option<
1699 unsafe extern "C" fn(man: *mut TransformComponentManagerO, e: EntityT),
1700 >,
1701 pub compute_world_transform: ::std::option::Option<
1702 unsafe extern "C" fn(
1703 world: *mut TransformT,
1704 local: *const TransformT,
1705 parent_world: *const TransformT,
1706 ) -> *mut TransformT,
1707 >,
1708 pub compute_local_transform: ::std::option::Option<
1709 unsafe extern "C" fn(
1710 local: *mut TransformT,
1711 world: *const TransformT,
1712 parent_world: *const TransformT,
1713 ) -> *mut TransformT,
1714 >,
1715 pub compute_parent_transform: ::std::option::Option<
1716 unsafe extern "C" fn(
1717 parent_world: *mut TransformT,
1718 world: *const TransformT,
1719 local: *const TransformT,
1720 ) -> *mut TransformT,
1721 >,
1722 pub set_parent: ::std::option::Option<
1723 unsafe extern "C" fn(man: *mut TransformComponentManagerO, e: EntityT, parent: EntityT),
1724 >,
1725}
1726
1727use const_cstr::{const_cstr, ConstCStr};
1730
1731use crate::foundation::VersionT;
1732
1733use crate::foundation::*;
1734
1735impl EntityApi {
1736 pub unsafe fn create_truth_types(&self, tt: *mut TheTruthO) {
1737 self.create_truth_types.unwrap()(tt)
1738 }
1739
1740 pub unsafe fn create_context(
1741 &self,
1742 a: *mut AllocatorI,
1743 tt: *mut TheTruthO,
1744 create_components: EntityCreateComponents,
1745 ) -> *mut EntityContextO {
1746 self.create_context.unwrap()(a, tt, create_components)
1747 }
1748
1749 pub unsafe fn create_components(
1750 &self,
1751 ctx: *mut EntityContextO,
1752 create_components: EntityCreateComponents,
1753 ) {
1754 self.create_components.unwrap()(ctx, create_components)
1755 }
1756
1757 pub unsafe fn destroy_context(&self, ctx: *mut EntityContextO) {
1758 self.destroy_context.unwrap()(ctx)
1759 }
1760
1761 pub unsafe fn register_component(
1762 &self,
1763 ctx: *mut EntityContextO,
1764 com: *const ComponentI,
1765 ) -> ComponentTypeT {
1766 self.register_component.unwrap()(ctx, com)
1767 }
1768
1769 pub unsafe fn disable_component(&self, ctx: *mut EntityContextO, component_hash: StrhashT) {
1770 self.disable_component.unwrap()(ctx, component_hash)
1771 }
1772
1773 pub unsafe fn num_components(&self, ctx: *mut EntityContextO) -> u32 {
1774 self.num_components.unwrap()(ctx)
1775 }
1776
1777 pub unsafe fn component(
1778 &self,
1779 ctx: *mut EntityContextO,
1780 component_type: ComponentTypeT,
1781 ) -> *const ComponentI {
1782 self.component.unwrap()(ctx, component_type)
1783 }
1784
1785 pub unsafe fn register_engine(&self, ctx: *mut EntityContextO, engine: *const EngineI) {
1786 self.register_engine.unwrap()(ctx, engine)
1787 }
1788
1789 pub unsafe fn remove_engine(&self, ctx: *mut EntityContextO, engine_hash: StrhashT) {
1790 self.remove_engine.unwrap()(ctx, engine_hash)
1791 }
1792
1793 pub unsafe fn registered_engines(
1794 &self,
1795 ctx: *mut EntityContextO,
1796 count: *mut u32,
1797 ) -> *mut EngineI {
1798 self.registered_engines.unwrap()(ctx, count)
1799 }
1800
1801 pub unsafe fn register_system(&self, ctx: *mut EntityContextO, system: *const EntitySystemI) {
1802 self.register_system.unwrap()(ctx, system)
1803 }
1804
1805 pub unsafe fn remove_system(&self, ctx: *mut EntityContextO, system_hash: StrhashT) {
1806 self.remove_system.unwrap()(ctx, system_hash)
1807 }
1808
1809 pub unsafe fn registered_systems(
1810 &self,
1811 ctx: *mut EntityContextO,
1812 count: *mut u32,
1813 ) -> *mut EntitySystemI {
1814 self.registered_systems.unwrap()(ctx, count)
1815 }
1816
1817 pub unsafe fn create_child_allocator(
1818 &self,
1819 ctx: *mut EntityContextO,
1820 name: *const ::std::os::raw::c_char,
1821 a: *mut AllocatorI,
1822 ) {
1823 self.create_child_allocator.unwrap()(ctx, name, a)
1824 }
1825
1826 pub unsafe fn destroy_child_allocator(&self, ctx: *mut EntityContextO, a: *mut AllocatorI) {
1827 self.destroy_child_allocator.unwrap()(ctx, a)
1828 }
1829
1830 pub unsafe fn the_truth(&self, ctx: *mut EntityContextO) -> *mut TheTruthO {
1831 self.the_truth.unwrap()(ctx)
1832 }
1833
1834 pub unsafe fn create_entity(&self, ctx: *mut EntityContextO) -> EntityT {
1835 self.create_entity.unwrap()(ctx)
1836 }
1837
1838 pub unsafe fn batch_create_entity(&self, ctx: *mut EntityContextO, es: *mut EntityT, n: u32) {
1839 self.batch_create_entity.unwrap()(ctx, es, n)
1840 }
1841
1842 pub unsafe fn create_entity_from_mask(
1843 &self,
1844 ctx: *mut EntityContextO,
1845 mask: *const ComponentMaskT,
1846 ) -> EntityT {
1847 self.create_entity_from_mask.unwrap()(ctx, mask)
1848 }
1849
1850 pub unsafe fn batch_create_entity_from_mask(
1851 &self,
1852 ctx: *mut EntityContextO,
1853 mask: *const ComponentMaskT,
1854 es: *mut EntityT,
1855 n: u32,
1856 ) {
1857 self.batch_create_entity_from_mask.unwrap()(ctx, mask, es, n)
1858 }
1859
1860 pub unsafe fn create_entity_from_asset(
1861 &self,
1862 ctx: *mut EntityContextO,
1863 asset: TtIdT,
1864 ) -> EntityT {
1865 self.create_entity_from_asset.unwrap()(ctx, asset)
1866 }
1867
1868 pub unsafe fn batch_create_entity_from_asset(
1869 &self,
1870 ctx: *mut EntityContextO,
1871 asset: TtIdT,
1872 es: *mut EntityT,
1873 n: u32,
1874 ) {
1875 self.batch_create_entity_from_asset.unwrap()(ctx, asset, es, n)
1876 }
1877
1878 pub unsafe fn destroy_entity(&self, ctx: *mut EntityContextO, e: EntityT) {
1879 self.destroy_entity.unwrap()(ctx, e)
1880 }
1881
1882 pub unsafe fn batch_destroy_entity(
1883 &self,
1884 ctx: *mut EntityContextO,
1885 es: *const EntityT,
1886 n: u32,
1887 ) {
1888 self.batch_destroy_entity.unwrap()(ctx, es, n)
1889 }
1890
1891 pub unsafe fn clear_world(&self, ctx: *mut EntityContextO) {
1892 self.clear_world.unwrap()(ctx)
1893 }
1894
1895 pub unsafe fn queue_destroy_entities(
1896 &self,
1897 ctx: *mut EntityContextO,
1898 es: *const EntityT,
1899 n: u32,
1900 ) {
1901 self.queue_destroy_entities.unwrap()(ctx, es, n)
1902 }
1903
1904 pub unsafe fn is_alive(&self, ctx: *mut EntityContextO, e: EntityT) -> bool {
1905 self.is_alive.unwrap()(ctx, e)
1906 }
1907
1908 pub unsafe fn num_entities(&self, ctx: *mut EntityContextO) -> u32 {
1909 self.num_entities.unwrap()(ctx)
1910 }
1911
1912 pub unsafe fn entities_matching(
1913 &self,
1914 ctx: *mut EntityContextO,
1915 required: *const ComponentMaskT,
1916 ta: *mut TempAllocatorI,
1917 ) -> *mut EntitySetT {
1918 self.entities_matching.unwrap()(ctx, required, ta)
1919 }
1920
1921 pub unsafe fn entities_matching_with_forbidden(
1922 &self,
1923 ctx: *mut EntityContextO,
1924 required: *const ComponentMaskT,
1925 forbidden: *const ComponentMaskT,
1926 ta: *mut TempAllocatorI,
1927 ) -> *mut EntitySetT {
1928 self.entities_matching_with_forbidden.unwrap()(ctx, required, forbidden, ta)
1929 }
1930
1931 pub unsafe fn flatten_set(&self, entities: *mut EntityT, set: *const EntitySetT) {
1932 self.flatten_set.unwrap()(entities, set)
1933 }
1934
1935 pub unsafe fn lookup_component_type(
1936 &self,
1937 ctx: *mut EntityContextO,
1938 name_hash: StrhashT,
1939 ) -> ComponentTypeT {
1940 self.lookup_component_type.unwrap()(ctx, name_hash)
1941 }
1942
1943 pub unsafe fn component_manager(
1944 &self,
1945 ctx: *mut EntityContextO,
1946 component_type: ComponentTypeT,
1947 ) -> *mut ComponentManagerO {
1948 self.component_manager.unwrap()(ctx, component_type)
1949 }
1950
1951 pub unsafe fn component_manager_by_hash(
1952 &self,
1953 ctx: *mut EntityContextO,
1954 name_hash: StrhashT,
1955 ) -> *mut ComponentManagerO {
1956 self.component_manager_by_hash.unwrap()(ctx, name_hash)
1957 }
1958
1959 pub unsafe fn create_component_mask(
1960 &self,
1961 components: *const ComponentTypeT,
1962 n: u32,
1963 ) -> ComponentMaskT {
1964 self.create_component_mask.unwrap()(components, n)
1965 }
1966
1967 pub unsafe fn component_mask(
1968 &self,
1969 ctx: *mut EntityContextO,
1970 e: EntityT,
1971 ) -> *const ComponentMaskT {
1972 self.component_mask.unwrap()(ctx, e)
1973 }
1974
1975 pub unsafe fn add_component(
1976 &self,
1977 ctx: *mut EntityContextO,
1978 e: EntityT,
1979 component: ComponentTypeT,
1980 ) -> *mut ::std::os::raw::c_void {
1981 self.add_component.unwrap()(ctx, e, component)
1982 }
1983
1984 pub unsafe fn get_component(
1985 &self,
1986 ctx: *mut EntityContextO,
1987 e: EntityT,
1988 component: ComponentTypeT,
1989 ) -> *mut ::std::os::raw::c_void {
1990 self.get_component.unwrap()(ctx, e, component)
1991 }
1992
1993 pub unsafe fn get_component_by_hash(
1994 &self,
1995 ctx: *mut EntityContextO,
1996 e: EntityT,
1997 name_hash: StrhashT,
1998 ) -> *mut ::std::os::raw::c_void {
1999 self.get_component_by_hash.unwrap()(ctx, e, name_hash)
2000 }
2001
2002 pub unsafe fn remove_component(
2003 &self,
2004 ctx: *mut EntityContextO,
2005 e: EntityT,
2006 component: ComponentTypeT,
2007 ) {
2008 self.remove_component.unwrap()(ctx, e, component)
2009 }
2010
2011 pub unsafe fn call_remove_on_all_entities(
2012 &self,
2013 ctx: *mut EntityContextO,
2014 component: ComponentTypeT,
2015 ) {
2016 self.call_remove_on_all_entities.unwrap()(ctx, component)
2017 }
2018
2019 pub unsafe fn asset_parent(&self, ctx: *mut EntityContextO, e: EntityT) -> EntityT {
2020 self.asset_parent.unwrap()(ctx, e)
2021 }
2022
2023 pub unsafe fn children(
2024 &self,
2025 ctx: *mut EntityContextO,
2026 e: EntityT,
2027 ta: *mut TempAllocatorI,
2028 ) -> *mut EntityT {
2029 self.children.unwrap()(ctx, e, ta)
2030 }
2031
2032 pub unsafe fn asset(&self, ctx: *mut EntityContextO, e: EntityT) -> TtIdT {
2033 self.asset.unwrap()(ctx, e)
2034 }
2035
2036 pub unsafe fn find_entity_from_asset(&self, ctx: *mut EntityContextO, asset: TtIdT) -> EntityT {
2037 self.find_entity_from_asset.unwrap()(ctx, asset)
2038 }
2039
2040 pub unsafe fn resolve_asset_reference(
2041 &self,
2042 ctx: *mut EntityContextO,
2043 e: EntityT,
2044 asset: TtIdT,
2045 ) -> EntityT {
2046 self.resolve_asset_reference.unwrap()(ctx, e, asset)
2047 }
2048
2049 pub unsafe fn resolve_path(
2050 &self,
2051 ctx: *mut EntityContextO,
2052 e: EntityT,
2053 path: *const ::std::os::raw::c_char,
2054 ) -> EntityT {
2055 self.resolve_path.unwrap()(ctx, e, path)
2056 }
2057
2058 pub unsafe fn propagate_asset_changes(&self, ctx: *mut EntityContextO) {
2059 self.propagate_asset_changes.unwrap()(ctx)
2060 }
2061
2062 pub unsafe fn propagate_listen_to(&self, ctx: *mut EntityContextO, e: EntityT, object: TtIdT) {
2063 self.propagate_listen_to.unwrap()(ctx, e, object)
2064 }
2065
2066 pub unsafe fn set_blackboard_double(&self, ctx: *mut EntityContextO, id: StrhashT, value: f64) {
2067 self.set_blackboard_double.unwrap()(ctx, id, value)
2068 }
2069
2070 pub unsafe fn set_blackboard_ptr(
2071 &self,
2072 ctx: *mut EntityContextO,
2073 id: StrhashT,
2074 value: *mut ::std::os::raw::c_void,
2075 ) {
2076 self.set_blackboard_ptr.unwrap()(ctx, id, value)
2077 }
2078
2079 pub unsafe fn has_blackboard(&self, ctx: *mut EntityContextO, id: StrhashT) -> bool {
2080 self.has_blackboard.unwrap()(ctx, id)
2081 }
2082
2083 pub unsafe fn get_blackboard_double(
2084 &self,
2085 ctx: *mut EntityContextO,
2086 id: StrhashT,
2087 def: f64,
2088 ) -> f64 {
2089 self.get_blackboard_double.unwrap()(ctx, id, def)
2090 }
2091
2092 pub unsafe fn get_blackboard_ptr(
2093 &self,
2094 ctx: *mut EntityContextO,
2095 id: StrhashT,
2096 ) -> *mut ::std::os::raw::c_void {
2097 self.get_blackboard_ptr.unwrap()(ctx, id)
2098 }
2099
2100 pub unsafe fn run_engine(&self, ctx: *mut EntityContextO, engine: *const EngineI) {
2101 self.run_engine.unwrap()(ctx, engine)
2102 }
2103
2104 pub unsafe fn run_engine_with_commands(
2105 &self,
2106 ctx: *mut EntityContextO,
2107 engine: *const EngineI,
2108 commands: *mut EntityCommandsO,
2109 ) {
2110 self.run_engine_with_commands.unwrap()(ctx, engine, commands)
2111 }
2112
2113 pub unsafe fn update(&self, ctx: *mut EntityContextO) {
2114 self.update.unwrap()(ctx)
2115 }
2116
2117 pub unsafe fn listen(
2118 &self,
2119 ctx: *mut EntityContextO,
2120 e: EntityT,
2121 c: ComponentTypeT,
2122 listener: *const EntityListenerI,
2123 ) {
2124 self.listen.unwrap()(ctx, e, c, listener)
2125 }
2126
2127 pub unsafe fn unlisten(
2128 &self,
2129 ctx: *mut EntityContextO,
2130 e: EntityT,
2131 c: ComponentTypeT,
2132 listener: *const EntityListenerI,
2133 ) {
2134 self.unlisten.unwrap()(ctx, e, c, listener)
2135 }
2136
2137 pub unsafe fn notify(
2138 &self,
2139 ctx: *mut EntityContextO,
2140 component_type: ComponentTypeT,
2141 entities: *const EntityT,
2142 num_entities: u32,
2143 ) {
2144 self.notify.unwrap()(ctx, component_type, entities, num_entities)
2145 }
2146
2147 pub unsafe fn listen_event(
2148 &self,
2149 ctx: *mut EntityContextO,
2150 e: EntityT,
2151 event: StrhashT,
2152 listener: *const EntityEventListenerI,
2153 ) {
2154 self.listen_event.unwrap()(ctx, e, event, listener)
2155 }
2156
2157 pub unsafe fn unlisten_event(
2158 &self,
2159 ctx: *mut EntityContextO,
2160 e: EntityT,
2161 event: StrhashT,
2162 listener: *const EntityEventListenerI,
2163 ) {
2164 self.unlisten_event.unwrap()(ctx, e, event, listener)
2165 }
2166
2167 pub unsafe fn unlisten_all(
2168 &self,
2169 ctx: *mut EntityContextO,
2170 instance: *mut ::std::os::raw::c_void,
2171 ) {
2172 self.unlisten_all.unwrap()(ctx, instance)
2173 }
2174
2175 pub unsafe fn notify_event(
2176 &self,
2177 ctx: *mut EntityContextO,
2178 event: StrhashT,
2179 e: *mut EntityT,
2180 entity_stride: u32,
2181 data: *mut ::std::os::raw::c_void,
2182 data_stride: u32,
2183 n: u32,
2184 ) {
2185 self.notify_event.unwrap()(ctx, event, e, entity_stride, data, data_stride, n)
2186 }
2187
2188 pub unsafe fn hot_reload(&self) {
2189 self.hot_reload.unwrap()()
2190 }
2191
2192 pub unsafe fn set_debug_draw(
2193 &self,
2194 ctx: *mut EntityContextO,
2195 component_type: ComponentTypeT,
2196 tag: StrhashT,
2197 debug_draw: bool,
2198 ) {
2199 self.set_debug_draw.unwrap()(ctx, component_type, tag, debug_draw)
2200 }
2201
2202 pub unsafe fn get_all_debug_draws(
2203 &self,
2204 ctx: *mut EntityContextO,
2205 component_types: *mut *mut ComponentTypeT,
2206 tags: *mut *mut StrhashT,
2207 ta: *mut TempAllocatorI,
2208 ) {
2209 self.get_all_debug_draws.unwrap()(ctx, component_types, tags, ta)
2210 }
2211
2212 pub unsafe fn has_debug_draw(
2213 &self,
2214 ctx: *mut EntityContextO,
2215 component_type: ComponentTypeT,
2216 tag: StrhashT,
2217 ) -> bool {
2218 self.has_debug_draw.unwrap()(ctx, component_type, tag)
2219 }
2220
2221 pub unsafe fn clear_debug_draw(&self, ctx: *mut EntityContextO) {
2222 self.clear_debug_draw.unwrap()(ctx)
2223 }
2224
2225 pub unsafe fn debug_draw(
2226 &self,
2227 ctx: *mut EntityContextO,
2228 pbuf: *mut PrimitiveDrawerBufferT,
2229 vbuf: *mut PrimitiveDrawerBufferT,
2230 allocator: *mut AllocatorI,
2231 camera: *const CameraT,
2232 viewport: RectT,
2233 ) {
2234 self.debug_draw.unwrap()(ctx, pbuf, vbuf, allocator, camera, viewport)
2235 }
2236
2237 pub unsafe fn gamestate(&self, ctx: *mut EntityContextO) -> *mut GamestateO {
2238 self.gamestate.unwrap()(ctx)
2239 }
2240
2241 pub unsafe fn override_component_persistence(
2242 &self,
2243 ctx: *mut EntityContextO,
2244 c: ComponentTypeT,
2245 persistence: *mut ComponentPersistenceI,
2246 ) {
2247 self.override_component_persistence.unwrap()(ctx, c, persistence)
2248 }
2249
2250 pub unsafe fn override_component_network_replication(
2251 &self,
2252 ctx: *mut EntityContextO,
2253 c: ComponentTypeT,
2254 replication: *mut ComponentNetworkReplicationI,
2255 ) {
2256 self.override_component_network_replication.unwrap()(ctx, c, replication)
2257 }
2258
2259 pub unsafe fn propagate_persistence_changes_to_gamestate(&self, ctx: *mut EntityContextO) {
2260 self.propagate_persistence_changes_to_gamestate.unwrap()(ctx)
2261 }
2262
2263 pub unsafe fn propagate_network_replication_changes_to_gamestate(
2264 &self,
2265 ctx: *mut EntityContextO,
2266 ) {
2267 self.propagate_network_replication_changes_to_gamestate
2268 .unwrap()(ctx)
2269 }
2270
2271 pub unsafe fn ensure_entity_is_persistent(&self, ctx: *mut EntityContextO, e: EntityT) {
2272 self.ensure_entity_is_persistent.unwrap()(ctx, e)
2273 }
2274
2275 pub unsafe fn ensure_entity_is_replicated(&self, ctx: *mut EntityContextO, e: EntityT) {
2276 self.ensure_entity_is_replicated.unwrap()(ctx, e)
2277 }
2278
2279 pub unsafe fn get_entity_persistent_id(
2280 &self,
2281 ctx: *mut EntityContextO,
2282 e: EntityT,
2283 output: *mut GamestateObjectIdT,
2284 ) -> bool {
2285 self.get_entity_persistent_id.unwrap()(ctx, e, output)
2286 }
2287
2288 pub unsafe fn get_entity_network_id(
2289 &self,
2290 ctx: *mut EntityContextO,
2291 e: EntityT,
2292 output: *mut GamestateObjectIdT,
2293 ) -> bool {
2294 self.get_entity_network_id.unwrap()(ctx, e, output)
2295 }
2296
2297 pub unsafe fn get_component_persistent_id(
2298 &self,
2299 ctx: *mut EntityContextO,
2300 e: EntityT,
2301 c: ComponentTypeT,
2302 output: *mut GamestateStructIdT,
2303 ) -> bool {
2304 self.get_component_persistent_id.unwrap()(ctx, e, c, output)
2305 }
2306
2307 pub unsafe fn get_component_network_id(
2308 &self,
2309 ctx: *mut EntityContextO,
2310 e: EntityT,
2311 c: ComponentTypeT,
2312 output: *mut GamestateStructIdT,
2313 ) -> bool {
2314 self.get_component_network_id.unwrap()(ctx, e, c, output)
2315 }
2316
2317 pub unsafe fn lookup_entity_from_gamestate_id(
2318 &self,
2319 ctx: *mut EntityContextO,
2320 id: *const GamestateObjectIdT,
2321 ) -> EntityT {
2322 self.lookup_entity_from_gamestate_id.unwrap()(ctx, id)
2323 }
2324}
2325
2326impl crate::Api for EntityApi {
2327 const NAME: ConstCStr = const_cstr!("tm_entity_api");
2328 const VERSION: VersionT = VersionT {
2329 major: 2u32,
2330 minor: 0u32,
2331 patch: 0u32,
2332 };
2333}
2334
2335impl EntityCommandsApi {
2336 pub unsafe fn create_entity_from_mask(
2337 &self,
2338 commands: *mut EntityCommandsO,
2339 mask: *const ComponentMaskT,
2340 ) -> EntityCommandEntityHandleT {
2341 self.create_entity_from_mask.unwrap()(commands, mask)
2342 }
2343
2344 pub unsafe fn batch_create_entity_from_mask(
2345 &self,
2346 commands: *mut EntityCommandsO,
2347 mask: *const ComponentMaskT,
2348 n: u32,
2349 ta: *mut TempAllocatorI,
2350 ) -> *mut EntityCommandEntityHandleT {
2351 self.batch_create_entity_from_mask.unwrap()(commands, mask, n, ta)
2352 }
2353
2354 pub unsafe fn create_entity_from_asset(
2355 &self,
2356 commands: *mut EntityCommandsO,
2357 asset: TtIdT,
2358 ) -> EntityCommandEntityHandleT {
2359 self.create_entity_from_asset.unwrap()(commands, asset)
2360 }
2361
2362 pub unsafe fn batch_create_entity_from_asset(
2363 &self,
2364 commands: *mut EntityCommandsO,
2365 asset: *mut TtIdT,
2366 n: u32,
2367 ta: *mut TempAllocatorI,
2368 ) -> *mut EntityCommandEntityHandleT {
2369 self.batch_create_entity_from_asset.unwrap()(commands, asset, n, ta)
2370 }
2371
2372 pub unsafe fn destroy_entity(&self, commands: *mut EntityCommandsO, e: EntityT) {
2373 self.destroy_entity.unwrap()(commands, e)
2374 }
2375
2376 pub unsafe fn batch_destroy_entity(
2377 &self,
2378 commands: *mut EntityCommandsO,
2379 es: *const EntityT,
2380 n: u32,
2381 ) {
2382 self.batch_destroy_entity.unwrap()(commands, es, n)
2383 }
2384
2385 pub unsafe fn clear_world(&self, commands: *mut EntityCommandsO) {
2386 self.clear_world.unwrap()(commands)
2387 }
2388
2389 pub unsafe fn add_component(
2390 &self,
2391 commands: *mut EntityCommandsO,
2392 e: EntityT,
2393 component: ComponentTypeT,
2394 ) -> *mut ::std::os::raw::c_void {
2395 self.add_component.unwrap()(commands, e, component)
2396 }
2397
2398 pub unsafe fn remove_component(
2399 &self,
2400 commands: *mut EntityCommandsO,
2401 e: EntityT,
2402 component: ComponentTypeT,
2403 ) {
2404 self.remove_component.unwrap()(commands, e, component)
2405 }
2406
2407 pub unsafe fn add_component_by_handle(
2408 &self,
2409 commands: *mut EntityCommandsO,
2410 e: EntityCommandEntityHandleT,
2411 component: ComponentTypeT,
2412 ) -> *mut ::std::os::raw::c_void {
2413 self.add_component_by_handle.unwrap()(commands, e, component)
2414 }
2415}
2416
2417impl crate::Api for EntityCommandsApi {
2418 const NAME: ConstCStr = const_cstr!("tm_entity_commands_api");
2419 const VERSION: VersionT = VersionT {
2420 major: 1u32,
2421 minor: 0u32,
2422 patch: 0u32,
2423 };
2424}
2425
2426impl OwnerComponentApi {
2427 pub unsafe fn children(
2428 &self,
2429 manager: *const OwnerComponentManagerO,
2430 c: *const OwnerComponentT,
2431 children: *mut EntityT,
2432 ) {
2433 self.children.unwrap()(manager, c, children)
2434 }
2435
2436 pub unsafe fn add_children(
2437 &self,
2438 manager: *mut OwnerComponentManagerO,
2439 c: *mut OwnerComponentT,
2440 e: *const EntityT,
2441 n: u32,
2442 ) {
2443 self.add_children.unwrap()(manager, c, e, n)
2444 }
2445
2446 pub unsafe fn remove_children(
2447 &self,
2448 manager: *mut OwnerComponentManagerO,
2449 c: *mut OwnerComponentT,
2450 e: *const EntityT,
2451 n: u32,
2452 ) {
2453 self.remove_children.unwrap()(manager, c, e, n)
2454 }
2455
2456 pub unsafe fn remove_all_children(
2457 &self,
2458 manager: *mut OwnerComponentManagerO,
2459 c: *mut OwnerComponentT,
2460 ) {
2461 self.remove_all_children.unwrap()(manager, c)
2462 }
2463
2464 pub unsafe fn descendants(
2465 &self,
2466 manager: *const OwnerComponentManagerO,
2467 c: *const OwnerComponentT,
2468 ta: *mut TempAllocatorI,
2469 ) -> *mut EntityT {
2470 self.descendants.unwrap()(manager, c, ta)
2471 }
2472}
2473
2474impl crate::Api for OwnerComponentApi {
2475 const NAME: ConstCStr = const_cstr!("tm_owner_component_api");
2476 const VERSION: VersionT = VersionT {
2477 major: 1u32,
2478 minor: 0u32,
2479 patch: 0u32,
2480 };
2481}
2482
2483impl SceneTreeComponentApi {
2484 pub unsafe fn setup_nodes(
2485 &self,
2486 manager: *mut SceneTreeComponentManagerO,
2487 st: *mut SceneTreeComponentT,
2488 nodes: *const SceneTreeNodeT,
2489 num_nodes: u32,
2490 debug_names: *const ::std::os::raw::c_char,
2491 ) {
2492 self.setup_nodes.unwrap()(manager, st, nodes, num_nodes, debug_names)
2493 }
2494
2495 pub unsafe fn node_names(&self, st: *const SceneTreeComponentT) -> SceneTreeNodeNamesT {
2496 self.node_names.unwrap()(st)
2497 }
2498
2499 pub unsafe fn node_index_from_name(
2500 &self,
2501 component: *const SceneTreeComponentT,
2502 node_name: StrhashT,
2503 not_found: u32,
2504 ) -> u32 {
2505 self.node_index_from_name.unwrap()(component, node_name, not_found)
2506 }
2507
2508 pub unsafe fn node_debug_name_from_index(
2509 &self,
2510 component: *const SceneTreeComponentT,
2511 node_idx: u32,
2512 ) -> *const ::std::os::raw::c_char {
2513 self.node_debug_name_from_index.unwrap()(component, node_idx)
2514 }
2515
2516 pub unsafe fn world_matrices(&self, component: *const SceneTreeComponentT) -> *const Mat44T {
2517 self.world_matrices.unwrap()(component)
2518 }
2519
2520 pub unsafe fn local_matrices(&self, component: *const SceneTreeComponentT) -> *const Mat44T {
2521 self.local_matrices.unwrap()(component)
2522 }
2523
2524 pub unsafe fn local_transform(
2525 &self,
2526 component: *const SceneTreeComponentT,
2527 node_idx: u32,
2528 ) -> TransformT {
2529 self.local_transform.unwrap()(component, node_idx)
2530 }
2531
2532 pub unsafe fn world_transform(
2533 &self,
2534 component: *const SceneTreeComponentT,
2535 node_idx: u32,
2536 ) -> TransformT {
2537 self.world_transform.unwrap()(component, node_idx)
2538 }
2539
2540 pub unsafe fn set_local_transform(
2541 &self,
2542 component: *mut SceneTreeComponentT,
2543 node_idx: u32,
2544 t: *const TransformT,
2545 ) {
2546 self.set_local_transform.unwrap()(component, node_idx, t)
2547 }
2548
2549 pub unsafe fn set_local_matrix(
2550 &self,
2551 component: *mut SceneTreeComponentT,
2552 node_idx: u32,
2553 tm: *const Mat44T,
2554 ) {
2555 self.set_local_matrix.unwrap()(component, node_idx, tm)
2556 }
2557
2558 pub unsafe fn set_world_transform(
2559 &self,
2560 component: *mut SceneTreeComponentT,
2561 trans: *const TransformT,
2562 node_idx: u32,
2563 t: *const TransformT,
2564 ) {
2565 self.set_world_transform.unwrap()(component, trans, node_idx, t)
2566 }
2567
2568 pub unsafe fn transform(
2569 &self,
2570 st: *mut SceneTreeComponentT,
2571 trans: *const TransformT,
2572 version: u64,
2573 ) {
2574 self.transform.unwrap()(st, trans, version)
2575 }
2576
2577 pub unsafe fn transform_subtree(&self, st: *mut SceneTreeComponentT, node_idx: u32) {
2578 self.transform_subtree.unwrap()(st, node_idx)
2579 }
2580
2581 pub unsafe fn set_debug_color(&self, st: *mut SceneTreeComponentT, color: ColorSrgbT) {
2582 self.set_debug_color.unwrap()(st, color)
2583 }
2584
2585 pub unsafe fn node_parent_index(&self, st: *mut SceneTreeComponentT, node_idx: u32) -> u32 {
2586 self.node_parent_index.unwrap()(st, node_idx)
2587 }
2588}
2589
2590impl crate::Api for SceneTreeComponentApi {
2591 const NAME: ConstCStr = const_cstr!("tm_scene_tree_component_api");
2592 const VERSION: VersionT = VersionT {
2593 major: 1u32,
2594 minor: 0u32,
2595 patch: 0u32,
2596 };
2597}
2598
2599impl TagComponentApi {
2600 pub unsafe fn tag_assets(&self, tt: *mut TheTruthO, ta: *mut TempAllocatorI) -> *mut TtIdT {
2601 self.tag_assets.unwrap()(tt, ta)
2602 }
2603
2604 pub unsafe fn add_tag(&self, tcm: *mut TagComponentManagerO, e: EntityT, tag: StrhashT) {
2605 self.add_tag.unwrap()(tcm, e, tag)
2606 }
2607
2608 pub unsafe fn add_tag_optional(
2609 &self,
2610 tcm: *mut TagComponentManagerO,
2611 e: EntityT,
2612 tag: StrhashT,
2613 ) {
2614 self.add_tag_optional.unwrap()(tcm, e, tag)
2615 }
2616
2617 pub unsafe fn remove_tag(&self, tcm: *mut TagComponentManagerO, e: EntityT, tag: StrhashT) {
2618 self.remove_tag.unwrap()(tcm, e, tag)
2619 }
2620
2621 pub unsafe fn has_tag(
2622 &self,
2623 tcm: *const TagComponentManagerO,
2624 e: EntityT,
2625 tag: StrhashT,
2626 ) -> bool {
2627 self.has_tag.unwrap()(tcm, e, tag)
2628 }
2629
2630 pub unsafe fn find_all(
2631 &self,
2632 tcm: *const TagComponentManagerO,
2633 tag: StrhashT,
2634 ta: *mut TempAllocatorI,
2635 ) -> *mut EntityT {
2636 self.find_all.unwrap()(tcm, tag, ta)
2637 }
2638
2639 pub unsafe fn find_first(&self, tcm: *const TagComponentManagerO, tag: StrhashT) -> EntityT {
2640 self.find_first.unwrap()(tcm, tag)
2641 }
2642}
2643
2644impl crate::Api for TagComponentApi {
2645 const NAME: ConstCStr = const_cstr!("tm_tag_component_api");
2646 const VERSION: VersionT = VersionT {
2647 major: 1u32,
2648 minor: 0u32,
2649 patch: 0u32,
2650 };
2651}
2652
2653impl TransformComponentApi {
2654 pub unsafe fn get_position(&self, man: *mut TransformComponentManagerO, e: EntityT) -> Vec3T {
2655 self.get_position.unwrap()(man, e)
2656 }
2657
2658 pub unsafe fn get_rotation(&self, man: *mut TransformComponentManagerO, e: EntityT) -> Vec4T {
2659 self.get_rotation.unwrap()(man, e)
2660 }
2661
2662 pub unsafe fn get_scale(&self, man: *mut TransformComponentManagerO, e: EntityT) -> Vec3T {
2663 self.get_scale.unwrap()(man, e)
2664 }
2665
2666 pub unsafe fn get_transform(
2667 &self,
2668 man: *mut TransformComponentManagerO,
2669 e: EntityT,
2670 ) -> *const TransformT {
2671 self.get_transform.unwrap()(man, e)
2672 }
2673
2674 pub unsafe fn set_position(
2675 &self,
2676 man: *mut TransformComponentManagerO,
2677 e: EntityT,
2678 pos: Vec3T,
2679 ) {
2680 self.set_position.unwrap()(man, e, pos)
2681 }
2682
2683 pub unsafe fn set_rotation(
2684 &self,
2685 man: *mut TransformComponentManagerO,
2686 e: EntityT,
2687 rot: Vec4T,
2688 ) {
2689 self.set_rotation.unwrap()(man, e, rot)
2690 }
2691
2692 pub unsafe fn set_scale(&self, man: *mut TransformComponentManagerO, e: EntityT, scl: Vec3T) {
2693 self.set_scale.unwrap()(man, e, scl)
2694 }
2695
2696 pub unsafe fn set_transform(
2697 &self,
2698 man: *mut TransformComponentManagerO,
2699 e: EntityT,
2700 transform: *const TransformT,
2701 ) {
2702 self.set_transform.unwrap()(man, e, transform)
2703 }
2704
2705 pub unsafe fn get_local_position(
2706 &self,
2707 man: *mut TransformComponentManagerO,
2708 e: EntityT,
2709 ) -> Vec3T {
2710 self.get_local_position.unwrap()(man, e)
2711 }
2712
2713 pub unsafe fn get_local_rotation(
2714 &self,
2715 man: *mut TransformComponentManagerO,
2716 e: EntityT,
2717 ) -> Vec4T {
2718 self.get_local_rotation.unwrap()(man, e)
2719 }
2720
2721 pub unsafe fn get_local_scale(
2722 &self,
2723 man: *mut TransformComponentManagerO,
2724 e: EntityT,
2725 ) -> Vec3T {
2726 self.get_local_scale.unwrap()(man, e)
2727 }
2728
2729 pub unsafe fn get_local_transform(
2730 &self,
2731 man: *mut TransformComponentManagerO,
2732 e: EntityT,
2733 ) -> *const TransformT {
2734 self.get_local_transform.unwrap()(man, e)
2735 }
2736
2737 pub unsafe fn set_local_position(
2738 &self,
2739 man: *mut TransformComponentManagerO,
2740 e: EntityT,
2741 local_pos: Vec3T,
2742 ) {
2743 self.set_local_position.unwrap()(man, e, local_pos)
2744 }
2745
2746 pub unsafe fn set_local_rotation(
2747 &self,
2748 man: *mut TransformComponentManagerO,
2749 e: EntityT,
2750 local_rot: Vec4T,
2751 ) {
2752 self.set_local_rotation.unwrap()(man, e, local_rot)
2753 }
2754
2755 pub unsafe fn set_local_scale(
2756 &self,
2757 man: *mut TransformComponentManagerO,
2758 e: EntityT,
2759 local_scl: Vec3T,
2760 ) {
2761 self.set_local_scale.unwrap()(man, e, local_scl)
2762 }
2763
2764 pub unsafe fn set_local_transform(
2765 &self,
2766 man: *mut TransformComponentManagerO,
2767 e: EntityT,
2768 local_transform: *const TransformT,
2769 ) {
2770 self.set_local_transform.unwrap()(man, e, local_transform)
2771 }
2772
2773 pub unsafe fn update_world_transform(&self, man: *mut TransformComponentManagerO, e: EntityT) {
2774 self.update_world_transform.unwrap()(man, e)
2775 }
2776
2777 pub unsafe fn update_local_transform(&self, man: *mut TransformComponentManagerO, e: EntityT) {
2778 self.update_local_transform.unwrap()(man, e)
2779 }
2780
2781 pub unsafe fn compute_world_transform(
2782 &self,
2783 world: *mut TransformT,
2784 local: *const TransformT,
2785 parent_world: *const TransformT,
2786 ) -> *mut TransformT {
2787 self.compute_world_transform.unwrap()(world, local, parent_world)
2788 }
2789
2790 pub unsafe fn compute_local_transform(
2791 &self,
2792 local: *mut TransformT,
2793 world: *const TransformT,
2794 parent_world: *const TransformT,
2795 ) -> *mut TransformT {
2796 self.compute_local_transform.unwrap()(local, world, parent_world)
2797 }
2798
2799 pub unsafe fn compute_parent_transform(
2800 &self,
2801 parent_world: *mut TransformT,
2802 world: *const TransformT,
2803 local: *const TransformT,
2804 ) -> *mut TransformT {
2805 self.compute_parent_transform.unwrap()(parent_world, world, local)
2806 }
2807
2808 pub unsafe fn set_parent(
2809 &self,
2810 man: *mut TransformComponentManagerO,
2811 e: EntityT,
2812 parent: EntityT,
2813 ) {
2814 self.set_parent.unwrap()(man, e, parent)
2815 }
2816}
2817
2818impl crate::Api for TransformComponentApi {
2819 const NAME: ConstCStr = const_cstr!("tm_transform_component_api");
2820 const VERSION: VersionT = VersionT {
2821 major: 1u32,
2822 minor: 0u32,
2823 patch: 0u32,
2824 };
2825}
2826
2827pub const TM_TT_TYPE_HASH__CAMERA_COMPONENT: StrhashT = StrhashT {
2828 u64_: 4702191454645448961u64,
2829};
2830pub const TM_TT_TYPE_HASH__CONSTRAINT_COMPONENT: StrhashT = StrhashT {
2831 u64_: 8328882474048285115u64,
2832};
2833pub const TM_TT_TYPE_HASH__AIM_CONSTRAINT: StrhashT = StrhashT {
2834 u64_: 1952626934336071325u64,
2835};
2836pub const TM_TT_TYPE_HASH__FABRIK_CONSTRAINT: StrhashT = StrhashT {
2837 u64_: 8908113391808412804u64,
2838};
2839pub const TM_TT_TYPE_HASH__VERLET_CONSTRAINT__COLLISION_SHAPE: StrhashT = StrhashT {
2840 u64_: 8004910458215113213u64,
2841};
2842pub const TM_TT_TYPE_HASH__VERLET_CONSTRAINT: StrhashT = StrhashT {
2843 u64_: 8425923701408414813u64,
2844};
2845pub const TM_ENGINE__CONSTRAINT: StrhashT = StrhashT {
2846 u64_: 11031446622748962226u64,
2847};
2848pub const TM_TT_TYPE_HASH__ENTITY_SORT_VALUE: StrhashT = StrhashT {
2849 u64_: 16910798103005116181u64,
2850};
2851pub const TM_TT_TYPE_HASH__ENTITY: StrhashT = StrhashT {
2852 u64_: 18380718000494627389u64,
2853};
2854pub const TM_PHASE__ANIMATION: StrhashT = StrhashT {
2855 u64_: 7021251402767592222u64,
2856};
2857pub const TM_PHASE__PHYSICS: StrhashT = StrhashT {
2858 u64_: 9931461870687654838u64,
2859};
2860pub const TM_PHASE__GRAPH: StrhashT = StrhashT {
2861 u64_: 7939849938661415817u64,
2862};
2863pub const TM_PHASE__CAMERA: StrhashT = StrhashT {
2864 u64_: 5035910868299140997u64,
2865};
2866pub const TM_PHASE__RENDER: StrhashT = StrhashT {
2867 u64_: 9520953946449223354u64,
2868};
2869pub const TM_ENTITY_BB__SIMULATION_SPEED: StrhashT = StrhashT {
2870 u64_: 410455368974121996u64,
2871};
2872pub const TM_ENTITY_BB__DELTA_TIME: StrhashT = StrhashT {
2873 u64_: 6798144013069773515u64,
2874};
2875pub const TM_ENTITY_BB__TIME: StrhashT = StrhashT {
2876 u64_: 7651809770448464541u64,
2877};
2878pub const TM_ENTITY_BB__WALL_DELTA_TIME: StrhashT = StrhashT {
2879 u64_: 7346627808032986698u64,
2880};
2881pub const TM_ENTITY_BB__WALL_TIME: StrhashT = StrhashT {
2882 u64_: 11026812457965896411u64,
2883};
2884pub const TM_ENTITY_BB__UI: StrhashT = StrhashT {
2885 u64_: 10083941705517751800u64,
2886};
2887pub const TM_ENTITY_BB__UI_STYLE: StrhashT = StrhashT {
2888 u64_: 7962502529529531972u64,
2889};
2890pub const TM_ENTITY_BB__UI_RECT: StrhashT = StrhashT {
2891 u64_: 9398225916257219576u64,
2892};
2893pub const TM_ENTITY_BB__UI_VIEWPORT_RECT: StrhashT = StrhashT {
2894 u64_: 17260522197470571648u64,
2895};
2896pub const TM_ENTITY_BB__WINDOW: StrhashT = StrhashT {
2897 u64_: 7502574202760729531u64,
2898};
2899pub const TM_ENTITY_BB__CAMERA: StrhashT = StrhashT {
2900 u64_: 173440160933014808u64,
2901};
2902pub const TM_ENTITY_BB__CAMERA_TRANSFORM: StrhashT = StrhashT {
2903 u64_: 12188817770794419482u64,
2904};
2905pub const TM_ENTITY_BB__DISABLED_INPUT: StrhashT = StrhashT {
2906 u64_: 17722481245418423046u64,
2907};
2908pub const TM_ENTITY_BB__EDITOR: StrhashT = StrhashT {
2909 u64_: 8066620458189861297u64,
2910};
2911pub const TM_ENTITY_BB__ASSET_ROOT: StrhashT = StrhashT {
2912 u64_: 12427581353952698963u64,
2913};
2914pub const ENTITY_GAMESTATE_NETWORK_REPLICATION_CONFIG: StrhashT = StrhashT {
2915 u64_: 14073158813658986614u64,
2916};
2917pub const ENTITY_GAMESTATE_PERSISTENCE_CONFIG: StrhashT = StrhashT {
2918 u64_: 436401338584922652u64,
2919};
2920pub const TM_TT_TYPE_HASH__OWNER_COMPONENT: StrhashT = StrhashT {
2921 u64_: 13997781925460329975u64,
2922};
2923pub const TM_TT_TYPE_HASH__SCENE_TREE_COMPONENT: StrhashT = StrhashT {
2924 u64_: 4467473609223121736u64,
2925};
2926pub const TM_ENGINE__SCENE_TREE: StrhashT = StrhashT {
2927 u64_: 8537231655615130692u64,
2928};
2929pub const TM_TT_TYPE_HASH__TAG_COMPONENT: StrhashT = StrhashT {
2930 u64_: 11268327857097111547u64,
2931};
2932pub const TM_TT_TYPE_HASH__TAG: StrhashT = StrhashT {
2933 u64_: 13878226445497189962u64,
2934};
2935pub const TM_TT_TYPE_HASH__TRANSFORM_COMPONENT: StrhashT = StrhashT {
2936 u64_: 10126216049058934656u64,
2937};
2938pub const TM_ENTITY_REGISTER_ENGINES_SIMULATION_I_VERSION: VersionT = VersionT {
2939 major: 1u32,
2940 minor: 0u32,
2941 patch: 0u32,
2942};
2943pub const TM_TAG_COMPONENT_API_VERSION: VersionT = VersionT {
2944 major: 1u32,
2945 minor: 0u32,
2946 patch: 0u32,
2947};
2948pub const TM_TRANSFORM_COMPONENT_API_VERSION: VersionT = VersionT {
2949 major: 1u32,
2950 minor: 0u32,
2951 patch: 0u32,
2952};
2953pub const TM_ENTITY_API_VERSION: VersionT = VersionT {
2954 major: 2u32,
2955 minor: 0u32,
2956 patch: 0u32,
2957};
2958pub const TM_SCENE_TREE_COMPONENT_API_VERSION: VersionT = VersionT {
2959 major: 1u32,
2960 minor: 0u32,
2961 patch: 0u32,
2962};
2963pub const TM_ENTITY_CREATE_COMPONENT_I_VERSION: VersionT = VersionT {
2964 major: 2u32,
2965 minor: 0u32,
2966 patch: 0u32,
2967};
2968pub const TM_ENTITY_REGISTER_ENGINES_EDITOR_I_VERSION: VersionT = VersionT {
2969 major: 1u32,
2970 minor: 0u32,
2971 patch: 0u32,
2972};
2973pub const TM_OWNER_COMPONENT_API_VERSION: VersionT = VersionT {
2974 major: 1u32,
2975 minor: 0u32,
2976 patch: 0u32,
2977};
2978pub const TM_ENTITY_COMMANDS_API_VERSION: VersionT = VersionT {
2979 major: 1u32,
2980 minor: 0u32,
2981 patch: 0u32,
2982};