Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: specifiy that inv_principal_inertia_sqrt is calculated relative to the center of mass #184

Merged
merged 3 commits into from
Mar 23, 2024
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
3 changes: 2 additions & 1 deletion src/mass_properties/mass_properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pub struct MassProperties {
pub inv_mass: Real,
/// The inverse of the principal angular inertia of the rigid-body.
///
/// The angular inertia is calculated relative to [`Self::local_com`].
/// Components set to zero are assumed to be infinite along the corresponding principal axis.
pub inv_principal_inertia_sqrt: AngVector<Real>,
#[cfg(feature = "dim3")]
Expand Down Expand Up @@ -116,7 +117,7 @@ impl MassProperties {
utils::inv(self.inv_mass)
}

/// The angular inertia along the principal inertia axes of the rigid-body.
/// The angular inertia along the principal inertia axes and center of mass of the rigid-body.
pub fn principal_inertia(&self) -> AngVector<Real> {
#[cfg(feature = "dim2")]
return utils::inv(self.inv_principal_inertia_sqrt * self.inv_principal_inertia_sqrt);
Expand Down
4 changes: 1 addition & 3 deletions src/partitioning/qbvh/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#[cfg(feature = "std")]
pub use self::{
build::{
BuilderProxies, CenterDataSplitter, QbvhDataGenerator, QbvhNonOverlappingDataSplitter,
},
build::{CenterDataSplitter, QbvhDataGenerator, QbvhNonOverlappingDataSplitter},
update::QbvhUpdateWorkspace,
};

Expand Down
2 changes: 1 addition & 1 deletion src/shape/triangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ impl Triangle {

/// Reverse the orientation of this triangle by swapping b and c.
pub fn reverse(&mut self) {
std::mem::swap(&mut self.b, &mut self.c);
mem::swap(&mut self.b, &mut self.c);
}
}

Expand Down
Loading