Reset the rigid-bodies internal links properly.

This commit is contained in:
Crozet Sébastien
2020-11-03 15:08:06 +01:00
parent 477411c656
commit 71611d3e30
3 changed files with 8 additions and 8 deletions

View File

@@ -84,11 +84,11 @@ impl RigidBody {
pub(crate) fn reset_internal_references(&mut self) {
self.colliders = Vec::new();
self.joint_graph_index = RigidBodyGraphIndex::new(crate::INVALID_U32);
self.active_island_id = crate::INVALID_USIZE;
self.active_set_id = crate::INVALID_USIZE;
self.active_set_offset = crate::INVALID_USIZE;
self.active_set_timestamp = crate::INVALID_U32;
self.joint_graph_index = InteractionGraph::<()>::invalid_graph_index();
self.active_island_id = 0;
self.active_set_id = 0;
self.active_set_offset = 0;
self.active_set_timestamp = 0;
}
pub(crate) fn integrate_accelerations(&mut self, dt: f32, gravity: Vector<f32>) {

View File

@@ -216,8 +216,8 @@ pub struct Collider {
impl Collider {
pub(crate) fn reset_internal_references(&mut self) {
self.parent = RigidBodySet::invalid_handle();
self.contact_graph_index = ColliderGraphIndex::new(crate::INVALID_U32);
self.proximity_graph_index = ColliderGraphIndex::new(crate::INVALID_U32);
self.contact_graph_index = InteractionGraph::<Contact>::invalid_graph_index();
self.proximity_graph_index = InteractionGraph::<Proximity>::invalid_graph_index();
self.proxy_index = crate::INVALID_USIZE;
}

View File

@@ -138,7 +138,7 @@ impl MaybeSerializableData for PfmPfmContactManifoldGeneratorWorkspace {
))
}
fn clone_dyn(&self) -> Box<MaybeSerializableData> {
fn clone_dyn(&self) -> Box<dyn MaybeSerializableData> {
Box::new(self.clone())
}
}