Small coding style fix

This commit is contained in:
Sébastien Crozet
2023-01-01 16:51:40 +01:00
parent 95cd7d5c9c
commit c77ed7c9bf

View File

@@ -940,19 +940,25 @@ impl RigidBody {
} }
/// Retrieves the constant force(s) that the user has added to the body. /// Retrieves the constant force(s) that the user has added to the body.
///
/// Returns zero if the rigid-body isnt dynamic.
pub fn user_force(&self) -> Vector<Real> { pub fn user_force(&self) -> Vector<Real> {
if self.body_type == RigidBodyType::Dynamic { if self.body_type == RigidBodyType::Dynamic {
return self.forces.user_force; self.forces.user_force
} else {
Vector::zeros()
} }
Vector::zeros()
} }
/// Retrieves the constant torque(s) that the user has added to the body. /// Retrieves the constant torque(s) that the user has added to the body.
///
/// Returns zero if the rigid-body isnt dynamic.
pub fn user_torque(&self) -> AngVector<Real> { pub fn user_torque(&self) -> AngVector<Real> {
if self.body_type == RigidBodyType::Dynamic { if self.body_type == RigidBodyType::Dynamic {
return self.forces.user_torque; self.forces.user_torque
} else {
AngVector::zero()
} }
AngVector::zero()
} }
} }