rapier3d/dynamics/joint/impulse_joint/
impulse_joint.rs

1use crate::dynamics::{GenericJoint, ImpulseJointHandle, RigidBodyHandle};
2use crate::math::{Real, SpacialVector};
3
4#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
5#[derive(Clone, Debug, PartialEq)]
6/// An impulse-based joint attached to two bodies.
7pub struct ImpulseJoint {
8    /// Handle to the first body attached to this joint.
9    pub body1: RigidBodyHandle,
10    /// Handle to the second body attached to this joint.
11    pub body2: RigidBodyHandle,
12
13    /// The joint’s description.
14    pub data: GenericJoint,
15
16    /// The impulses applied by this joint.
17    pub impulses: SpacialVector<Real>,
18
19    // A joint needs to know its handle to simplify its removal.
20    pub(crate) handle: ImpulseJointHandle,
21}