havok_classes/generated/
hkpMotion_.rs

1use super::class_requires::*;
2use super::*;
3/// # C++ Info
4/// - name: `hkpMotion`
5/// - version: `3`
6/// - signature: `0x98aadb4f`
7/// - size: `288`(x86)/`320`(x86_64)
8/// -  vtable: `true`
9#[allow(non_upper_case_globals, non_snake_case)]
10#[cfg_attr(feature = "json_schema", derive(schemars::JsonSchema))]
11#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12#[derive(educe::Educe)]
13#[educe(Debug, Clone, Default, PartialEq)]
14pub struct hkpMotion {
15    /// # Unique index for this class
16    /// - Represents a pointer on XML (`<hkobject name="#0001"></hkobject>`)
17    /// - [`Option::None`] => This class is `class in field`.(`<hkobject></hkobject>`)
18    ///
19    /// # Note
20    /// Not present in the binary & Not exist actual C++ field.
21    #[cfg_attr(
22        feature = "serde",
23        serde(skip_serializing_if = "Option::is_none", default)
24    )]
25    pub __ptr: Option<Pointer>,
26    /// Alternative to C++ class inheritance.
27    #[cfg_attr(feature = "json_schema", schemars(flatten))]
28    #[cfg_attr(feature = "serde", serde(flatten))]
29    pub parent: hkReferencedObject,
30    /// # C++ Info
31    /// - name: `type`(ctype: `enum MotionType`)
32    /// - offset: `  8`(x86)/` 16`(x86_64)
33    /// - type_size: `  1`(x86)/`  1`(x86_64)
34    #[cfg_attr(feature = "json_schema", schemars(rename = "type"))]
35    #[cfg_attr(feature = "serde", serde(rename = "type"))]
36    pub m_type: MotionType,
37    /// # C++ Info
38    /// - name: `deactivationIntegrateCounter`(ctype: `hkUint8`)
39    /// - offset: `  9`(x86)/` 17`(x86_64)
40    /// - type_size: `  1`(x86)/`  1`(x86_64)
41    #[cfg_attr(
42        feature = "json_schema",
43        schemars(rename = "deactivationIntegrateCounter")
44    )]
45    #[cfg_attr(feature = "serde", serde(rename = "deactivationIntegrateCounter"))]
46    pub m_deactivationIntegrateCounter: u8,
47    /// # C++ Info
48    /// - name: `deactivationNumInactiveFrames`(ctype: `hkUint16[2]`)
49    /// - offset: ` 10`(x86)/` 18`(x86_64)
50    /// - type_size: `  4`(x86)/`  4`(x86_64)
51    #[cfg_attr(
52        feature = "json_schema",
53        schemars(rename = "deactivationNumInactiveFrames")
54    )]
55    #[cfg_attr(feature = "serde", serde(rename = "deactivationNumInactiveFrames"))]
56    pub m_deactivationNumInactiveFrames: [u16; 2usize],
57    /// # C++ Info
58    /// - name: `motionState`(ctype: `struct hkMotionState`)
59    /// - offset: ` 16`(x86)/` 32`(x86_64)
60    /// - type_size: `176`(x86)/`176`(x86_64)
61    #[cfg_attr(feature = "json_schema", schemars(rename = "motionState"))]
62    #[cfg_attr(feature = "serde", serde(rename = "motionState"))]
63    pub m_motionState: hkMotionState,
64    /// # C++ Info
65    /// - name: `inertiaAndMassInv`(ctype: `hkVector4`)
66    /// - offset: `192`(x86)/`208`(x86_64)
67    /// - type_size: ` 16`(x86)/` 16`(x86_64)
68    #[cfg_attr(feature = "json_schema", schemars(rename = "inertiaAndMassInv"))]
69    #[cfg_attr(feature = "serde", serde(rename = "inertiaAndMassInv"))]
70    pub m_inertiaAndMassInv: Vector4,
71    /// # C++ Info
72    /// - name: `linearVelocity`(ctype: `hkVector4`)
73    /// - offset: `208`(x86)/`224`(x86_64)
74    /// - type_size: ` 16`(x86)/` 16`(x86_64)
75    #[cfg_attr(feature = "json_schema", schemars(rename = "linearVelocity"))]
76    #[cfg_attr(feature = "serde", serde(rename = "linearVelocity"))]
77    pub m_linearVelocity: Vector4,
78    /// # C++ Info
79    /// - name: `angularVelocity`(ctype: `hkVector4`)
80    /// - offset: `224`(x86)/`240`(x86_64)
81    /// - type_size: ` 16`(x86)/` 16`(x86_64)
82    #[cfg_attr(feature = "json_schema", schemars(rename = "angularVelocity"))]
83    #[cfg_attr(feature = "serde", serde(rename = "angularVelocity"))]
84    pub m_angularVelocity: Vector4,
85    /// # C++ Info
86    /// - name: `deactivationRefPosition`(ctype: `hkVector4[2]`)
87    /// - offset: `240`(x86)/`256`(x86_64)
88    /// - type_size: ` 32`(x86)/` 32`(x86_64)
89    #[cfg_attr(feature = "json_schema", schemars(rename = "deactivationRefPosition"))]
90    #[cfg_attr(feature = "serde", serde(rename = "deactivationRefPosition"))]
91    pub m_deactivationRefPosition: [Vector4; 2usize],
92    /// # C++ Info
93    /// - name: `deactivationRefOrientation`(ctype: `hkUint32[2]`)
94    /// - offset: `272`(x86)/`288`(x86_64)
95    /// - type_size: `  8`(x86)/`  8`(x86_64)
96    #[cfg_attr(feature = "json_schema", schemars(rename = "deactivationRefOrientation"))]
97    #[cfg_attr(feature = "serde", serde(rename = "deactivationRefOrientation"))]
98    pub m_deactivationRefOrientation: [u32; 2usize],
99    /// # C++ Info
100    /// - name: `savedMotion`(ctype: `struct hkpMaxSizeMotion*`)
101    /// - offset: `280`(x86)/`296`(x86_64)
102    /// - type_size: `  4`(x86)/`  8`(x86_64)
103    #[cfg_attr(feature = "json_schema", schemars(rename = "savedMotion"))]
104    #[cfg_attr(feature = "serde", serde(rename = "savedMotion"))]
105    pub m_savedMotion: Pointer,
106    /// # C++ Info
107    /// - name: `savedQualityTypeIndex`(ctype: `hkUint16`)
108    /// - offset: `284`(x86)/`304`(x86_64)
109    /// - type_size: `  2`(x86)/`  2`(x86_64)
110    #[cfg_attr(feature = "json_schema", schemars(rename = "savedQualityTypeIndex"))]
111    #[cfg_attr(feature = "serde", serde(rename = "savedQualityTypeIndex"))]
112    pub m_savedQualityTypeIndex: u16,
113    /// # C++ Info
114    /// - name: `gravityFactor`(ctype: `hkHalf`)
115    /// - offset: `286`(x86)/`306`(x86_64)
116    /// - type_size: `  2`(x86)/`  2`(x86_64)
117    #[cfg_attr(feature = "json_schema", schemars(rename = "gravityFactor"))]
118    #[cfg_attr(feature = "serde", serde(rename = "gravityFactor"))]
119    pub m_gravityFactor: f16,
120}
121const _: () = {
122    use havok_serde as _serde;
123    impl _serde::HavokClass for hkpMotion {
124        #[inline]
125        fn name(&self) -> &'static str {
126            "hkpMotion"
127        }
128        #[inline]
129        fn signature(&self) -> _serde::__private::Signature {
130            _serde::__private::Signature::new(0x98aadb4f)
131        }
132        #[allow(clippy::let_and_return, clippy::vec_init_then_push)]
133        fn deps_indexes(&self) -> Vec<usize> {
134            let mut v = Vec::new();
135            v.extend(self.m_motionState.deps_indexes());
136            v.push(self.m_savedMotion.get());
137            v
138        }
139    }
140    impl _serde::Serialize for hkpMotion {
141        fn serialize<S>(&self, __serializer: S) -> Result<S::Ok, S::Error>
142        where
143            S: _serde::ser::Serializer,
144        {
145            let class_meta = self
146                .__ptr
147                .map(|name| (name, _serde::__private::Signature::new(0x98aadb4f)));
148            let mut serializer = __serializer
149                .serialize_struct("hkpMotion", class_meta, (288u64, 320u64))?;
150            serializer.pad_field([0u8; 4usize].as_slice(), [0u8; 8usize].as_slice())?;
151            serializer.skip_field("memSizeAndFlags", &self.parent.m_memSizeAndFlags)?;
152            serializer.skip_field("referenceCount", &self.parent.m_referenceCount)?;
153            serializer.pad_field([0u8; 0usize].as_slice(), [0u8; 4usize].as_slice())?;
154            serializer.serialize_field("type", &self.m_type)?;
155            serializer
156                .serialize_field(
157                    "deactivationIntegrateCounter",
158                    &self.m_deactivationIntegrateCounter,
159                )?;
160            serializer
161                .serialize_fixed_array_field(
162                    "deactivationNumInactiveFrames",
163                    self.m_deactivationNumInactiveFrames.as_slice(),
164                    TypeSize::NonPtr,
165                )?;
166            serializer.pad_field([0u8; 2usize].as_slice(), [0u8; 10usize].as_slice())?;
167            serializer.serialize_field("motionState", &self.m_motionState)?;
168            serializer.serialize_field("inertiaAndMassInv", &self.m_inertiaAndMassInv)?;
169            serializer.serialize_field("linearVelocity", &self.m_linearVelocity)?;
170            serializer.serialize_field("angularVelocity", &self.m_angularVelocity)?;
171            serializer
172                .serialize_fixed_array_field(
173                    "deactivationRefPosition",
174                    self.m_deactivationRefPosition.as_slice(),
175                    TypeSize::NonPtr,
176                )?;
177            serializer
178                .serialize_fixed_array_field(
179                    "deactivationRefOrientation",
180                    self.m_deactivationRefOrientation.as_slice(),
181                    TypeSize::NonPtr,
182                )?;
183            serializer.serialize_field("savedMotion", &self.m_savedMotion)?;
184            serializer
185                .serialize_field(
186                    "savedQualityTypeIndex",
187                    &self.m_savedQualityTypeIndex,
188                )?;
189            serializer.serialize_field("gravityFactor", &self.m_gravityFactor)?;
190            serializer.pad_field([0u8; 0usize].as_slice(), [0u8; 12usize].as_slice())?;
191            serializer.end()
192        }
193    }
194};
195#[doc(hidden)]
196#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
197const _: () = {
198    use havok_serde as _serde;
199    #[automatically_derived]
200    impl<'de> _serde::Deserialize<'de> for hkpMotion {
201        fn deserialize<__D>(deserializer: __D) -> core::result::Result<Self, __D::Error>
202        where
203            __D: _serde::Deserializer<'de>,
204        {
205            #[allow(non_camel_case_types)]
206            enum __Field {
207                m_type,
208                m_deactivationIntegrateCounter,
209                m_deactivationNumInactiveFrames,
210                m_motionState,
211                m_inertiaAndMassInv,
212                m_linearVelocity,
213                m_angularVelocity,
214                m_deactivationRefPosition,
215                m_deactivationRefOrientation,
216                m_savedMotion,
217                m_savedQualityTypeIndex,
218                m_gravityFactor,
219                __ignore,
220            }
221            struct __FieldVisitor;
222            impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
223                type Value = __Field;
224                fn expecting(
225                    &self,
226                    __formatter: &mut core::fmt::Formatter,
227                ) -> core::fmt::Result {
228                    core::fmt::Formatter::write_str(__formatter, "field identifier")
229                }
230                /// Intended for use in XML.
231                #[allow(clippy::match_single_binding)]
232                #[allow(clippy::reversed_empty_ranges)]
233                #[allow(clippy::single_match)]
234                fn visit_key<__E>(
235                    self,
236                    __value: &str,
237                ) -> core::result::Result<Self::Value, __E>
238                where
239                    __E: _serde::de::Error,
240                {
241                    match __value {
242                        "type" => Ok(__Field::m_type),
243                        "deactivationIntegrateCounter" => {
244                            Ok(__Field::m_deactivationIntegrateCounter)
245                        }
246                        "deactivationNumInactiveFrames" => {
247                            Ok(__Field::m_deactivationNumInactiveFrames)
248                        }
249                        "motionState" => Ok(__Field::m_motionState),
250                        "inertiaAndMassInv" => Ok(__Field::m_inertiaAndMassInv),
251                        "linearVelocity" => Ok(__Field::m_linearVelocity),
252                        "angularVelocity" => Ok(__Field::m_angularVelocity),
253                        "deactivationRefPosition" => {
254                            Ok(__Field::m_deactivationRefPosition)
255                        }
256                        "deactivationRefOrientation" => {
257                            Ok(__Field::m_deactivationRefOrientation)
258                        }
259                        "savedMotion" => Ok(__Field::m_savedMotion),
260                        "savedQualityTypeIndex" => Ok(__Field::m_savedQualityTypeIndex),
261                        "gravityFactor" => Ok(__Field::m_gravityFactor),
262                        _ => Ok(__Field::__ignore),
263                    }
264                }
265            }
266            impl<'de> _serde::Deserialize<'de> for __Field {
267                #[inline]
268                fn deserialize<__D>(
269                    __deserializer: __D,
270                ) -> core::result::Result<Self, __D::Error>
271                where
272                    __D: _serde::Deserializer<'de>,
273                {
274                    _serde::Deserializer::deserialize_key(__deserializer, __FieldVisitor)
275                }
276            }
277            struct __hkpMotionVisitor<'de> {
278                marker: _serde::__private::PhantomData<hkpMotion>,
279                lifetime: _serde::__private::PhantomData<&'de ()>,
280            }
281            #[allow(clippy::match_single_binding)]
282            #[allow(clippy::reversed_empty_ranges)]
283            #[allow(clippy::single_match)]
284            impl<'de> _serde::de::Visitor<'de> for __hkpMotionVisitor<'de> {
285                type Value = hkpMotion;
286                fn expecting(
287                    &self,
288                    __formatter: &mut core::fmt::Formatter,
289                ) -> core::fmt::Result {
290                    core::fmt::Formatter::write_str(__formatter, "struct hkpMotion")
291                }
292                fn visit_struct_for_bytes<__A>(
293                    self,
294                    mut __map: __A,
295                ) -> _serde::__private::Result<Self::Value, __A::Error>
296                where
297                    __A: _serde::de::MapAccess<'de>,
298                {
299                    let __ptr = __A::class_ptr(&mut __map);
300                    let parent = __A::parent_value(&mut __map)?;
301                    let mut m_type: _serde::__private::Option<MotionType> = _serde::__private::None;
302                    let mut m_deactivationIntegrateCounter: _serde::__private::Option<
303                        u8,
304                    > = _serde::__private::None;
305                    let mut m_deactivationNumInactiveFrames: _serde::__private::Option<
306                        [u16; 2usize],
307                    > = _serde::__private::None;
308                    let mut m_motionState: _serde::__private::Option<hkMotionState> = _serde::__private::None;
309                    let mut m_inertiaAndMassInv: _serde::__private::Option<Vector4> = _serde::__private::None;
310                    let mut m_linearVelocity: _serde::__private::Option<Vector4> = _serde::__private::None;
311                    let mut m_angularVelocity: _serde::__private::Option<Vector4> = _serde::__private::None;
312                    let mut m_deactivationRefPosition: _serde::__private::Option<
313                        [Vector4; 2usize],
314                    > = _serde::__private::None;
315                    let mut m_deactivationRefOrientation: _serde::__private::Option<
316                        [u32; 2usize],
317                    > = _serde::__private::None;
318                    let mut m_savedMotion: _serde::__private::Option<Pointer> = _serde::__private::None;
319                    let mut m_savedQualityTypeIndex: _serde::__private::Option<u16> = _serde::__private::None;
320                    let mut m_gravityFactor: _serde::__private::Option<f16> = _serde::__private::None;
321                    for i in 0..12usize {
322                        match i {
323                            0usize => {
324                                if _serde::__private::Option::is_some(&m_type) {
325                                    return _serde::__private::Err(
326                                        <__A::Error as _serde::de::Error>::duplicate_field("type"),
327                                    );
328                                }
329                                m_type = _serde::__private::Some(
330                                    match __A::next_value::<MotionType>(&mut __map) {
331                                        _serde::__private::Ok(__val) => __val,
332                                        _serde::__private::Err(__err) => {
333                                            return _serde::__private::Err(__err);
334                                        }
335                                    },
336                                );
337                            }
338                            1usize => {
339                                if _serde::__private::Option::is_some(
340                                    &m_deactivationIntegrateCounter,
341                                ) {
342                                    return _serde::__private::Err(
343                                        <__A::Error as _serde::de::Error>::duplicate_field(
344                                            "deactivationIntegrateCounter",
345                                        ),
346                                    );
347                                }
348                                m_deactivationIntegrateCounter = _serde::__private::Some(
349                                    match __A::next_value::<u8>(&mut __map) {
350                                        _serde::__private::Ok(__val) => __val,
351                                        _serde::__private::Err(__err) => {
352                                            return _serde::__private::Err(__err);
353                                        }
354                                    },
355                                );
356                            }
357                            2usize => {
358                                if _serde::__private::Option::is_some(
359                                    &m_deactivationNumInactiveFrames,
360                                ) {
361                                    return _serde::__private::Err(
362                                        <__A::Error as _serde::de::Error>::duplicate_field(
363                                            "deactivationNumInactiveFrames",
364                                        ),
365                                    );
366                                }
367                                m_deactivationNumInactiveFrames = _serde::__private::Some(
368                                    match __A::next_value::<[u16; 2usize]>(&mut __map) {
369                                        _serde::__private::Ok(__val) => __val,
370                                        _serde::__private::Err(__err) => {
371                                            return _serde::__private::Err(__err);
372                                        }
373                                    },
374                                );
375                            }
376                            3usize => {
377                                if _serde::__private::Option::is_some(&m_motionState) {
378                                    return _serde::__private::Err(
379                                        <__A::Error as _serde::de::Error>::duplicate_field(
380                                            "motionState",
381                                        ),
382                                    );
383                                }
384                                __A::pad(&mut __map, 2usize, 10usize)?;
385                                m_motionState = _serde::__private::Some(
386                                    match __A::next_value::<hkMotionState>(&mut __map) {
387                                        _serde::__private::Ok(__val) => __val,
388                                        _serde::__private::Err(__err) => {
389                                            return _serde::__private::Err(__err);
390                                        }
391                                    },
392                                );
393                            }
394                            4usize => {
395                                if _serde::__private::Option::is_some(
396                                    &m_inertiaAndMassInv,
397                                ) {
398                                    return _serde::__private::Err(
399                                        <__A::Error as _serde::de::Error>::duplicate_field(
400                                            "inertiaAndMassInv",
401                                        ),
402                                    );
403                                }
404                                m_inertiaAndMassInv = _serde::__private::Some(
405                                    match __A::next_value::<Vector4>(&mut __map) {
406                                        _serde::__private::Ok(__val) => __val,
407                                        _serde::__private::Err(__err) => {
408                                            return _serde::__private::Err(__err);
409                                        }
410                                    },
411                                );
412                            }
413                            5usize => {
414                                if _serde::__private::Option::is_some(&m_linearVelocity) {
415                                    return _serde::__private::Err(
416                                        <__A::Error as _serde::de::Error>::duplicate_field(
417                                            "linearVelocity",
418                                        ),
419                                    );
420                                }
421                                m_linearVelocity = _serde::__private::Some(
422                                    match __A::next_value::<Vector4>(&mut __map) {
423                                        _serde::__private::Ok(__val) => __val,
424                                        _serde::__private::Err(__err) => {
425                                            return _serde::__private::Err(__err);
426                                        }
427                                    },
428                                );
429                            }
430                            6usize => {
431                                if _serde::__private::Option::is_some(&m_angularVelocity) {
432                                    return _serde::__private::Err(
433                                        <__A::Error as _serde::de::Error>::duplicate_field(
434                                            "angularVelocity",
435                                        ),
436                                    );
437                                }
438                                m_angularVelocity = _serde::__private::Some(
439                                    match __A::next_value::<Vector4>(&mut __map) {
440                                        _serde::__private::Ok(__val) => __val,
441                                        _serde::__private::Err(__err) => {
442                                            return _serde::__private::Err(__err);
443                                        }
444                                    },
445                                );
446                            }
447                            7usize => {
448                                if _serde::__private::Option::is_some(
449                                    &m_deactivationRefPosition,
450                                ) {
451                                    return _serde::__private::Err(
452                                        <__A::Error as _serde::de::Error>::duplicate_field(
453                                            "deactivationRefPosition",
454                                        ),
455                                    );
456                                }
457                                m_deactivationRefPosition = _serde::__private::Some(
458                                    match __A::next_value::<[Vector4; 2usize]>(&mut __map) {
459                                        _serde::__private::Ok(__val) => __val,
460                                        _serde::__private::Err(__err) => {
461                                            return _serde::__private::Err(__err);
462                                        }
463                                    },
464                                );
465                            }
466                            8usize => {
467                                if _serde::__private::Option::is_some(
468                                    &m_deactivationRefOrientation,
469                                ) {
470                                    return _serde::__private::Err(
471                                        <__A::Error as _serde::de::Error>::duplicate_field(
472                                            "deactivationRefOrientation",
473                                        ),
474                                    );
475                                }
476                                m_deactivationRefOrientation = _serde::__private::Some(
477                                    match __A::next_value::<[u32; 2usize]>(&mut __map) {
478                                        _serde::__private::Ok(__val) => __val,
479                                        _serde::__private::Err(__err) => {
480                                            return _serde::__private::Err(__err);
481                                        }
482                                    },
483                                );
484                            }
485                            9usize => {
486                                if _serde::__private::Option::is_some(&m_savedMotion) {
487                                    return _serde::__private::Err(
488                                        <__A::Error as _serde::de::Error>::duplicate_field(
489                                            "savedMotion",
490                                        ),
491                                    );
492                                }
493                                m_savedMotion = _serde::__private::Some(
494                                    match __A::next_value::<Pointer>(&mut __map) {
495                                        _serde::__private::Ok(__val) => __val,
496                                        _serde::__private::Err(__err) => {
497                                            return _serde::__private::Err(__err);
498                                        }
499                                    },
500                                );
501                            }
502                            10usize => {
503                                if _serde::__private::Option::is_some(
504                                    &m_savedQualityTypeIndex,
505                                ) {
506                                    return _serde::__private::Err(
507                                        <__A::Error as _serde::de::Error>::duplicate_field(
508                                            "savedQualityTypeIndex",
509                                        ),
510                                    );
511                                }
512                                m_savedQualityTypeIndex = _serde::__private::Some(
513                                    match __A::next_value::<u16>(&mut __map) {
514                                        _serde::__private::Ok(__val) => __val,
515                                        _serde::__private::Err(__err) => {
516                                            return _serde::__private::Err(__err);
517                                        }
518                                    },
519                                );
520                            }
521                            11usize => {
522                                if _serde::__private::Option::is_some(&m_gravityFactor) {
523                                    return _serde::__private::Err(
524                                        <__A::Error as _serde::de::Error>::duplicate_field(
525                                            "gravityFactor",
526                                        ),
527                                    );
528                                }
529                                m_gravityFactor = _serde::__private::Some(
530                                    match __A::next_value::<f16>(&mut __map) {
531                                        _serde::__private::Ok(__val) => __val,
532                                        _serde::__private::Err(__err) => {
533                                            return _serde::__private::Err(__err);
534                                        }
535                                    },
536                                );
537                            }
538                            _ => {}
539                        }
540                    }
541                    __A::pad(&mut __map, 0usize, 12usize)?;
542                    let m_type = match m_type {
543                        _serde::__private::Some(__field) => __field,
544                        _serde::__private::None => {
545                            return _serde::__private::Err(
546                                <__A::Error as _serde::de::Error>::missing_field("type"),
547                            );
548                        }
549                    };
550                    let m_deactivationIntegrateCounter = match m_deactivationIntegrateCounter {
551                        _serde::__private::Some(__field) => __field,
552                        _serde::__private::None => {
553                            return _serde::__private::Err(
554                                <__A::Error as _serde::de::Error>::missing_field(
555                                    "deactivationIntegrateCounter",
556                                ),
557                            );
558                        }
559                    };
560                    let m_deactivationNumInactiveFrames = match m_deactivationNumInactiveFrames {
561                        _serde::__private::Some(__field) => __field,
562                        _serde::__private::None => {
563                            return _serde::__private::Err(
564                                <__A::Error as _serde::de::Error>::missing_field(
565                                    "deactivationNumInactiveFrames",
566                                ),
567                            );
568                        }
569                    };
570                    let m_motionState = match m_motionState {
571                        _serde::__private::Some(__field) => __field,
572                        _serde::__private::None => {
573                            return _serde::__private::Err(
574                                <__A::Error as _serde::de::Error>::missing_field(
575                                    "motionState",
576                                ),
577                            );
578                        }
579                    };
580                    let m_inertiaAndMassInv = match m_inertiaAndMassInv {
581                        _serde::__private::Some(__field) => __field,
582                        _serde::__private::None => {
583                            return _serde::__private::Err(
584                                <__A::Error as _serde::de::Error>::missing_field(
585                                    "inertiaAndMassInv",
586                                ),
587                            );
588                        }
589                    };
590                    let m_linearVelocity = match m_linearVelocity {
591                        _serde::__private::Some(__field) => __field,
592                        _serde::__private::None => {
593                            return _serde::__private::Err(
594                                <__A::Error as _serde::de::Error>::missing_field(
595                                    "linearVelocity",
596                                ),
597                            );
598                        }
599                    };
600                    let m_angularVelocity = match m_angularVelocity {
601                        _serde::__private::Some(__field) => __field,
602                        _serde::__private::None => {
603                            return _serde::__private::Err(
604                                <__A::Error as _serde::de::Error>::missing_field(
605                                    "angularVelocity",
606                                ),
607                            );
608                        }
609                    };
610                    let m_deactivationRefPosition = match m_deactivationRefPosition {
611                        _serde::__private::Some(__field) => __field,
612                        _serde::__private::None => {
613                            return _serde::__private::Err(
614                                <__A::Error as _serde::de::Error>::missing_field(
615                                    "deactivationRefPosition",
616                                ),
617                            );
618                        }
619                    };
620                    let m_deactivationRefOrientation = match m_deactivationRefOrientation {
621                        _serde::__private::Some(__field) => __field,
622                        _serde::__private::None => {
623                            return _serde::__private::Err(
624                                <__A::Error as _serde::de::Error>::missing_field(
625                                    "deactivationRefOrientation",
626                                ),
627                            );
628                        }
629                    };
630                    let m_savedMotion = match m_savedMotion {
631                        _serde::__private::Some(__field) => __field,
632                        _serde::__private::None => {
633                            return _serde::__private::Err(
634                                <__A::Error as _serde::de::Error>::missing_field(
635                                    "savedMotion",
636                                ),
637                            );
638                        }
639                    };
640                    let m_savedQualityTypeIndex = match m_savedQualityTypeIndex {
641                        _serde::__private::Some(__field) => __field,
642                        _serde::__private::None => {
643                            return _serde::__private::Err(
644                                <__A::Error as _serde::de::Error>::missing_field(
645                                    "savedQualityTypeIndex",
646                                ),
647                            );
648                        }
649                    };
650                    let m_gravityFactor = match m_gravityFactor {
651                        _serde::__private::Some(__field) => __field,
652                        _serde::__private::None => {
653                            return _serde::__private::Err(
654                                <__A::Error as _serde::de::Error>::missing_field(
655                                    "gravityFactor",
656                                ),
657                            );
658                        }
659                    };
660                    _serde::__private::Ok(hkpMotion {
661                        __ptr,
662                        parent,
663                        m_type,
664                        m_deactivationIntegrateCounter,
665                        m_deactivationNumInactiveFrames,
666                        m_motionState,
667                        m_inertiaAndMassInv,
668                        m_linearVelocity,
669                        m_angularVelocity,
670                        m_deactivationRefPosition,
671                        m_deactivationRefOrientation,
672                        m_savedMotion,
673                        m_savedQualityTypeIndex,
674                        m_gravityFactor,
675                    })
676                }
677                #[allow(clippy::manual_unwrap_or_default)]
678                fn visit_struct<__A>(
679                    self,
680                    mut __map: __A,
681                ) -> _serde::__private::Result<Self::Value, __A::Error>
682                where
683                    __A: _serde::de::MapAccess<'de>,
684                {
685                    let mut m_type: _serde::__private::Option<MotionType> = _serde::__private::None;
686                    let mut m_deactivationIntegrateCounter: _serde::__private::Option<
687                        u8,
688                    > = _serde::__private::None;
689                    let mut m_deactivationNumInactiveFrames: _serde::__private::Option<
690                        [u16; 2usize],
691                    > = _serde::__private::None;
692                    let mut m_motionState: _serde::__private::Option<hkMotionState> = _serde::__private::None;
693                    let mut m_inertiaAndMassInv: _serde::__private::Option<Vector4> = _serde::__private::None;
694                    let mut m_linearVelocity: _serde::__private::Option<Vector4> = _serde::__private::None;
695                    let mut m_angularVelocity: _serde::__private::Option<Vector4> = _serde::__private::None;
696                    let mut m_deactivationRefPosition: _serde::__private::Option<
697                        [Vector4; 2usize],
698                    > = _serde::__private::None;
699                    let mut m_deactivationRefOrientation: _serde::__private::Option<
700                        [u32; 2usize],
701                    > = _serde::__private::None;
702                    let mut m_savedMotion: _serde::__private::Option<Pointer> = _serde::__private::None;
703                    let mut m_savedQualityTypeIndex: _serde::__private::Option<u16> = _serde::__private::None;
704                    let mut m_gravityFactor: _serde::__private::Option<f16> = _serde::__private::None;
705                    while let _serde::__private::Some(__key) = {
706                        __A::next_key::<__Field>(&mut __map)?
707                    } {
708                        match __key {
709                            __Field::m_type => {
710                                #[cfg(
711                                    any(feature = "strict", feature = "ignore_duplicates")
712                                )]
713                                if _serde::__private::Option::is_some(&m_type) {
714                                    #[cfg(feature = "ignore_duplicates")]
715                                    {
716                                        __A::skip_value(&mut __map)?;
717                                        continue;
718                                    }
719                                    #[cfg(feature = "strict")]
720                                    return _serde::__private::Err(
721                                        <__A::Error as _serde::de::Error>::duplicate_field("type"),
722                                    );
723                                }
724                                m_type = _serde::__private::Some(
725                                    match __A::next_value::<MotionType>(&mut __map) {
726                                        _serde::__private::Ok(__val) => __val,
727                                        _serde::__private::Err(__err) => {
728                                            return _serde::__private::Err(__err);
729                                        }
730                                    },
731                                );
732                            }
733                            __Field::m_deactivationIntegrateCounter => {
734                                #[cfg(
735                                    any(feature = "strict", feature = "ignore_duplicates")
736                                )]
737                                if _serde::__private::Option::is_some(
738                                    &m_deactivationIntegrateCounter,
739                                ) {
740                                    #[cfg(feature = "ignore_duplicates")]
741                                    {
742                                        __A::skip_value(&mut __map)?;
743                                        continue;
744                                    }
745                                    #[cfg(feature = "strict")]
746                                    return _serde::__private::Err(
747                                        <__A::Error as _serde::de::Error>::duplicate_field(
748                                            "deactivationIntegrateCounter",
749                                        ),
750                                    );
751                                }
752                                m_deactivationIntegrateCounter = _serde::__private::Some(
753                                    match __A::next_value::<u8>(&mut __map) {
754                                        _serde::__private::Ok(__val) => __val,
755                                        _serde::__private::Err(__err) => {
756                                            return _serde::__private::Err(__err);
757                                        }
758                                    },
759                                );
760                            }
761                            __Field::m_deactivationNumInactiveFrames => {
762                                #[cfg(
763                                    any(feature = "strict", feature = "ignore_duplicates")
764                                )]
765                                if _serde::__private::Option::is_some(
766                                    &m_deactivationNumInactiveFrames,
767                                ) {
768                                    #[cfg(feature = "ignore_duplicates")]
769                                    {
770                                        __A::skip_value(&mut __map)?;
771                                        continue;
772                                    }
773                                    #[cfg(feature = "strict")]
774                                    return _serde::__private::Err(
775                                        <__A::Error as _serde::de::Error>::duplicate_field(
776                                            "deactivationNumInactiveFrames",
777                                        ),
778                                    );
779                                }
780                                m_deactivationNumInactiveFrames = _serde::__private::Some(
781                                    match __A::next_value::<[u16; 2usize]>(&mut __map) {
782                                        _serde::__private::Ok(__val) => __val,
783                                        _serde::__private::Err(__err) => {
784                                            return _serde::__private::Err(__err);
785                                        }
786                                    },
787                                );
788                            }
789                            __Field::m_motionState => {
790                                #[cfg(
791                                    any(feature = "strict", feature = "ignore_duplicates")
792                                )]
793                                if _serde::__private::Option::is_some(&m_motionState) {
794                                    #[cfg(feature = "ignore_duplicates")]
795                                    {
796                                        __A::skip_value(&mut __map)?;
797                                        continue;
798                                    }
799                                    #[cfg(feature = "strict")]
800                                    return _serde::__private::Err(
801                                        <__A::Error as _serde::de::Error>::duplicate_field(
802                                            "motionState",
803                                        ),
804                                    );
805                                }
806                                m_motionState = _serde::__private::Some(
807                                    match __A::next_value::<hkMotionState>(&mut __map) {
808                                        _serde::__private::Ok(__val) => __val,
809                                        _serde::__private::Err(__err) => {
810                                            return _serde::__private::Err(__err);
811                                        }
812                                    },
813                                );
814                            }
815                            __Field::m_inertiaAndMassInv => {
816                                #[cfg(
817                                    any(feature = "strict", feature = "ignore_duplicates")
818                                )]
819                                if _serde::__private::Option::is_some(
820                                    &m_inertiaAndMassInv,
821                                ) {
822                                    #[cfg(feature = "ignore_duplicates")]
823                                    {
824                                        __A::skip_value(&mut __map)?;
825                                        continue;
826                                    }
827                                    #[cfg(feature = "strict")]
828                                    return _serde::__private::Err(
829                                        <__A::Error as _serde::de::Error>::duplicate_field(
830                                            "inertiaAndMassInv",
831                                        ),
832                                    );
833                                }
834                                m_inertiaAndMassInv = _serde::__private::Some(
835                                    match __A::next_value::<Vector4>(&mut __map) {
836                                        _serde::__private::Ok(__val) => __val,
837                                        _serde::__private::Err(__err) => {
838                                            return _serde::__private::Err(__err);
839                                        }
840                                    },
841                                );
842                            }
843                            __Field::m_linearVelocity => {
844                                #[cfg(
845                                    any(feature = "strict", feature = "ignore_duplicates")
846                                )]
847                                if _serde::__private::Option::is_some(&m_linearVelocity) {
848                                    #[cfg(feature = "ignore_duplicates")]
849                                    {
850                                        __A::skip_value(&mut __map)?;
851                                        continue;
852                                    }
853                                    #[cfg(feature = "strict")]
854                                    return _serde::__private::Err(
855                                        <__A::Error as _serde::de::Error>::duplicate_field(
856                                            "linearVelocity",
857                                        ),
858                                    );
859                                }
860                                m_linearVelocity = _serde::__private::Some(
861                                    match __A::next_value::<Vector4>(&mut __map) {
862                                        _serde::__private::Ok(__val) => __val,
863                                        _serde::__private::Err(__err) => {
864                                            return _serde::__private::Err(__err);
865                                        }
866                                    },
867                                );
868                            }
869                            __Field::m_angularVelocity => {
870                                #[cfg(
871                                    any(feature = "strict", feature = "ignore_duplicates")
872                                )]
873                                if _serde::__private::Option::is_some(&m_angularVelocity) {
874                                    #[cfg(feature = "ignore_duplicates")]
875                                    {
876                                        __A::skip_value(&mut __map)?;
877                                        continue;
878                                    }
879                                    #[cfg(feature = "strict")]
880                                    return _serde::__private::Err(
881                                        <__A::Error as _serde::de::Error>::duplicate_field(
882                                            "angularVelocity",
883                                        ),
884                                    );
885                                }
886                                m_angularVelocity = _serde::__private::Some(
887                                    match __A::next_value::<Vector4>(&mut __map) {
888                                        _serde::__private::Ok(__val) => __val,
889                                        _serde::__private::Err(__err) => {
890                                            return _serde::__private::Err(__err);
891                                        }
892                                    },
893                                );
894                            }
895                            __Field::m_deactivationRefPosition => {
896                                #[cfg(
897                                    any(feature = "strict", feature = "ignore_duplicates")
898                                )]
899                                if _serde::__private::Option::is_some(
900                                    &m_deactivationRefPosition,
901                                ) {
902                                    #[cfg(feature = "ignore_duplicates")]
903                                    {
904                                        __A::skip_value(&mut __map)?;
905                                        continue;
906                                    }
907                                    #[cfg(feature = "strict")]
908                                    return _serde::__private::Err(
909                                        <__A::Error as _serde::de::Error>::duplicate_field(
910                                            "deactivationRefPosition",
911                                        ),
912                                    );
913                                }
914                                m_deactivationRefPosition = _serde::__private::Some(
915                                    match __A::next_value::<[Vector4; 2usize]>(&mut __map) {
916                                        _serde::__private::Ok(__val) => __val,
917                                        _serde::__private::Err(__err) => {
918                                            return _serde::__private::Err(__err);
919                                        }
920                                    },
921                                );
922                            }
923                            __Field::m_deactivationRefOrientation => {
924                                #[cfg(
925                                    any(feature = "strict", feature = "ignore_duplicates")
926                                )]
927                                if _serde::__private::Option::is_some(
928                                    &m_deactivationRefOrientation,
929                                ) {
930                                    #[cfg(feature = "ignore_duplicates")]
931                                    {
932                                        __A::skip_value(&mut __map)?;
933                                        continue;
934                                    }
935                                    #[cfg(feature = "strict")]
936                                    return _serde::__private::Err(
937                                        <__A::Error as _serde::de::Error>::duplicate_field(
938                                            "deactivationRefOrientation",
939                                        ),
940                                    );
941                                }
942                                m_deactivationRefOrientation = _serde::__private::Some(
943                                    match __A::next_value::<[u32; 2usize]>(&mut __map) {
944                                        _serde::__private::Ok(__val) => __val,
945                                        _serde::__private::Err(__err) => {
946                                            return _serde::__private::Err(__err);
947                                        }
948                                    },
949                                );
950                            }
951                            __Field::m_savedMotion => {
952                                #[cfg(
953                                    any(feature = "strict", feature = "ignore_duplicates")
954                                )]
955                                if _serde::__private::Option::is_some(&m_savedMotion) {
956                                    #[cfg(feature = "ignore_duplicates")]
957                                    {
958                                        __A::skip_value(&mut __map)?;
959                                        continue;
960                                    }
961                                    #[cfg(feature = "strict")]
962                                    return _serde::__private::Err(
963                                        <__A::Error as _serde::de::Error>::duplicate_field(
964                                            "savedMotion",
965                                        ),
966                                    );
967                                }
968                                m_savedMotion = _serde::__private::Some(
969                                    match __A::next_value::<Pointer>(&mut __map) {
970                                        _serde::__private::Ok(__val) => __val,
971                                        _serde::__private::Err(__err) => {
972                                            return _serde::__private::Err(__err);
973                                        }
974                                    },
975                                );
976                            }
977                            __Field::m_savedQualityTypeIndex => {
978                                #[cfg(
979                                    any(feature = "strict", feature = "ignore_duplicates")
980                                )]
981                                if _serde::__private::Option::is_some(
982                                    &m_savedQualityTypeIndex,
983                                ) {
984                                    #[cfg(feature = "ignore_duplicates")]
985                                    {
986                                        __A::skip_value(&mut __map)?;
987                                        continue;
988                                    }
989                                    #[cfg(feature = "strict")]
990                                    return _serde::__private::Err(
991                                        <__A::Error as _serde::de::Error>::duplicate_field(
992                                            "savedQualityTypeIndex",
993                                        ),
994                                    );
995                                }
996                                m_savedQualityTypeIndex = _serde::__private::Some(
997                                    match __A::next_value::<u16>(&mut __map) {
998                                        _serde::__private::Ok(__val) => __val,
999                                        _serde::__private::Err(__err) => {
1000                                            return _serde::__private::Err(__err);
1001                                        }
1002                                    },
1003                                );
1004                            }
1005                            __Field::m_gravityFactor => {
1006                                #[cfg(
1007                                    any(feature = "strict", feature = "ignore_duplicates")
1008                                )]
1009                                if _serde::__private::Option::is_some(&m_gravityFactor) {
1010                                    #[cfg(feature = "ignore_duplicates")]
1011                                    {
1012                                        __A::skip_value(&mut __map)?;
1013                                        continue;
1014                                    }
1015                                    #[cfg(feature = "strict")]
1016                                    return _serde::__private::Err(
1017                                        <__A::Error as _serde::de::Error>::duplicate_field(
1018                                            "gravityFactor",
1019                                        ),
1020                                    );
1021                                }
1022                                m_gravityFactor = _serde::__private::Some(
1023                                    match __A::next_value::<f16>(&mut __map) {
1024                                        _serde::__private::Ok(__val) => __val,
1025                                        _serde::__private::Err(__err) => {
1026                                            return _serde::__private::Err(__err);
1027                                        }
1028                                    },
1029                                );
1030                            }
1031                            _ => __A::skip_value(&mut __map)?,
1032                        }
1033                    }
1034                    let m_type = match m_type {
1035                        _serde::__private::Some(__field) => __field,
1036                        _serde::__private::None => {
1037                            #[cfg(feature = "strict")]
1038                            return _serde::__private::Err(
1039                                <__A::Error as _serde::de::Error>::missing_field("type"),
1040                            );
1041                            #[cfg(not(feature = "strict"))] Default::default()
1042                        }
1043                    };
1044                    let m_deactivationIntegrateCounter = match m_deactivationIntegrateCounter {
1045                        _serde::__private::Some(__field) => __field,
1046                        _serde::__private::None => {
1047                            #[cfg(feature = "strict")]
1048                            return _serde::__private::Err(
1049                                <__A::Error as _serde::de::Error>::missing_field(
1050                                    "deactivationIntegrateCounter",
1051                                ),
1052                            );
1053                            #[cfg(not(feature = "strict"))] Default::default()
1054                        }
1055                    };
1056                    let m_deactivationNumInactiveFrames = match m_deactivationNumInactiveFrames {
1057                        _serde::__private::Some(__field) => __field,
1058                        _serde::__private::None => {
1059                            #[cfg(feature = "strict")]
1060                            return _serde::__private::Err(
1061                                <__A::Error as _serde::de::Error>::missing_field(
1062                                    "deactivationNumInactiveFrames",
1063                                ),
1064                            );
1065                            #[cfg(not(feature = "strict"))] Default::default()
1066                        }
1067                    };
1068                    let m_motionState = match m_motionState {
1069                        _serde::__private::Some(__field) => __field,
1070                        _serde::__private::None => {
1071                            #[cfg(feature = "strict")]
1072                            return _serde::__private::Err(
1073                                <__A::Error as _serde::de::Error>::missing_field(
1074                                    "motionState",
1075                                ),
1076                            );
1077                            #[cfg(not(feature = "strict"))] Default::default()
1078                        }
1079                    };
1080                    let m_inertiaAndMassInv = match m_inertiaAndMassInv {
1081                        _serde::__private::Some(__field) => __field,
1082                        _serde::__private::None => {
1083                            #[cfg(feature = "strict")]
1084                            return _serde::__private::Err(
1085                                <__A::Error as _serde::de::Error>::missing_field(
1086                                    "inertiaAndMassInv",
1087                                ),
1088                            );
1089                            #[cfg(not(feature = "strict"))] Default::default()
1090                        }
1091                    };
1092                    let m_linearVelocity = match m_linearVelocity {
1093                        _serde::__private::Some(__field) => __field,
1094                        _serde::__private::None => {
1095                            #[cfg(feature = "strict")]
1096                            return _serde::__private::Err(
1097                                <__A::Error as _serde::de::Error>::missing_field(
1098                                    "linearVelocity",
1099                                ),
1100                            );
1101                            #[cfg(not(feature = "strict"))] Default::default()
1102                        }
1103                    };
1104                    let m_angularVelocity = match m_angularVelocity {
1105                        _serde::__private::Some(__field) => __field,
1106                        _serde::__private::None => {
1107                            #[cfg(feature = "strict")]
1108                            return _serde::__private::Err(
1109                                <__A::Error as _serde::de::Error>::missing_field(
1110                                    "angularVelocity",
1111                                ),
1112                            );
1113                            #[cfg(not(feature = "strict"))] Default::default()
1114                        }
1115                    };
1116                    let m_deactivationRefPosition = match m_deactivationRefPosition {
1117                        _serde::__private::Some(__field) => __field,
1118                        _serde::__private::None => {
1119                            #[cfg(feature = "strict")]
1120                            return _serde::__private::Err(
1121                                <__A::Error as _serde::de::Error>::missing_field(
1122                                    "deactivationRefPosition",
1123                                ),
1124                            );
1125                            #[cfg(not(feature = "strict"))] Default::default()
1126                        }
1127                    };
1128                    let m_deactivationRefOrientation = match m_deactivationRefOrientation {
1129                        _serde::__private::Some(__field) => __field,
1130                        _serde::__private::None => {
1131                            #[cfg(feature = "strict")]
1132                            return _serde::__private::Err(
1133                                <__A::Error as _serde::de::Error>::missing_field(
1134                                    "deactivationRefOrientation",
1135                                ),
1136                            );
1137                            #[cfg(not(feature = "strict"))] Default::default()
1138                        }
1139                    };
1140                    let m_savedMotion = match m_savedMotion {
1141                        _serde::__private::Some(__field) => __field,
1142                        _serde::__private::None => {
1143                            #[cfg(feature = "strict")]
1144                            return _serde::__private::Err(
1145                                <__A::Error as _serde::de::Error>::missing_field(
1146                                    "savedMotion",
1147                                ),
1148                            );
1149                            #[cfg(not(feature = "strict"))] Default::default()
1150                        }
1151                    };
1152                    let m_savedQualityTypeIndex = match m_savedQualityTypeIndex {
1153                        _serde::__private::Some(__field) => __field,
1154                        _serde::__private::None => {
1155                            #[cfg(feature = "strict")]
1156                            return _serde::__private::Err(
1157                                <__A::Error as _serde::de::Error>::missing_field(
1158                                    "savedQualityTypeIndex",
1159                                ),
1160                            );
1161                            #[cfg(not(feature = "strict"))] Default::default()
1162                        }
1163                    };
1164                    let m_gravityFactor = match m_gravityFactor {
1165                        _serde::__private::Some(__field) => __field,
1166                        _serde::__private::None => {
1167                            #[cfg(feature = "strict")]
1168                            return _serde::__private::Err(
1169                                <__A::Error as _serde::de::Error>::missing_field(
1170                                    "gravityFactor",
1171                                ),
1172                            );
1173                            #[cfg(not(feature = "strict"))] Default::default()
1174                        }
1175                    };
1176                    let __ptr = None;
1177                    let parent = hkBaseObject { __ptr };
1178                    let parent = hkReferencedObject {
1179                        __ptr,
1180                        parent,
1181                        ..Default::default()
1182                    };
1183                    let __ptr = __A::class_ptr(&mut __map);
1184                    _serde::__private::Ok(hkpMotion {
1185                        __ptr,
1186                        parent,
1187                        m_type,
1188                        m_deactivationIntegrateCounter,
1189                        m_deactivationNumInactiveFrames,
1190                        m_motionState,
1191                        m_inertiaAndMassInv,
1192                        m_linearVelocity,
1193                        m_angularVelocity,
1194                        m_deactivationRefPosition,
1195                        m_deactivationRefOrientation,
1196                        m_savedMotion,
1197                        m_savedQualityTypeIndex,
1198                        m_gravityFactor,
1199                    })
1200                }
1201            }
1202            const FIELDS: &[&str] = &[
1203                "type",
1204                "deactivationIntegrateCounter",
1205                "deactivationNumInactiveFrames",
1206                "motionState",
1207                "inertiaAndMassInv",
1208                "linearVelocity",
1209                "angularVelocity",
1210                "deactivationRefPosition",
1211                "deactivationRefOrientation",
1212                "savedMotion",
1213                "savedQualityTypeIndex",
1214                "gravityFactor",
1215            ];
1216            _serde::Deserializer::deserialize_struct(
1217                deserializer,
1218                "hkpMotion",
1219                FIELDS,
1220                __hkpMotionVisitor {
1221                    marker: _serde::__private::PhantomData::<hkpMotion>,
1222                    lifetime: _serde::__private::PhantomData,
1223                },
1224            )
1225        }
1226    }
1227};
1228/// # C++ Info
1229/// - name: `MotionType`(ctype: `hkEnum<MotionType, hkUint8>`)
1230#[allow(non_upper_case_globals, non_snake_case)]
1231#[cfg_attr(feature = "json_schema", derive(schemars::JsonSchema))]
1232#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
1233#[derive(
1234    Debug,
1235    Clone,
1236    Default,
1237    PartialEq,
1238    Eq,
1239    PartialOrd,
1240    Ord,
1241    num_derive::ToPrimitive,
1242    num_derive::FromPrimitive,
1243)]
1244pub enum MotionType {
1245    #[default]
1246    MOTION_INVALID = 0isize,
1247    MOTION_DYNAMIC = 1isize,
1248    MOTION_SPHERE_INERTIA = 2isize,
1249    MOTION_BOX_INERTIA = 3isize,
1250    MOTION_KEYFRAMED = 4isize,
1251    MOTION_FIXED = 5isize,
1252    MOTION_THIN_BOX_INERTIA = 6isize,
1253    MOTION_CHARACTER = 7isize,
1254    MOTION_MAX_ID = 8isize,
1255}
1256const _: () = {
1257    use havok_serde as __serde;
1258    impl __serde::Serialize for MotionType {
1259        fn serialize<S>(&self, __serializer: S) -> Result<S::Ok, S::Error>
1260        where
1261            S: __serde::ser::Serializer,
1262        {
1263            let mut __serializer = __serializer.serialize_enum_flags()?;
1264            match self {
1265                Self::MOTION_INVALID => {
1266                    __serializer.serialize_field("MOTION_INVALID", &0u64)
1267                }
1268                Self::MOTION_DYNAMIC => {
1269                    __serializer.serialize_field("MOTION_DYNAMIC", &1u64)
1270                }
1271                Self::MOTION_SPHERE_INERTIA => {
1272                    __serializer.serialize_field("MOTION_SPHERE_INERTIA", &2u64)
1273                }
1274                Self::MOTION_BOX_INERTIA => {
1275                    __serializer.serialize_field("MOTION_BOX_INERTIA", &3u64)
1276                }
1277                Self::MOTION_KEYFRAMED => {
1278                    __serializer.serialize_field("MOTION_KEYFRAMED", &4u64)
1279                }
1280                Self::MOTION_FIXED => __serializer.serialize_field("MOTION_FIXED", &5u64),
1281                Self::MOTION_THIN_BOX_INERTIA => {
1282                    __serializer.serialize_field("MOTION_THIN_BOX_INERTIA", &6u64)
1283                }
1284                Self::MOTION_CHARACTER => {
1285                    __serializer.serialize_field("MOTION_CHARACTER", &7u64)
1286                }
1287                Self::MOTION_MAX_ID => {
1288                    __serializer.serialize_field("MOTION_MAX_ID", &8u64)
1289                }
1290            }?;
1291            use num_traits::ToPrimitive as _;
1292            let num = self
1293                .to_u8()
1294                .ok_or(S::Error::custom("Failed enum MotionType to_u8"))?;
1295            __serializer.serialize_bits(&num)?;
1296            __serializer.end()
1297        }
1298    }
1299};
1300#[doc(hidden)]
1301#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
1302const _: () = {
1303    #[allow(unused_extern_crates, clippy::useless_attribute)]
1304    extern crate havok_serde as _serde;
1305    #[automatically_derived]
1306    impl<'de> _serde::Deserialize<'de> for MotionType {
1307        fn deserialize<__D>(
1308            __deserializer: __D,
1309        ) -> _serde::__private::Result<Self, __D::Error>
1310        where
1311            __D: _serde::Deserializer<'de>,
1312        {
1313            #[allow(non_camel_case_types)]
1314            #[doc(hidden)]
1315            enum __Field {
1316                __field0,
1317                __field1,
1318                __field2,
1319                __field3,
1320                __field4,
1321                __field5,
1322                __field6,
1323                __field7,
1324                __field8,
1325            }
1326            #[doc(hidden)]
1327            struct __FieldVisitor;
1328            impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
1329                type Value = __Field;
1330                fn expecting(
1331                    &self,
1332                    __formatter: &mut _serde::__private::Formatter,
1333                ) -> _serde::__private::fmt::Result {
1334                    _serde::__private::Formatter::write_str(
1335                        __formatter,
1336                        "variant identifier",
1337                    )
1338                }
1339                fn visit_uint8<__E>(
1340                    self,
1341                    __value: u8,
1342                ) -> _serde::__private::Result<Self::Value, __E>
1343                where
1344                    __E: _serde::de::Error,
1345                {
1346                    match __value {
1347                        0u8 => _serde::__private::Ok(__Field::__field0),
1348                        1u8 => _serde::__private::Ok(__Field::__field1),
1349                        2u8 => _serde::__private::Ok(__Field::__field2),
1350                        3u8 => _serde::__private::Ok(__Field::__field3),
1351                        4u8 => _serde::__private::Ok(__Field::__field4),
1352                        5u8 => _serde::__private::Ok(__Field::__field5),
1353                        6u8 => _serde::__private::Ok(__Field::__field6),
1354                        7u8 => _serde::__private::Ok(__Field::__field7),
1355                        8u8 => _serde::__private::Ok(__Field::__field8),
1356                        _ => {
1357                            _serde::__private::Err(
1358                                _serde::de::Error::invalid_value(
1359                                    _serde::de::Unexpected::Uint8(__value),
1360                                    &"value(u8) of variant is one of 0, 1, 2, 3, 4, 5, 6, 7, 8",
1361                                ),
1362                            )
1363                        }
1364                    }
1365                }
1366                fn visit_stringptr<__E>(
1367                    self,
1368                    __value: StringPtr<'de>,
1369                ) -> _serde::__private::Result<Self::Value, __E>
1370                where
1371                    __E: _serde::de::Error,
1372                {
1373                    if let Some(__value) = __value.into_inner() {
1374                        match __value.as_ref() {
1375                            v if v == "0" || v.eq_ignore_ascii_case("MOTION_INVALID") => {
1376                                _serde::__private::Ok(__Field::__field0)
1377                            }
1378                            v if v == "1" || v.eq_ignore_ascii_case("MOTION_DYNAMIC") => {
1379                                _serde::__private::Ok(__Field::__field1)
1380                            }
1381                            v if v == "2"
1382                                || v.eq_ignore_ascii_case("MOTION_SPHERE_INERTIA") => {
1383                                _serde::__private::Ok(__Field::__field2)
1384                            }
1385                            v if v == "3"
1386                                || v.eq_ignore_ascii_case("MOTION_BOX_INERTIA") => {
1387                                _serde::__private::Ok(__Field::__field3)
1388                            }
1389                            v if v == "4"
1390                                || v.eq_ignore_ascii_case("MOTION_KEYFRAMED") => {
1391                                _serde::__private::Ok(__Field::__field4)
1392                            }
1393                            v if v == "5" || v.eq_ignore_ascii_case("MOTION_FIXED") => {
1394                                _serde::__private::Ok(__Field::__field5)
1395                            }
1396                            v if v == "6"
1397                                || v.eq_ignore_ascii_case("MOTION_THIN_BOX_INERTIA") => {
1398                                _serde::__private::Ok(__Field::__field6)
1399                            }
1400                            v if v == "7"
1401                                || v.eq_ignore_ascii_case("MOTION_CHARACTER") => {
1402                                _serde::__private::Ok(__Field::__field7)
1403                            }
1404                            v if v == "8" || v.eq_ignore_ascii_case("MOTION_MAX_ID") => {
1405                                _serde::__private::Ok(__Field::__field8)
1406                            }
1407                            _ => {
1408                                _serde::__private::Err(
1409                                    _serde::de::Error::unknown_variant(&__value, VARIANTS),
1410                                )
1411                            }
1412                        }
1413                    } else {
1414                        _serde::__private::Err(
1415                            _serde::de::Error::unknown_variant("None", VARIANTS),
1416                        )
1417                    }
1418                }
1419            }
1420            impl<'de> _serde::Deserialize<'de> for __Field {
1421                #[inline]
1422                fn deserialize<__D>(
1423                    __deserializer: __D,
1424                ) -> _serde::__private::Result<Self, __D::Error>
1425                where
1426                    __D: _serde::Deserializer<'de>,
1427                {
1428                    _serde::Deserializer::deserialize_identifier(
1429                        __deserializer,
1430                        _serde::de::ReadEnumSize::Uint8,
1431                        __FieldVisitor,
1432                    )
1433                }
1434            }
1435            #[doc(hidden)]
1436            struct __Visitor<'de> {
1437                marker: _serde::__private::PhantomData<MotionType>,
1438                lifetime: _serde::__private::PhantomData<&'de ()>,
1439            }
1440            impl<'de> _serde::de::Visitor<'de> for __Visitor<'de> {
1441                type Value = MotionType;
1442                fn expecting(
1443                    &self,
1444                    __formatter: &mut _serde::__private::Formatter,
1445                ) -> _serde::__private::fmt::Result {
1446                    _serde::__private::Formatter::write_str(
1447                        __formatter,
1448                        "enum MotionType",
1449                    )
1450                }
1451                fn visit_enum<__A>(
1452                    self,
1453                    __data: __A,
1454                ) -> _serde::__private::Result<Self::Value, __A::Error>
1455                where
1456                    __A: _serde::de::EnumAccess<'de>,
1457                {
1458                    match _serde::de::EnumAccess::variant(__data)? {
1459                        (__Field::__field0, __variant) => {
1460                            _serde::de::VariantAccess::unit_variant(__variant)?;
1461                            _serde::__private::Ok(MotionType::MOTION_INVALID)
1462                        }
1463                        (__Field::__field1, __variant) => {
1464                            _serde::de::VariantAccess::unit_variant(__variant)?;
1465                            _serde::__private::Ok(MotionType::MOTION_DYNAMIC)
1466                        }
1467                        (__Field::__field2, __variant) => {
1468                            _serde::de::VariantAccess::unit_variant(__variant)?;
1469                            _serde::__private::Ok(MotionType::MOTION_SPHERE_INERTIA)
1470                        }
1471                        (__Field::__field3, __variant) => {
1472                            _serde::de::VariantAccess::unit_variant(__variant)?;
1473                            _serde::__private::Ok(MotionType::MOTION_BOX_INERTIA)
1474                        }
1475                        (__Field::__field4, __variant) => {
1476                            _serde::de::VariantAccess::unit_variant(__variant)?;
1477                            _serde::__private::Ok(MotionType::MOTION_KEYFRAMED)
1478                        }
1479                        (__Field::__field5, __variant) => {
1480                            _serde::de::VariantAccess::unit_variant(__variant)?;
1481                            _serde::__private::Ok(MotionType::MOTION_FIXED)
1482                        }
1483                        (__Field::__field6, __variant) => {
1484                            _serde::de::VariantAccess::unit_variant(__variant)?;
1485                            _serde::__private::Ok(MotionType::MOTION_THIN_BOX_INERTIA)
1486                        }
1487                        (__Field::__field7, __variant) => {
1488                            _serde::de::VariantAccess::unit_variant(__variant)?;
1489                            _serde::__private::Ok(MotionType::MOTION_CHARACTER)
1490                        }
1491                        (__Field::__field8, __variant) => {
1492                            _serde::de::VariantAccess::unit_variant(__variant)?;
1493                            _serde::__private::Ok(MotionType::MOTION_MAX_ID)
1494                        }
1495                    }
1496                }
1497            }
1498            #[doc(hidden)]
1499            const VARIANTS: &'static [&'static str] = &[
1500                "MOTION_INVALID",
1501                "MOTION_DYNAMIC",
1502                "MOTION_SPHERE_INERTIA",
1503                "MOTION_BOX_INERTIA",
1504                "MOTION_KEYFRAMED",
1505                "MOTION_FIXED",
1506                "MOTION_THIN_BOX_INERTIA",
1507                "MOTION_CHARACTER",
1508                "MOTION_MAX_ID",
1509            ];
1510            _serde::Deserializer::deserialize_enum(
1511                __deserializer,
1512                "MotionType",
1513                VARIANTS,
1514                __Visitor {
1515                    marker: _serde::__private::PhantomData::<MotionType>,
1516                    lifetime: _serde::__private::PhantomData,
1517                },
1518            )
1519        }
1520    }
1521};