pub fn destroy_joint(world: &mut World, joint_id: JointId, wake_attached: bool)Expand description
(b2DestroyJoint)
Examples found in repository?
examples/benchmark/human/mod.rs (line 128)
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}