diff options
| author | Crozet Sébastien <developer@crozet.re> | 2021-01-27 14:20:14 +0100 |
|---|---|---|
| committer | Crozet Sébastien <developer@crozet.re> | 2021-01-27 14:20:14 +0100 |
| commit | 8ff2bcc3ec666805aceedaa477bde89f2a577d1c (patch) | |
| tree | 5cb00c1003e75924b7ac9ad6dbbd509052a3def2 /src/dynamics | |
| parent | a3324f85131215613b7a8acb60d9ee9517cc803d (diff) | |
| download | rapier-8ff2bcc3ec666805aceedaa477bde89f2a577d1c.tar.gz rapier-8ff2bcc3ec666805aceedaa477bde89f2a577d1c.tar.bz2 rapier-8ff2bcc3ec666805aceedaa477bde89f2a577d1c.zip | |
Add all the missing docs.
Diffstat (limited to 'src/dynamics')
| -rw-r--r-- | src/dynamics/joint/joint_set.rs | 2 | ||||
| -rw-r--r-- | src/dynamics/rigid_body_set.rs | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/dynamics/joint/joint_set.rs b/src/dynamics/joint/joint_set.rs index 50c88a2..a87532a 100644 --- a/src/dynamics/joint/joint_set.rs +++ b/src/dynamics/joint/joint_set.rs @@ -12,10 +12,12 @@ use crate::dynamics::{JointParams, RigidBodyHandle, RigidBodySet}; pub struct JointHandle(pub(crate) crate::data::arena::Index); impl JointHandle { + /// Converts this handle into its (index, generation) components. pub fn into_raw_parts(self) -> (usize, u64) { self.0.into_raw_parts() } + /// Reconstructs an handle from its (index, generation) components. pub fn from_raw_parts(id: usize, generation: u64) -> Self { Self(crate::data::arena::Index::from_raw_parts(id, generation)) } diff --git a/src/dynamics/rigid_body_set.rs b/src/dynamics/rigid_body_set.rs index dda2f42..36cf4d3 100644 --- a/src/dynamics/rigid_body_set.rs +++ b/src/dynamics/rigid_body_set.rs @@ -14,10 +14,12 @@ use std::ops::{Index, IndexMut}; pub struct RigidBodyHandle(pub(crate) crate::data::arena::Index); impl RigidBodyHandle { + /// Converts this handle into its (index, generation) components. pub fn into_raw_parts(self) -> (usize, u64) { self.0.into_raw_parts() } + /// Reconstructs an handle from its (index, generation) components. pub fn from_raw_parts(id: usize, generation: u64) -> Self { Self(crate::data::arena::Index::from_raw_parts(id, generation)) } @@ -52,6 +54,7 @@ pub struct BodyPair { } impl BodyPair { + /// Builds a new pair of rigid-body handles. pub fn new(body1: RigidBodyHandle, body2: RigidBodyHandle) -> Self { BodyPair { body1, body2 } } |
