havok_classes/generated/
hkbCharacterControllerControlData_.rs

1use super::class_requires::*;
2use super::*;
3/// # C++ Info
4/// - name: `hkbCharacterControllerControlData`
5/// - version: `0`
6/// - signature: `0x5b6c03d9`
7/// - size: ` 32`(x86)/` 32`(x86_64)
8/// -  vtable: `false`
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 hkbCharacterControllerControlData {
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    /// # C++ Info
27    /// - name: `desiredVelocity`(ctype: `hkVector4`)
28    /// - offset: `  0`(x86)/`  0`(x86_64)
29    /// - type_size: ` 16`(x86)/` 16`(x86_64)
30    #[cfg_attr(feature = "json_schema", schemars(rename = "desiredVelocity"))]
31    #[cfg_attr(feature = "serde", serde(rename = "desiredVelocity"))]
32    pub m_desiredVelocity: Vector4,
33    /// # C++ Info
34    /// - name: `verticalGain`(ctype: `hkReal`)
35    /// - offset: ` 16`(x86)/` 16`(x86_64)
36    /// - type_size: `  4`(x86)/`  4`(x86_64)
37    #[cfg_attr(feature = "json_schema", schemars(rename = "verticalGain"))]
38    #[cfg_attr(feature = "serde", serde(rename = "verticalGain"))]
39    pub m_verticalGain: f32,
40    /// # C++ Info
41    /// - name: `horizontalCatchUpGain`(ctype: `hkReal`)
42    /// - offset: ` 20`(x86)/` 20`(x86_64)
43    /// - type_size: `  4`(x86)/`  4`(x86_64)
44    #[cfg_attr(feature = "json_schema", schemars(rename = "horizontalCatchUpGain"))]
45    #[cfg_attr(feature = "serde", serde(rename = "horizontalCatchUpGain"))]
46    pub m_horizontalCatchUpGain: f32,
47    /// # C++ Info
48    /// - name: `maxVerticalSeparation`(ctype: `hkReal`)
49    /// - offset: ` 24`(x86)/` 24`(x86_64)
50    /// - type_size: `  4`(x86)/`  4`(x86_64)
51    #[cfg_attr(feature = "json_schema", schemars(rename = "maxVerticalSeparation"))]
52    #[cfg_attr(feature = "serde", serde(rename = "maxVerticalSeparation"))]
53    pub m_maxVerticalSeparation: f32,
54    /// # C++ Info
55    /// - name: `maxHorizontalSeparation`(ctype: `hkReal`)
56    /// - offset: ` 28`(x86)/` 28`(x86_64)
57    /// - type_size: `  4`(x86)/`  4`(x86_64)
58    #[cfg_attr(feature = "json_schema", schemars(rename = "maxHorizontalSeparation"))]
59    #[cfg_attr(feature = "serde", serde(rename = "maxHorizontalSeparation"))]
60    pub m_maxHorizontalSeparation: f32,
61}
62const _: () = {
63    use havok_serde as _serde;
64    impl _serde::HavokClass for hkbCharacterControllerControlData {
65        #[inline]
66        fn name(&self) -> &'static str {
67            "hkbCharacterControllerControlData"
68        }
69        #[inline]
70        fn signature(&self) -> _serde::__private::Signature {
71            _serde::__private::Signature::new(0x5b6c03d9)
72        }
73        #[allow(clippy::let_and_return, clippy::vec_init_then_push)]
74        fn deps_indexes(&self) -> Vec<usize> {
75            let mut v = Vec::new();
76            v
77        }
78    }
79    impl _serde::Serialize for hkbCharacterControllerControlData {
80        fn serialize<S>(&self, __serializer: S) -> Result<S::Ok, S::Error>
81        where
82            S: _serde::ser::Serializer,
83        {
84            let class_meta = self
85                .__ptr
86                .map(|name| (name, _serde::__private::Signature::new(0x5b6c03d9)));
87            let mut serializer = __serializer
88                .serialize_struct(
89                    "hkbCharacterControllerControlData",
90                    class_meta,
91                    (32u64, 32u64),
92                )?;
93            serializer.serialize_field("desiredVelocity", &self.m_desiredVelocity)?;
94            serializer.serialize_field("verticalGain", &self.m_verticalGain)?;
95            serializer
96                .serialize_field(
97                    "horizontalCatchUpGain",
98                    &self.m_horizontalCatchUpGain,
99                )?;
100            serializer
101                .serialize_field(
102                    "maxVerticalSeparation",
103                    &self.m_maxVerticalSeparation,
104                )?;
105            serializer
106                .serialize_field(
107                    "maxHorizontalSeparation",
108                    &self.m_maxHorizontalSeparation,
109                )?;
110            serializer.end()
111        }
112    }
113};
114#[doc(hidden)]
115#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
116const _: () = {
117    use havok_serde as _serde;
118    #[automatically_derived]
119    impl<'de> _serde::Deserialize<'de> for hkbCharacterControllerControlData {
120        fn deserialize<__D>(deserializer: __D) -> core::result::Result<Self, __D::Error>
121        where
122            __D: _serde::Deserializer<'de>,
123        {
124            #[allow(non_camel_case_types)]
125            enum __Field {
126                m_desiredVelocity,
127                m_verticalGain,
128                m_horizontalCatchUpGain,
129                m_maxVerticalSeparation,
130                m_maxHorizontalSeparation,
131                __ignore,
132            }
133            struct __FieldVisitor;
134            impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
135                type Value = __Field;
136                fn expecting(
137                    &self,
138                    __formatter: &mut core::fmt::Formatter,
139                ) -> core::fmt::Result {
140                    core::fmt::Formatter::write_str(__formatter, "field identifier")
141                }
142                /// Intended for use in XML.
143                #[allow(clippy::match_single_binding)]
144                #[allow(clippy::reversed_empty_ranges)]
145                #[allow(clippy::single_match)]
146                fn visit_key<__E>(
147                    self,
148                    __value: &str,
149                ) -> core::result::Result<Self::Value, __E>
150                where
151                    __E: _serde::de::Error,
152                {
153                    match __value {
154                        "desiredVelocity" => Ok(__Field::m_desiredVelocity),
155                        "verticalGain" => Ok(__Field::m_verticalGain),
156                        "horizontalCatchUpGain" => Ok(__Field::m_horizontalCatchUpGain),
157                        "maxVerticalSeparation" => Ok(__Field::m_maxVerticalSeparation),
158                        "maxHorizontalSeparation" => {
159                            Ok(__Field::m_maxHorizontalSeparation)
160                        }
161                        _ => Ok(__Field::__ignore),
162                    }
163                }
164            }
165            impl<'de> _serde::Deserialize<'de> for __Field {
166                #[inline]
167                fn deserialize<__D>(
168                    __deserializer: __D,
169                ) -> core::result::Result<Self, __D::Error>
170                where
171                    __D: _serde::Deserializer<'de>,
172                {
173                    _serde::Deserializer::deserialize_key(__deserializer, __FieldVisitor)
174                }
175            }
176            struct __hkbCharacterControllerControlDataVisitor<'de> {
177                marker: _serde::__private::PhantomData<
178                    hkbCharacterControllerControlData,
179                >,
180                lifetime: _serde::__private::PhantomData<&'de ()>,
181            }
182            #[allow(clippy::match_single_binding)]
183            #[allow(clippy::reversed_empty_ranges)]
184            #[allow(clippy::single_match)]
185            impl<'de> _serde::de::Visitor<'de>
186            for __hkbCharacterControllerControlDataVisitor<'de> {
187                type Value = hkbCharacterControllerControlData;
188                fn expecting(
189                    &self,
190                    __formatter: &mut core::fmt::Formatter,
191                ) -> core::fmt::Result {
192                    core::fmt::Formatter::write_str(
193                        __formatter,
194                        "struct hkbCharacterControllerControlData",
195                    )
196                }
197                fn visit_struct_for_bytes<__A>(
198                    self,
199                    mut __map: __A,
200                ) -> _serde::__private::Result<Self::Value, __A::Error>
201                where
202                    __A: _serde::de::MapAccess<'de>,
203                {
204                    let __ptr = __A::class_ptr(&mut __map);
205                    let mut m_desiredVelocity: _serde::__private::Option<Vector4> = _serde::__private::None;
206                    let mut m_verticalGain: _serde::__private::Option<f32> = _serde::__private::None;
207                    let mut m_horizontalCatchUpGain: _serde::__private::Option<f32> = _serde::__private::None;
208                    let mut m_maxVerticalSeparation: _serde::__private::Option<f32> = _serde::__private::None;
209                    let mut m_maxHorizontalSeparation: _serde::__private::Option<f32> = _serde::__private::None;
210                    for i in 0..5usize {
211                        match i {
212                            0usize => {
213                                if _serde::__private::Option::is_some(&m_desiredVelocity) {
214                                    return _serde::__private::Err(
215                                        <__A::Error as _serde::de::Error>::duplicate_field(
216                                            "desiredVelocity",
217                                        ),
218                                    );
219                                }
220                                m_desiredVelocity = _serde::__private::Some(
221                                    match __A::next_value::<Vector4>(&mut __map) {
222                                        _serde::__private::Ok(__val) => __val,
223                                        _serde::__private::Err(__err) => {
224                                            return _serde::__private::Err(__err);
225                                        }
226                                    },
227                                );
228                            }
229                            1usize => {
230                                if _serde::__private::Option::is_some(&m_verticalGain) {
231                                    return _serde::__private::Err(
232                                        <__A::Error as _serde::de::Error>::duplicate_field(
233                                            "verticalGain",
234                                        ),
235                                    );
236                                }
237                                m_verticalGain = _serde::__private::Some(
238                                    match __A::next_value::<f32>(&mut __map) {
239                                        _serde::__private::Ok(__val) => __val,
240                                        _serde::__private::Err(__err) => {
241                                            return _serde::__private::Err(__err);
242                                        }
243                                    },
244                                );
245                            }
246                            2usize => {
247                                if _serde::__private::Option::is_some(
248                                    &m_horizontalCatchUpGain,
249                                ) {
250                                    return _serde::__private::Err(
251                                        <__A::Error as _serde::de::Error>::duplicate_field(
252                                            "horizontalCatchUpGain",
253                                        ),
254                                    );
255                                }
256                                m_horizontalCatchUpGain = _serde::__private::Some(
257                                    match __A::next_value::<f32>(&mut __map) {
258                                        _serde::__private::Ok(__val) => __val,
259                                        _serde::__private::Err(__err) => {
260                                            return _serde::__private::Err(__err);
261                                        }
262                                    },
263                                );
264                            }
265                            3usize => {
266                                if _serde::__private::Option::is_some(
267                                    &m_maxVerticalSeparation,
268                                ) {
269                                    return _serde::__private::Err(
270                                        <__A::Error as _serde::de::Error>::duplicate_field(
271                                            "maxVerticalSeparation",
272                                        ),
273                                    );
274                                }
275                                m_maxVerticalSeparation = _serde::__private::Some(
276                                    match __A::next_value::<f32>(&mut __map) {
277                                        _serde::__private::Ok(__val) => __val,
278                                        _serde::__private::Err(__err) => {
279                                            return _serde::__private::Err(__err);
280                                        }
281                                    },
282                                );
283                            }
284                            4usize => {
285                                if _serde::__private::Option::is_some(
286                                    &m_maxHorizontalSeparation,
287                                ) {
288                                    return _serde::__private::Err(
289                                        <__A::Error as _serde::de::Error>::duplicate_field(
290                                            "maxHorizontalSeparation",
291                                        ),
292                                    );
293                                }
294                                m_maxHorizontalSeparation = _serde::__private::Some(
295                                    match __A::next_value::<f32>(&mut __map) {
296                                        _serde::__private::Ok(__val) => __val,
297                                        _serde::__private::Err(__err) => {
298                                            return _serde::__private::Err(__err);
299                                        }
300                                    },
301                                );
302                            }
303                            _ => {}
304                        }
305                    }
306                    let m_desiredVelocity = match m_desiredVelocity {
307                        _serde::__private::Some(__field) => __field,
308                        _serde::__private::None => {
309                            return _serde::__private::Err(
310                                <__A::Error as _serde::de::Error>::missing_field(
311                                    "desiredVelocity",
312                                ),
313                            );
314                        }
315                    };
316                    let m_verticalGain = match m_verticalGain {
317                        _serde::__private::Some(__field) => __field,
318                        _serde::__private::None => {
319                            return _serde::__private::Err(
320                                <__A::Error as _serde::de::Error>::missing_field(
321                                    "verticalGain",
322                                ),
323                            );
324                        }
325                    };
326                    let m_horizontalCatchUpGain = match m_horizontalCatchUpGain {
327                        _serde::__private::Some(__field) => __field,
328                        _serde::__private::None => {
329                            return _serde::__private::Err(
330                                <__A::Error as _serde::de::Error>::missing_field(
331                                    "horizontalCatchUpGain",
332                                ),
333                            );
334                        }
335                    };
336                    let m_maxVerticalSeparation = match m_maxVerticalSeparation {
337                        _serde::__private::Some(__field) => __field,
338                        _serde::__private::None => {
339                            return _serde::__private::Err(
340                                <__A::Error as _serde::de::Error>::missing_field(
341                                    "maxVerticalSeparation",
342                                ),
343                            );
344                        }
345                    };
346                    let m_maxHorizontalSeparation = match m_maxHorizontalSeparation {
347                        _serde::__private::Some(__field) => __field,
348                        _serde::__private::None => {
349                            return _serde::__private::Err(
350                                <__A::Error as _serde::de::Error>::missing_field(
351                                    "maxHorizontalSeparation",
352                                ),
353                            );
354                        }
355                    };
356                    _serde::__private::Ok(hkbCharacterControllerControlData {
357                        __ptr,
358                        m_desiredVelocity,
359                        m_verticalGain,
360                        m_horizontalCatchUpGain,
361                        m_maxVerticalSeparation,
362                        m_maxHorizontalSeparation,
363                    })
364                }
365                #[allow(clippy::manual_unwrap_or_default)]
366                fn visit_struct<__A>(
367                    self,
368                    mut __map: __A,
369                ) -> _serde::__private::Result<Self::Value, __A::Error>
370                where
371                    __A: _serde::de::MapAccess<'de>,
372                {
373                    let mut m_desiredVelocity: _serde::__private::Option<Vector4> = _serde::__private::None;
374                    let mut m_verticalGain: _serde::__private::Option<f32> = _serde::__private::None;
375                    let mut m_horizontalCatchUpGain: _serde::__private::Option<f32> = _serde::__private::None;
376                    let mut m_maxVerticalSeparation: _serde::__private::Option<f32> = _serde::__private::None;
377                    let mut m_maxHorizontalSeparation: _serde::__private::Option<f32> = _serde::__private::None;
378                    while let _serde::__private::Some(__key) = {
379                        __A::next_key::<__Field>(&mut __map)?
380                    } {
381                        match __key {
382                            __Field::m_desiredVelocity => {
383                                #[cfg(
384                                    any(feature = "strict", feature = "ignore_duplicates")
385                                )]
386                                if _serde::__private::Option::is_some(&m_desiredVelocity) {
387                                    #[cfg(feature = "ignore_duplicates")]
388                                    {
389                                        __A::skip_value(&mut __map)?;
390                                        continue;
391                                    }
392                                    #[cfg(feature = "strict")]
393                                    return _serde::__private::Err(
394                                        <__A::Error as _serde::de::Error>::duplicate_field(
395                                            "desiredVelocity",
396                                        ),
397                                    );
398                                }
399                                m_desiredVelocity = _serde::__private::Some(
400                                    match __A::next_value::<Vector4>(&mut __map) {
401                                        _serde::__private::Ok(__val) => __val,
402                                        _serde::__private::Err(__err) => {
403                                            return _serde::__private::Err(__err);
404                                        }
405                                    },
406                                );
407                            }
408                            __Field::m_verticalGain => {
409                                #[cfg(
410                                    any(feature = "strict", feature = "ignore_duplicates")
411                                )]
412                                if _serde::__private::Option::is_some(&m_verticalGain) {
413                                    #[cfg(feature = "ignore_duplicates")]
414                                    {
415                                        __A::skip_value(&mut __map)?;
416                                        continue;
417                                    }
418                                    #[cfg(feature = "strict")]
419                                    return _serde::__private::Err(
420                                        <__A::Error as _serde::de::Error>::duplicate_field(
421                                            "verticalGain",
422                                        ),
423                                    );
424                                }
425                                m_verticalGain = _serde::__private::Some(
426                                    match __A::next_value::<f32>(&mut __map) {
427                                        _serde::__private::Ok(__val) => __val,
428                                        _serde::__private::Err(__err) => {
429                                            return _serde::__private::Err(__err);
430                                        }
431                                    },
432                                );
433                            }
434                            __Field::m_horizontalCatchUpGain => {
435                                #[cfg(
436                                    any(feature = "strict", feature = "ignore_duplicates")
437                                )]
438                                if _serde::__private::Option::is_some(
439                                    &m_horizontalCatchUpGain,
440                                ) {
441                                    #[cfg(feature = "ignore_duplicates")]
442                                    {
443                                        __A::skip_value(&mut __map)?;
444                                        continue;
445                                    }
446                                    #[cfg(feature = "strict")]
447                                    return _serde::__private::Err(
448                                        <__A::Error as _serde::de::Error>::duplicate_field(
449                                            "horizontalCatchUpGain",
450                                        ),
451                                    );
452                                }
453                                m_horizontalCatchUpGain = _serde::__private::Some(
454                                    match __A::next_value::<f32>(&mut __map) {
455                                        _serde::__private::Ok(__val) => __val,
456                                        _serde::__private::Err(__err) => {
457                                            return _serde::__private::Err(__err);
458                                        }
459                                    },
460                                );
461                            }
462                            __Field::m_maxVerticalSeparation => {
463                                #[cfg(
464                                    any(feature = "strict", feature = "ignore_duplicates")
465                                )]
466                                if _serde::__private::Option::is_some(
467                                    &m_maxVerticalSeparation,
468                                ) {
469                                    #[cfg(feature = "ignore_duplicates")]
470                                    {
471                                        __A::skip_value(&mut __map)?;
472                                        continue;
473                                    }
474                                    #[cfg(feature = "strict")]
475                                    return _serde::__private::Err(
476                                        <__A::Error as _serde::de::Error>::duplicate_field(
477                                            "maxVerticalSeparation",
478                                        ),
479                                    );
480                                }
481                                m_maxVerticalSeparation = _serde::__private::Some(
482                                    match __A::next_value::<f32>(&mut __map) {
483                                        _serde::__private::Ok(__val) => __val,
484                                        _serde::__private::Err(__err) => {
485                                            return _serde::__private::Err(__err);
486                                        }
487                                    },
488                                );
489                            }
490                            __Field::m_maxHorizontalSeparation => {
491                                #[cfg(
492                                    any(feature = "strict", feature = "ignore_duplicates")
493                                )]
494                                if _serde::__private::Option::is_some(
495                                    &m_maxHorizontalSeparation,
496                                ) {
497                                    #[cfg(feature = "ignore_duplicates")]
498                                    {
499                                        __A::skip_value(&mut __map)?;
500                                        continue;
501                                    }
502                                    #[cfg(feature = "strict")]
503                                    return _serde::__private::Err(
504                                        <__A::Error as _serde::de::Error>::duplicate_field(
505                                            "maxHorizontalSeparation",
506                                        ),
507                                    );
508                                }
509                                m_maxHorizontalSeparation = _serde::__private::Some(
510                                    match __A::next_value::<f32>(&mut __map) {
511                                        _serde::__private::Ok(__val) => __val,
512                                        _serde::__private::Err(__err) => {
513                                            return _serde::__private::Err(__err);
514                                        }
515                                    },
516                                );
517                            }
518                            _ => __A::skip_value(&mut __map)?,
519                        }
520                    }
521                    let m_desiredVelocity = match m_desiredVelocity {
522                        _serde::__private::Some(__field) => __field,
523                        _serde::__private::None => {
524                            #[cfg(feature = "strict")]
525                            return _serde::__private::Err(
526                                <__A::Error as _serde::de::Error>::missing_field(
527                                    "desiredVelocity",
528                                ),
529                            );
530                            #[cfg(not(feature = "strict"))] Default::default()
531                        }
532                    };
533                    let m_verticalGain = match m_verticalGain {
534                        _serde::__private::Some(__field) => __field,
535                        _serde::__private::None => {
536                            #[cfg(feature = "strict")]
537                            return _serde::__private::Err(
538                                <__A::Error as _serde::de::Error>::missing_field(
539                                    "verticalGain",
540                                ),
541                            );
542                            #[cfg(not(feature = "strict"))] Default::default()
543                        }
544                    };
545                    let m_horizontalCatchUpGain = match m_horizontalCatchUpGain {
546                        _serde::__private::Some(__field) => __field,
547                        _serde::__private::None => {
548                            #[cfg(feature = "strict")]
549                            return _serde::__private::Err(
550                                <__A::Error as _serde::de::Error>::missing_field(
551                                    "horizontalCatchUpGain",
552                                ),
553                            );
554                            #[cfg(not(feature = "strict"))] Default::default()
555                        }
556                    };
557                    let m_maxVerticalSeparation = match m_maxVerticalSeparation {
558                        _serde::__private::Some(__field) => __field,
559                        _serde::__private::None => {
560                            #[cfg(feature = "strict")]
561                            return _serde::__private::Err(
562                                <__A::Error as _serde::de::Error>::missing_field(
563                                    "maxVerticalSeparation",
564                                ),
565                            );
566                            #[cfg(not(feature = "strict"))] Default::default()
567                        }
568                    };
569                    let m_maxHorizontalSeparation = match m_maxHorizontalSeparation {
570                        _serde::__private::Some(__field) => __field,
571                        _serde::__private::None => {
572                            #[cfg(feature = "strict")]
573                            return _serde::__private::Err(
574                                <__A::Error as _serde::de::Error>::missing_field(
575                                    "maxHorizontalSeparation",
576                                ),
577                            );
578                            #[cfg(not(feature = "strict"))] Default::default()
579                        }
580                    };
581                    let __ptr = __A::class_ptr(&mut __map);
582                    _serde::__private::Ok(hkbCharacterControllerControlData {
583                        __ptr,
584                        m_desiredVelocity,
585                        m_verticalGain,
586                        m_horizontalCatchUpGain,
587                        m_maxVerticalSeparation,
588                        m_maxHorizontalSeparation,
589                    })
590                }
591            }
592            const FIELDS: &[&str] = &[
593                "desiredVelocity",
594                "verticalGain",
595                "horizontalCatchUpGain",
596                "maxVerticalSeparation",
597                "maxHorizontalSeparation",
598            ];
599            _serde::Deserializer::deserialize_struct(
600                deserializer,
601                "hkbCharacterControllerControlData",
602                FIELDS,
603                __hkbCharacterControllerControlDataVisitor {
604                    marker: _serde::__private::PhantomData::<
605                        hkbCharacterControllerControlData,
606                    >,
607                    lifetime: _serde::__private::PhantomData,
608                },
609            )
610        }
611    }
612};