pub struct JointId {
pub index1: i32,
pub world0: u16,
pub generation: u16,
}Expand description
Joint id references a joint instance. Treat as an opaque handle.
Fields§
§index1: i32§world0: u16§generation: u16Implementations§
Source§impl JointId
impl JointId
Sourcepub fn is_null(self) -> bool
pub fn is_null(self) -> bool
True if this id is null (index1 == 0). (B2_IS_NULL)
Examples found in repository?
examples/benchmark/human/mod.rs (line 124)
120pub fn destroy_human(world: &mut World, human: &mut Human) {
121 debug_assert!(human.is_spawned);
122
123 for i in 0..BONE_COUNT {
124 if human.bones[i].joint_id.is_null() {
125 continue;
126 }
127
128 destroy_joint(world, human.bones[i].joint_id, false);
129 human.bones[i].joint_id = JointId::default();
130 }
131
132 for i in 0..BONE_COUNT {
133 if human.bones[i].body_id.is_null() {
134 continue;
135 }
136
137 destroy_body(world, human.bones[i].body_id);
138 human.bones[i].body_id = BodyId::default();
139 }
140
141 human.is_spawned = false;
142}Sourcepub fn is_non_null(self) -> bool
pub fn is_non_null(self) -> bool
True if this id is non-null. (B2_IS_NON_NULL)
Trait Implementations§
impl Copy for JointId
impl Eq for JointId
impl StructuralPartialEq for JointId
Auto Trait Implementations§
impl Freeze for JointId
impl RefUnwindSafe for JointId
impl Send for JointId
impl Sync for JointId
impl Unpin for JointId
impl UnsafeUnpin for JointId
impl UnwindSafe for JointId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more