Add all the missing docs.

This commit is contained in:
Crozet Sébastien
2021-01-27 14:20:14 +01:00
parent a3324f8513
commit 8ff2bcc3ec
8 changed files with 133 additions and 7 deletions

View File

@@ -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))
}

View File

@@ -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 }
}