Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/control/pid_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use parry::math::AngVector;
/// This is a [PID controller](https://en.wikipedia.org/wiki/Proportional%E2%80%93integral%E2%80%93derivative_controller)
/// without the Integral part to keep the API immutable, while having a behaviour generally
/// sufficient for games.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct PdController {
/// The Proportional gain applied to the instantaneous linear position errors.
Expand Down Expand Up @@ -51,6 +52,7 @@ impl Default for PdController {
///
/// For video games, the Proportional-Derivative [`PdController`] is generally sufficient and
/// offers an immutable API.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct PidController {
/// The Proportional-Derivative (PD) part of this PID controller.
Expand Down
5 changes: 5 additions & 0 deletions src/control/ray_cast_vehicle_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ use crate::prelude::QueryPipelineMut;
use crate::utils::{SimdCross, SimdDot};

/// A character controller to simulate vehicles using ray-casting for the wheels.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Clone, Debug)]
pub struct DynamicRayCastVehicleController {
wheels: Vec<Wheel>,
forward_ws: Vec<Vector<Real>>,
Expand All @@ -23,6 +25,7 @@ pub struct DynamicRayCastVehicleController {
pub index_forward_axis: usize,
}

#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Copy, Clone, Debug, PartialEq)]
/// Parameters affecting the physical behavior of a wheel.
pub struct WheelTuning {
Expand Down Expand Up @@ -101,6 +104,7 @@ struct WheelDesc {
pub side_friction_stiffness: Real,
}

#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Copy, Clone, Debug, PartialEq)]
/// A wheel attached to a vehicle.
pub struct Wheel {
Expand Down Expand Up @@ -225,6 +229,7 @@ impl Wheel {

/// Information about suspension and the ground obtained from the ray-casting
/// to simulate a wheel’s suspension.
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
#[derive(Copy, Clone, Debug, PartialEq, Default)]
pub struct RayCastInfo {
/// The (world-space) contact normal between the wheel and the floor.
Expand Down