dimforge / dimforge/nphysics

Wrong inertia calculation in `<RigidBody<N> as BodyPart<N>>::add_local_inertia_and_com`

Open
#280 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.6k
Forks
120
PR merge metrics
No merged PRs in 30d

Description

As the [Parallel axis theorem](https://en.wikipedia.org/wiki/Moment_of_inertia#Inertia_tensor_of_translation) shows, one cannot just add inertia tensors of two "objects" whose CoM isn't overlapping.

The method ` as BodyPart>::add_local_inertia_and_com` just adds the given inertia to the local inertia.
```rust
// Update local inertia.
self.local_inertia += inertia;
```
found in:
https://github.com/dimforge/nphysics/blob/master/src/object/rigid_body.rs#L747-L766

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.