1use super::class_requires::*;
2use super::*;
3#[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 hkpStiffSpringConstraintDataAtoms {
15 #[cfg_attr(
22 feature = "serde",
23 serde(skip_serializing_if = "Option::is_none", default)
24 )]
25 pub __ptr: Option<Pointer>,
26 #[cfg_attr(feature = "json_schema", schemars(rename = "pivots"))]
31 #[cfg_attr(feature = "serde", serde(rename = "pivots"))]
32 pub m_pivots: hkpSetLocalTranslationsConstraintAtom,
33 #[cfg_attr(feature = "json_schema", schemars(rename = "spring"))]
38 #[cfg_attr(feature = "serde", serde(rename = "spring"))]
39 pub m_spring: hkpStiffSpringConstraintAtom,
40}
41const _: () = {
42 use havok_serde as _serde;
43 impl _serde::HavokClass for hkpStiffSpringConstraintDataAtoms {
44 #[inline]
45 fn name(&self) -> &'static str {
46 "hkpStiffSpringConstraintDataAtoms"
47 }
48 #[inline]
49 fn signature(&self) -> _serde::__private::Signature {
50 _serde::__private::Signature::new(0x207eb376)
51 }
52 #[allow(clippy::let_and_return, clippy::vec_init_then_push)]
53 fn deps_indexes(&self) -> Vec<usize> {
54 let mut v = Vec::new();
55 v.extend(self.m_pivots.deps_indexes());
56 v.extend(self.m_spring.deps_indexes());
57 v
58 }
59 }
60 impl _serde::Serialize for hkpStiffSpringConstraintDataAtoms {
61 fn serialize<S>(&self, __serializer: S) -> Result<S::Ok, S::Error>
62 where
63 S: _serde::ser::Serializer,
64 {
65 let class_meta = self
66 .__ptr
67 .map(|name| (name, _serde::__private::Signature::new(0x207eb376)));
68 let mut serializer = __serializer
69 .serialize_struct(
70 "hkpStiffSpringConstraintDataAtoms",
71 class_meta,
72 (64u64, 64u64),
73 )?;
74 serializer.serialize_field("pivots", &self.m_pivots)?;
75 serializer.serialize_field("spring", &self.m_spring)?;
76 serializer.pad_field([0u8; 8usize].as_slice(), [0u8; 8usize].as_slice())?;
77 serializer.end()
78 }
79 }
80};
81#[doc(hidden)]
82#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
83const _: () = {
84 use havok_serde as _serde;
85 #[automatically_derived]
86 impl<'de> _serde::Deserialize<'de> for hkpStiffSpringConstraintDataAtoms {
87 fn deserialize<__D>(deserializer: __D) -> core::result::Result<Self, __D::Error>
88 where
89 __D: _serde::Deserializer<'de>,
90 {
91 #[allow(non_camel_case_types)]
92 enum __Field {
93 m_pivots,
94 m_spring,
95 __ignore,
96 }
97 struct __FieldVisitor;
98 impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
99 type Value = __Field;
100 fn expecting(
101 &self,
102 __formatter: &mut core::fmt::Formatter,
103 ) -> core::fmt::Result {
104 core::fmt::Formatter::write_str(__formatter, "field identifier")
105 }
106 #[allow(clippy::match_single_binding)]
108 #[allow(clippy::reversed_empty_ranges)]
109 #[allow(clippy::single_match)]
110 fn visit_key<__E>(
111 self,
112 __value: &str,
113 ) -> core::result::Result<Self::Value, __E>
114 where
115 __E: _serde::de::Error,
116 {
117 match __value {
118 "pivots" => Ok(__Field::m_pivots),
119 "spring" => Ok(__Field::m_spring),
120 _ => Ok(__Field::__ignore),
121 }
122 }
123 }
124 impl<'de> _serde::Deserialize<'de> for __Field {
125 #[inline]
126 fn deserialize<__D>(
127 __deserializer: __D,
128 ) -> core::result::Result<Self, __D::Error>
129 where
130 __D: _serde::Deserializer<'de>,
131 {
132 _serde::Deserializer::deserialize_key(__deserializer, __FieldVisitor)
133 }
134 }
135 struct __hkpStiffSpringConstraintDataAtomsVisitor<'de> {
136 marker: _serde::__private::PhantomData<
137 hkpStiffSpringConstraintDataAtoms,
138 >,
139 lifetime: _serde::__private::PhantomData<&'de ()>,
140 }
141 #[allow(clippy::match_single_binding)]
142 #[allow(clippy::reversed_empty_ranges)]
143 #[allow(clippy::single_match)]
144 impl<'de> _serde::de::Visitor<'de>
145 for __hkpStiffSpringConstraintDataAtomsVisitor<'de> {
146 type Value = hkpStiffSpringConstraintDataAtoms;
147 fn expecting(
148 &self,
149 __formatter: &mut core::fmt::Formatter,
150 ) -> core::fmt::Result {
151 core::fmt::Formatter::write_str(
152 __formatter,
153 "struct hkpStiffSpringConstraintDataAtoms",
154 )
155 }
156 fn visit_struct_for_bytes<__A>(
157 self,
158 mut __map: __A,
159 ) -> _serde::__private::Result<Self::Value, __A::Error>
160 where
161 __A: _serde::de::MapAccess<'de>,
162 {
163 let __ptr = __A::class_ptr(&mut __map);
164 let mut m_pivots: _serde::__private::Option<
165 hkpSetLocalTranslationsConstraintAtom,
166 > = _serde::__private::None;
167 let mut m_spring: _serde::__private::Option<
168 hkpStiffSpringConstraintAtom,
169 > = _serde::__private::None;
170 for i in 0..2usize {
171 match i {
172 0usize => {
173 if _serde::__private::Option::is_some(&m_pivots) {
174 return _serde::__private::Err(
175 <__A::Error as _serde::de::Error>::duplicate_field("pivots"),
176 );
177 }
178 m_pivots = _serde::__private::Some(
179 match __A::next_value::<
180 hkpSetLocalTranslationsConstraintAtom,
181 >(&mut __map) {
182 _serde::__private::Ok(__val) => __val,
183 _serde::__private::Err(__err) => {
184 return _serde::__private::Err(__err);
185 }
186 },
187 );
188 }
189 1usize => {
190 if _serde::__private::Option::is_some(&m_spring) {
191 return _serde::__private::Err(
192 <__A::Error as _serde::de::Error>::duplicate_field("spring"),
193 );
194 }
195 m_spring = _serde::__private::Some(
196 match __A::next_value::<
197 hkpStiffSpringConstraintAtom,
198 >(&mut __map) {
199 _serde::__private::Ok(__val) => __val,
200 _serde::__private::Err(__err) => {
201 return _serde::__private::Err(__err);
202 }
203 },
204 );
205 }
206 _ => {}
207 }
208 }
209 __A::pad(&mut __map, 8usize, 8usize)?;
210 let m_pivots = match m_pivots {
211 _serde::__private::Some(__field) => __field,
212 _serde::__private::None => {
213 return _serde::__private::Err(
214 <__A::Error as _serde::de::Error>::missing_field("pivots"),
215 );
216 }
217 };
218 let m_spring = match m_spring {
219 _serde::__private::Some(__field) => __field,
220 _serde::__private::None => {
221 return _serde::__private::Err(
222 <__A::Error as _serde::de::Error>::missing_field("spring"),
223 );
224 }
225 };
226 _serde::__private::Ok(hkpStiffSpringConstraintDataAtoms {
227 __ptr,
228 m_pivots,
229 m_spring,
230 })
231 }
232 #[allow(clippy::manual_unwrap_or_default)]
233 fn visit_struct<__A>(
234 self,
235 mut __map: __A,
236 ) -> _serde::__private::Result<Self::Value, __A::Error>
237 where
238 __A: _serde::de::MapAccess<'de>,
239 {
240 let mut m_pivots: _serde::__private::Option<
241 hkpSetLocalTranslationsConstraintAtom,
242 > = _serde::__private::None;
243 let mut m_spring: _serde::__private::Option<
244 hkpStiffSpringConstraintAtom,
245 > = _serde::__private::None;
246 while let _serde::__private::Some(__key) = {
247 __A::next_key::<__Field>(&mut __map)?
248 } {
249 match __key {
250 __Field::m_pivots => {
251 #[cfg(
252 any(feature = "strict", feature = "ignore_duplicates")
253 )]
254 if _serde::__private::Option::is_some(&m_pivots) {
255 #[cfg(feature = "ignore_duplicates")]
256 {
257 __A::skip_value(&mut __map)?;
258 continue;
259 }
260 #[cfg(feature = "strict")]
261 return _serde::__private::Err(
262 <__A::Error as _serde::de::Error>::duplicate_field("pivots"),
263 );
264 }
265 m_pivots = _serde::__private::Some(
266 match __A::next_value::<
267 hkpSetLocalTranslationsConstraintAtom,
268 >(&mut __map) {
269 _serde::__private::Ok(__val) => __val,
270 _serde::__private::Err(__err) => {
271 return _serde::__private::Err(__err);
272 }
273 },
274 );
275 }
276 __Field::m_spring => {
277 #[cfg(
278 any(feature = "strict", feature = "ignore_duplicates")
279 )]
280 if _serde::__private::Option::is_some(&m_spring) {
281 #[cfg(feature = "ignore_duplicates")]
282 {
283 __A::skip_value(&mut __map)?;
284 continue;
285 }
286 #[cfg(feature = "strict")]
287 return _serde::__private::Err(
288 <__A::Error as _serde::de::Error>::duplicate_field("spring"),
289 );
290 }
291 m_spring = _serde::__private::Some(
292 match __A::next_value::<
293 hkpStiffSpringConstraintAtom,
294 >(&mut __map) {
295 _serde::__private::Ok(__val) => __val,
296 _serde::__private::Err(__err) => {
297 return _serde::__private::Err(__err);
298 }
299 },
300 );
301 }
302 _ => __A::skip_value(&mut __map)?,
303 }
304 }
305 let m_pivots = match m_pivots {
306 _serde::__private::Some(__field) => __field,
307 _serde::__private::None => {
308 #[cfg(feature = "strict")]
309 return _serde::__private::Err(
310 <__A::Error as _serde::de::Error>::missing_field("pivots"),
311 );
312 #[cfg(not(feature = "strict"))] Default::default()
313 }
314 };
315 let m_spring = match m_spring {
316 _serde::__private::Some(__field) => __field,
317 _serde::__private::None => {
318 #[cfg(feature = "strict")]
319 return _serde::__private::Err(
320 <__A::Error as _serde::de::Error>::missing_field("spring"),
321 );
322 #[cfg(not(feature = "strict"))] Default::default()
323 }
324 };
325 let __ptr = __A::class_ptr(&mut __map);
326 _serde::__private::Ok(hkpStiffSpringConstraintDataAtoms {
327 __ptr,
328 m_pivots,
329 m_spring,
330 })
331 }
332 }
333 const FIELDS: &[&str] = &["pivots", "spring"];
334 _serde::Deserializer::deserialize_struct(
335 deserializer,
336 "hkpStiffSpringConstraintDataAtoms",
337 FIELDS,
338 __hkpStiffSpringConstraintDataAtomsVisitor {
339 marker: _serde::__private::PhantomData::<
340 hkpStiffSpringConstraintDataAtoms,
341 >,
342 lifetime: _serde::__private::PhantomData,
343 },
344 )
345 }
346 }
347};