Merge pull request #508 from PaulL48/master

Add serde derives to structures in the control module
This commit is contained in:
Sébastien Crozet
2023-09-09 12:59:16 +02:00
committed by GitHub

View File

@@ -8,6 +8,7 @@ use parry::bounding_volume::BoundingVolume;
use parry::math::Translation; use parry::math::Translation;
use parry::query::{DefaultQueryDispatcher, PersistentQueryDispatcher}; use parry::query::{DefaultQueryDispatcher, PersistentQueryDispatcher};
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Copy, Clone, Debug, PartialEq)] #[derive(Copy, Clone, Debug, PartialEq)]
/// A length measure used for various options of a character controller. /// A length measure used for various options of a character controller.
pub enum CharacterLength { pub enum CharacterLength {
@@ -55,6 +56,7 @@ impl CharacterLength {
} }
/// Configuration for the auto-stepping character controller feature. /// Configuration for the auto-stepping character controller feature.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Copy, Clone, Debug, PartialEq)] #[derive(Copy, Clone, Debug, PartialEq)]
pub struct CharacterAutostep { pub struct CharacterAutostep {
/// The maximum step height a character can automatically step over. /// The maximum step height a character can automatically step over.
@@ -91,6 +93,7 @@ pub struct CharacterCollision {
} }
/// A character controller for kinematic bodies. /// A character controller for kinematic bodies.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Copy, Clone, Debug)] #[derive(Copy, Clone, Debug)]
pub struct KinematicCharacterController { pub struct KinematicCharacterController {
/// The direction that goes "up". Used to determine where the floor is, and the floors angle. /// The direction that goes "up". Used to determine where the floor is, and the floors angle.