use crate::dynamics::{
AdditionalMassProperties, Ccd, Damping, Dominance, LockedAxes, MassProperties,
RigidBodyChanges, RigidBodyColliders, RigidBodyForces, RigidBodyIds, RigidBodyMassProps,
RigidBodyPosition, RigidBodyType, SleepState, Velocity,
};
use crate::geometry::{
ColliderHandle, ColliderMassProperties, ColliderParent, ColliderPosition, ColliderSet,
ColliderShape,
};
use crate::math::*;
use crate::utils::SimdCross;
use num::Zero;
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
/// A rigid body.
///
/// To create a new rigid-body, use the [`RigidBodyBuilder`] structure.
#[derive(Debug, Clone)]
pub struct RigidBody {
pub(crate) pos: RigidBodyPosition,
pub(crate) mprops: RigidBodyMassProps,
// NOTE: we need this so that the CCD can use the actual velocities obtained
// by the velocity solver with bias. If we switch to interpolation, we
// should remove this field.
pub(crate) integrated_vels: Velocity,
pub(crate) vels: Velocity,
pub(crate) damping: Damping,
pub(crate) forces: RigidBodyForces,
pub(crate) ccd: Ccd,
pub(crate) ids: RigidBodyIds,
pub(crate) colliders: RigidBodyColliders,
/// Whether or not this rigid-body is sleeping.
pub(crate) activation: SleepState,
pub(crate) changes: RigidBodyChanges,
/// The status of the body, governing how it is affected by external forces.
pub(crate) body_type: RigidBodyType,
/// The dominance group this rigid-body is part of.
pub(crate) dominance: Dominance,
pub(crate) enabled: bool,
pub(crate) additional_solver_iterations: usize,
/// User-defined data associated to this rigid-body.
pub user_data: u128,
}
impl Default for RigidBody {
fn default() -> Self {
<