diff options
| author | Robert Hrusecky <robert.hrusecky@utexas.edu> | 2020-11-02 15:00:12 -0600 |
|---|---|---|
| committer | Robert Hrusecky <robert.hrusecky@utexas.edu> | 2020-11-02 15:00:12 -0600 |
| commit | 8b81a3fd2727dcb911f19c3d7a98c4ec94c6f2fa (patch) | |
| tree | b59ce89ff5d1e0505cdf2b7b91740a48763efa76 /src/geometry/contact.rs | |
| parent | bcec54ef31d987cf20b493628a20777183a95f65 (diff) | |
| parent | a38fdc101dc74473c45a8b4f5d770f2bc43f30c2 (diff) | |
| download | rapier-8b81a3fd2727dcb911f19c3d7a98c4ec94c6f2fa.tar.gz rapier-8b81a3fd2727dcb911f19c3d7a98c4ec94c6f2fa.tar.bz2 rapier-8b81a3fd2727dcb911f19c3d7a98c4ec94c6f2fa.zip | |
Merge branch 'master' into infinite_fall_memory
Diffstat (limited to 'src/geometry/contact.rs')
| -rw-r--r-- | src/geometry/contact.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/geometry/contact.rs b/src/geometry/contact.rs index d8f3632..53e9064 100644 --- a/src/geometry/contact.rs +++ b/src/geometry/contact.rs @@ -1,8 +1,8 @@ +use crate::data::MaybeSerializableData; use crate::dynamics::BodyPair; -use crate::geometry::contact_generator::ContactPhase; +use crate::geometry::contact_generator::{ContactGeneratorWorkspace, ContactPhase}; use crate::geometry::{Collider, ColliderPair, ColliderSet}; use crate::math::{Isometry, Point, Vector}; -use std::any::Any; #[cfg(feature = "simd-is-enabled")] use { crate::math::{SimdFloat, SIMD_WIDTH}, @@ -182,15 +182,14 @@ pub struct ContactPair { pub manifolds: Vec<ContactManifold>, #[cfg_attr(feature = "serde-serialize", serde(skip))] pub(crate) generator: Option<ContactPhase>, - #[cfg_attr(feature = "serde-serialize", serde(skip))] - pub(crate) generator_workspace: Option<Box<dyn Any + Send + Sync>>, + pub(crate) generator_workspace: Option<ContactGeneratorWorkspace>, } impl ContactPair { pub(crate) fn new( pair: ColliderPair, generator: ContactPhase, - generator_workspace: Option<Box<dyn Any + Send + Sync>>, + generator_workspace: Option<ContactGeneratorWorkspace>, ) -> Self { Self { pair, @@ -221,7 +220,7 @@ impl ContactPair { &'b Collider, &'b Collider, &'a mut ContactManifold, - Option<&'a mut (dyn Any + Send + Sync)>, + Option<&'a mut (dyn MaybeSerializableData)>, ) { let coll1 = &colliders[self.pair.collider1]; let coll2 = &colliders[self.pair.collider2]; @@ -240,14 +239,14 @@ impl ContactPair { coll1, coll2, manifold, - self.generator_workspace.as_mut().map(|w| &mut **w), + self.generator_workspace.as_mut().map(|w| &mut *w.0), ) } else { ( coll2, coll1, manifold, - self.generator_workspace.as_mut().map(|w| &mut **w), + self.generator_workspace.as_mut().map(|w| &mut *w.0), ) } } |
