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