aboutsummaryrefslogtreecommitdiff
path: root/src/dynamics/solver/categorization.rs
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2021-01-29 14:42:32 +0100
committerGitHub <noreply@github.com>2021-01-29 14:42:32 +0100
commit7ca46f38cde6cf8bf8bf41ea6067ae5bc938205c (patch)
tree3781b9d7c92a6a8111573ba4cae1c5d41435950e /src/dynamics/solver/categorization.rs
parente6fc8f67faf3e37afe38d683cbd930d457f289be (diff)
parent825f33efaec4ce6a8903751e836a0ea9c466ff92 (diff)
downloadrapier-7ca46f38cde6cf8bf8bf41ea6067ae5bc938205c.tar.gz
rapier-7ca46f38cde6cf8bf8bf41ea6067ae5bc938205c.tar.bz2
rapier-7ca46f38cde6cf8bf8bf41ea6067ae5bc938205c.zip
Merge pull request #79 from dimforge/split_geom
Move most of the geometric code to another crate.
Diffstat (limited to 'src/dynamics/solver/categorization.rs')
-rw-r--r--src/dynamics/solver/categorization.rs36
1 files changed, 4 insertions, 32 deletions
diff --git a/src/dynamics/solver/categorization.rs b/src/dynamics/solver/categorization.rs
index 9ddf791..c920b69 100644
--- a/src/dynamics/solver/categorization.rs
+++ b/src/dynamics/solver/categorization.rs
@@ -1,35 +1,7 @@
use crate::dynamics::{JointGraphEdge, JointIndex, RigidBodySet};
-use crate::geometry::{ContactManifold, ContactManifoldIndex, KinematicsCategory};
+use crate::geometry::{ContactManifold, ContactManifoldIndex};
-pub(crate) fn categorize_position_contacts(
- bodies: &RigidBodySet,
- manifolds: &[&mut ContactManifold],
- manifold_indices: &[ContactManifoldIndex],
- out_point_point_ground: &mut Vec<ContactManifoldIndex>,
- out_plane_point_ground: &mut Vec<ContactManifoldIndex>,
- out_point_point: &mut Vec<ContactManifoldIndex>,
- out_plane_point: &mut Vec<ContactManifoldIndex>,
-) {
- for manifold_i in manifold_indices {
- let manifold = &manifolds[*manifold_i];
- let rb1 = &bodies[manifold.body_pair.body1];
- let rb2 = &bodies[manifold.body_pair.body2];
-
- if !rb1.is_dynamic() || !rb2.is_dynamic() {
- match manifold.kinematics.category {
- KinematicsCategory::PointPoint => out_point_point_ground.push(*manifold_i),
- KinematicsCategory::PlanePoint => out_plane_point_ground.push(*manifold_i),
- }
- } else {
- match manifold.kinematics.category {
- KinematicsCategory::PointPoint => out_point_point.push(*manifold_i),
- KinematicsCategory::PlanePoint => out_plane_point.push(*manifold_i),
- }
- }
- }
-}
-
-pub(crate) fn categorize_velocity_contacts(
+pub(crate) fn categorize_contacts(
bodies: &RigidBodySet,
manifolds: &[&mut ContactManifold],
manifold_indices: &[ContactManifoldIndex],
@@ -38,8 +10,8 @@ pub(crate) fn categorize_velocity_contacts(
) {
for manifold_i in manifold_indices {
let manifold = &manifolds[*manifold_i];
- let rb1 = &bodies[manifold.body_pair.body1];
- let rb2 = &bodies[manifold.body_pair.body2];
+ let rb1 = &bodies[manifold.data.body_pair.body1];
+ let rb2 = &bodies[manifold.data.body_pair.body2];
if !rb1.is_dynamic() || !rb2.is_dynamic() {
out_ground.push(*manifold_i)