havok_classes/generated/
hkpStiffSpringChainDataConstraintInfo_.rs

1use super::class_requires::*;
2use super::*;
3/// # C++ Info
4/// - name: `hkpStiffSpringChainDataConstraintInfo`
5/// - version: `0`
6/// - signature: `0xc624a180`
7/// - size: ` 48`(x86)/` 48`(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 hkpStiffSpringChainDataConstraintInfo {
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: `pivotInA`(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 = "pivotInA"))]
31    #[cfg_attr(feature = "serde", serde(rename = "pivotInA"))]
32    pub m_pivotInA: Vector4,
33    /// # C++ Info
34    /// - name: `pivotInB`(ctype: `hkVector4`)
35    /// - offset: ` 16`(x86)/` 16`(x86_64)
36    /// - type_size: ` 16`(x86)/` 16`(x86_64)
37    #[cfg_attr(feature = "json_schema", schemars(rename = "pivotInB"))]
38    #[cfg_attr(feature = "serde", serde(rename = "pivotInB"))]
39    pub m_pivotInB: Vector4,
40    /// # C++ Info
41    /// - name: `springLength`(ctype: `hkReal`)
42    /// - offset: ` 32`(x86)/` 32`(x86_64)
43    /// - type_size: `  4`(x86)/`  4`(x86_64)
44    #[cfg_attr(feature = "json_schema", schemars(rename = "springLength"))]
45    #[cfg_attr(feature = "serde", serde(rename = "springLength"))]
46    pub m_springLength: f32,
47}
48const _: () = {
49    use havok_serde as _serde;
50    impl _serde::HavokClass for hkpStiffSpringChainDataConstraintInfo {
51        #[inline]
52        fn name(&self) -> &'static str {
53            "hkpStiffSpringChainDataConstraintInfo"
54        }
55        #[inline]
56        fn signature(&self) -> _serde::__private::Signature {
57            _serde::__private::Signature::new(0xc624a180)
58        }
59        #[allow(clippy::let_and_return, clippy::vec_init_then_push)]
60        fn deps_indexes(&self) -> Vec<usize> {
61            let mut v = Vec::new();
62            v
63        }
64    }
65    impl _serde::Serialize for hkpStiffSpringChainDataConstraintInfo {
66        fn serialize<S>(&self, __serializer: S) -> Result<S::Ok, S::Error>
67        where
68            S: _serde::ser::Serializer,
69        {
70            let class_meta = self
71                .__ptr
72                .map(|name| (name, _serde::__private::Signature::new(0xc624a180)));
73            let mut serializer = __serializer
74                .serialize_struct(
75                    "hkpStiffSpringChainDataConstraintInfo",
76                    class_meta,
77                    (48u64, 48u64),
78                )?;
79            serializer.serialize_field("pivotInA", &self.m_pivotInA)?;
80            serializer.serialize_field("pivotInB", &self.m_pivotInB)?;
81            serializer.serialize_field("springLength", &self.m_springLength)?;
82            serializer.pad_field([0u8; 12usize].as_slice(), [0u8; 12usize].as_slice())?;
83            serializer.end()
84        }
85    }
86};
87#[doc(hidden)]
88#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
89const _: () = {
90    use havok_serde as _serde;
91    #[automatically_derived]
92    impl<'de> _serde::Deserialize<'de> for hkpStiffSpringChainDataConstraintInfo {
93        fn deserialize<__D>(deserializer: __D) -> core::result::Result<Self, __D::Error>
94        where
95            __D: _serde::Deserializer<'de>,
96        {
97            #[allow(non_camel_case_types)]
98            enum __Field {
99                m_pivotInA,
100                m_pivotInB,
101                m_springLength,
102                __ignore,
103            }
104            struct __FieldVisitor;
105            impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
106                type Value = __Field;
107                fn expecting(
108                    &self,
109                    __formatter: &mut core::fmt::Formatter,
110                ) -> core::fmt::Result {
111                    core::fmt::Formatter::write_str(__formatter, "field identifier")
112                }
113                /// Intended for use in XML.
114                #[allow(clippy::match_single_binding)]
115                #[allow(clippy::reversed_empty_ranges)]
116                #[allow(clippy::single_match)]
117                fn visit_key<__E>(
118                    self,
119                    __value: &str,
120                ) -> core::result::Result<Self::Value, __E>
121                where
122                    __E: _serde::de::Error,
123                {
124                    match __value {
125                        "pivotInA" => Ok(__Field::m_pivotInA),
126                        "pivotInB" => Ok(__Field::m_pivotInB),
127                        "springLength" => Ok(__Field::m_springLength),
128                        _ => Ok(__Field::__ignore),
129                    }
130                }
131            }
132            impl<'de> _serde::Deserialize<'de> for __Field {
133                #[inline]
134                fn deserialize<__D>(
135                    __deserializer: __D,
136                ) -> core::result::Result<Self, __D::Error>
137                where
138                    __D: _serde::Deserializer<'de>,
139                {
140                    _serde::Deserializer::deserialize_key(__deserializer, __FieldVisitor)
141                }
142            }
143            struct __hkpStiffSpringChainDataConstraintInfoVisitor<'de> {
144                marker: _serde::__private::PhantomData<
145                    hkpStiffSpringChainDataConstraintInfo,
146                >,
147                lifetime: _serde::__private::PhantomData<&'de ()>,
148            }
149            #[allow(clippy::match_single_binding)]
150            #[allow(clippy::reversed_empty_ranges)]
151            #[allow(clippy::single_match)]
152            impl<'de> _serde::de::Visitor<'de>
153            for __hkpStiffSpringChainDataConstraintInfoVisitor<'de> {
154                type Value = hkpStiffSpringChainDataConstraintInfo;
155                fn expecting(
156                    &self,
157                    __formatter: &mut core::fmt::Formatter,
158                ) -> core::fmt::Result {
159                    core::fmt::Formatter::write_str(
160                        __formatter,
161                        "struct hkpStiffSpringChainDataConstraintInfo",
162                    )
163                }
164                fn visit_struct_for_bytes<__A>(
165                    self,
166                    mut __map: __A,
167                ) -> _serde::__private::Result<Self::Value, __A::Error>
168                where
169                    __A: _serde::de::MapAccess<'de>,
170                {
171                    let __ptr = __A::class_ptr(&mut __map);
172                    let mut m_pivotInA: _serde::__private::Option<Vector4> = _serde::__private::None;
173                    let mut m_pivotInB: _serde::__private::Option<Vector4> = _serde::__private::None;
174                    let mut m_springLength: _serde::__private::Option<f32> = _serde::__private::None;
175                    for i in 0..3usize {
176                        match i {
177                            0usize => {
178                                if _serde::__private::Option::is_some(&m_pivotInA) {
179                                    return _serde::__private::Err(
180                                        <__A::Error as _serde::de::Error>::duplicate_field(
181                                            "pivotInA",
182                                        ),
183                                    );
184                                }
185                                m_pivotInA = _serde::__private::Some(
186                                    match __A::next_value::<Vector4>(&mut __map) {
187                                        _serde::__private::Ok(__val) => __val,
188                                        _serde::__private::Err(__err) => {
189                                            return _serde::__private::Err(__err);
190                                        }
191                                    },
192                                );
193                            }
194                            1usize => {
195                                if _serde::__private::Option::is_some(&m_pivotInB) {
196                                    return _serde::__private::Err(
197                                        <__A::Error as _serde::de::Error>::duplicate_field(
198                                            "pivotInB",
199                                        ),
200                                    );
201                                }
202                                m_pivotInB = _serde::__private::Some(
203                                    match __A::next_value::<Vector4>(&mut __map) {
204                                        _serde::__private::Ok(__val) => __val,
205                                        _serde::__private::Err(__err) => {
206                                            return _serde::__private::Err(__err);
207                                        }
208                                    },
209                                );
210                            }
211                            2usize => {
212                                if _serde::__private::Option::is_some(&m_springLength) {
213                                    return _serde::__private::Err(
214                                        <__A::Error as _serde::de::Error>::duplicate_field(
215                                            "springLength",
216                                        ),
217                                    );
218                                }
219                                m_springLength = _serde::__private::Some(
220                                    match __A::next_value::<f32>(&mut __map) {
221                                        _serde::__private::Ok(__val) => __val,
222                                        _serde::__private::Err(__err) => {
223                                            return _serde::__private::Err(__err);
224                                        }
225                                    },
226                                );
227                            }
228                            _ => {}
229                        }
230                    }
231                    __A::pad(&mut __map, 12usize, 12usize)?;
232                    let m_pivotInA = match m_pivotInA {
233                        _serde::__private::Some(__field) => __field,
234                        _serde::__private::None => {
235                            return _serde::__private::Err(
236                                <__A::Error as _serde::de::Error>::missing_field("pivotInA"),
237                            );
238                        }
239                    };
240                    let m_pivotInB = match m_pivotInB {
241                        _serde::__private::Some(__field) => __field,
242                        _serde::__private::None => {
243                            return _serde::__private::Err(
244                                <__A::Error as _serde::de::Error>::missing_field("pivotInB"),
245                            );
246                        }
247                    };
248                    let m_springLength = match m_springLength {
249                        _serde::__private::Some(__field) => __field,
250                        _serde::__private::None => {
251                            return _serde::__private::Err(
252                                <__A::Error as _serde::de::Error>::missing_field(
253                                    "springLength",
254                                ),
255                            );
256                        }
257                    };
258                    _serde::__private::Ok(hkpStiffSpringChainDataConstraintInfo {
259                        __ptr,
260                        m_pivotInA,
261                        m_pivotInB,
262                        m_springLength,
263                    })
264                }
265                #[allow(clippy::manual_unwrap_or_default)]
266                fn visit_struct<__A>(
267                    self,
268                    mut __map: __A,
269                ) -> _serde::__private::Result<Self::Value, __A::Error>
270                where
271                    __A: _serde::de::MapAccess<'de>,
272                {
273                    let mut m_pivotInA: _serde::__private::Option<Vector4> = _serde::__private::None;
274                    let mut m_pivotInB: _serde::__private::Option<Vector4> = _serde::__private::None;
275                    let mut m_springLength: _serde::__private::Option<f32> = _serde::__private::None;
276                    while let _serde::__private::Some(__key) = {
277                        __A::next_key::<__Field>(&mut __map)?
278                    } {
279                        match __key {
280                            __Field::m_pivotInA => {
281                                #[cfg(
282                                    any(feature = "strict", feature = "ignore_duplicates")
283                                )]
284                                if _serde::__private::Option::is_some(&m_pivotInA) {
285                                    #[cfg(feature = "ignore_duplicates")]
286                                    {
287                                        __A::skip_value(&mut __map)?;
288                                        continue;
289                                    }
290                                    #[cfg(feature = "strict")]
291                                    return _serde::__private::Err(
292                                        <__A::Error as _serde::de::Error>::duplicate_field(
293                                            "pivotInA",
294                                        ),
295                                    );
296                                }
297                                m_pivotInA = _serde::__private::Some(
298                                    match __A::next_value::<Vector4>(&mut __map) {
299                                        _serde::__private::Ok(__val) => __val,
300                                        _serde::__private::Err(__err) => {
301                                            return _serde::__private::Err(__err);
302                                        }
303                                    },
304                                );
305                            }
306                            __Field::m_pivotInB => {
307                                #[cfg(
308                                    any(feature = "strict", feature = "ignore_duplicates")
309                                )]
310                                if _serde::__private::Option::is_some(&m_pivotInB) {
311                                    #[cfg(feature = "ignore_duplicates")]
312                                    {
313                                        __A::skip_value(&mut __map)?;
314                                        continue;
315                                    }
316                                    #[cfg(feature = "strict")]
317                                    return _serde::__private::Err(
318                                        <__A::Error as _serde::de::Error>::duplicate_field(
319                                            "pivotInB",
320                                        ),
321                                    );
322                                }
323                                m_pivotInB = _serde::__private::Some(
324                                    match __A::next_value::<Vector4>(&mut __map) {
325                                        _serde::__private::Ok(__val) => __val,
326                                        _serde::__private::Err(__err) => {
327                                            return _serde::__private::Err(__err);
328                                        }
329                                    },
330                                );
331                            }
332                            __Field::m_springLength => {
333                                #[cfg(
334                                    any(feature = "strict", feature = "ignore_duplicates")
335                                )]
336                                if _serde::__private::Option::is_some(&m_springLength) {
337                                    #[cfg(feature = "ignore_duplicates")]
338                                    {
339                                        __A::skip_value(&mut __map)?;
340                                        continue;
341                                    }
342                                    #[cfg(feature = "strict")]
343                                    return _serde::__private::Err(
344                                        <__A::Error as _serde::de::Error>::duplicate_field(
345                                            "springLength",
346                                        ),
347                                    );
348                                }
349                                m_springLength = _serde::__private::Some(
350                                    match __A::next_value::<f32>(&mut __map) {
351                                        _serde::__private::Ok(__val) => __val,
352                                        _serde::__private::Err(__err) => {
353                                            return _serde::__private::Err(__err);
354                                        }
355                                    },
356                                );
357                            }
358                            _ => __A::skip_value(&mut __map)?,
359                        }
360                    }
361                    let m_pivotInA = match m_pivotInA {
362                        _serde::__private::Some(__field) => __field,
363                        _serde::__private::None => {
364                            #[cfg(feature = "strict")]
365                            return _serde::__private::Err(
366                                <__A::Error as _serde::de::Error>::missing_field("pivotInA"),
367                            );
368                            #[cfg(not(feature = "strict"))] Default::default()
369                        }
370                    };
371                    let m_pivotInB = match m_pivotInB {
372                        _serde::__private::Some(__field) => __field,
373                        _serde::__private::None => {
374                            #[cfg(feature = "strict")]
375                            return _serde::__private::Err(
376                                <__A::Error as _serde::de::Error>::missing_field("pivotInB"),
377                            );
378                            #[cfg(not(feature = "strict"))] Default::default()
379                        }
380                    };
381                    let m_springLength = match m_springLength {
382                        _serde::__private::Some(__field) => __field,
383                        _serde::__private::None => {
384                            #[cfg(feature = "strict")]
385                            return _serde::__private::Err(
386                                <__A::Error as _serde::de::Error>::missing_field(
387                                    "springLength",
388                                ),
389                            );
390                            #[cfg(not(feature = "strict"))] Default::default()
391                        }
392                    };
393                    let __ptr = __A::class_ptr(&mut __map);
394                    _serde::__private::Ok(hkpStiffSpringChainDataConstraintInfo {
395                        __ptr,
396                        m_pivotInA,
397                        m_pivotInB,
398                        m_springLength,
399                    })
400                }
401            }
402            const FIELDS: &[&str] = &["pivotInA", "pivotInB", "springLength"];
403            _serde::Deserializer::deserialize_struct(
404                deserializer,
405                "hkpStiffSpringChainDataConstraintInfo",
406                FIELDS,
407                __hkpStiffSpringChainDataConstraintInfoVisitor {
408                    marker: _serde::__private::PhantomData::<
409                        hkpStiffSpringChainDataConstraintInfo,
410                    >,
411                    lifetime: _serde::__private::PhantomData,
412                },
413            )
414        }
415    }
416};