pub struct BodyId {
pub index1: i32,
pub world0: u16,
pub generation: u16,
}Expand description
Body id references a body instance. Treat as an opaque handle.
Fields§
§index1: i32§world0: u16§generation: u16Implementations§
Source§impl BodyId
impl BodyId
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 133)
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 BodyId
impl Eq for BodyId
impl StructuralPartialEq for BodyId
Auto Trait Implementations§
impl Freeze for BodyId
impl RefUnwindSafe for BodyId
impl Send for BodyId
impl Sync for BodyId
impl Unpin for BodyId
impl UnsafeUnpin for BodyId
impl UnwindSafe for BodyId
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