aboutsummaryrefslogtreecommitdiff
path: root/src/dynamics/joint/impulse_joint
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2022-04-19 18:57:40 +0200
committerSébastien Crozet <sebastien@crozet.re>2022-04-20 19:02:49 +0200
commit2b1374c596957ac8cabe085859be3b823a1ba0c6 (patch)
treea7f37ec29199a5a2c6198a6b001e665524fdab96 /src/dynamics/joint/impulse_joint
parentee679427cda6363e4de94a59e293d01133a44d1f (diff)
downloadrapier-2b1374c596957ac8cabe085859be3b823a1ba0c6.tar.gz
rapier-2b1374c596957ac8cabe085859be3b823a1ba0c6.tar.bz2
rapier-2b1374c596957ac8cabe085859be3b823a1ba0c6.zip
First round deleting the component sets.
Diffstat (limited to 'src/dynamics/joint/impulse_joint')
-rw-r--r--src/dynamics/joint/impulse_joint/impulse_joint_set.rs40
1 files changed, 14 insertions, 26 deletions
diff --git a/src/dynamics/joint/impulse_joint/impulse_joint_set.rs b/src/dynamics/joint/impulse_joint/impulse_joint_set.rs
index 448b87d..6b6d980 100644
--- a/src/dynamics/joint/impulse_joint/impulse_joint_set.rs
+++ b/src/dynamics/joint/impulse_joint/impulse_joint_set.rs
@@ -2,9 +2,11 @@ use super::ImpulseJoint;
use crate::geometry::{InteractionGraph, RigidBodyGraphIndex, TemporaryInteractionIndex};
use crate::data::arena::Arena;
-use crate::data::{BundleSet, Coarena, ComponentSet, ComponentSetMut};
-use crate::dynamics::{GenericJoint, RigidBodyHandle};
-use crate::dynamics::{IslandManager, RigidBodyActivation, RigidBodyIds, RigidBodyType};
+use crate::data::Coarena;
+use crate::dynamics::{
+ GenericJoint, IslandManager, RigidBodyActivation, RigidBodyHandle, RigidBodyIds, RigidBodySet,
+ RigidBodyType,
+};
/// The unique identifier of a joint added to the joint set.
/// The unique identifier of a collider added to a collider set.
@@ -215,16 +217,12 @@ impl ImpulseJointSet {
/// Retrieve all the impulse_joints happening between two active bodies.
// NOTE: this is very similar to the code from NarrowPhase::select_active_interactions.
- pub(crate) fn select_active_interactions<Bodies>(
+ pub(crate) fn select_active_interactions(
&self,
islands: &IslandManager,
- bodies: &Bodies,
+ bodies: &RigidBodySet,
out: &mut Vec<Vec<JointIndex>>,
- ) where
- Bodies: ComponentSet<RigidBodyType>
- + ComponentSet<RigidBodyActivation>
- + ComponentSet<RigidBodyIds>,
- {
+ ) {
for out_island in &mut out[..islands.num_islands()] {
out_island.clear();
}
@@ -263,18 +261,13 @@ impl ImpulseJointSet {
///
/// If `wake_up` is set to `true`, then the bodies attached to this joint will be
/// automatically woken up.
- pub fn remove<Bodies>(
+ pub fn remove(
&mut self,
handle: ImpulseJointHandle,
islands: &mut IslandManager,
- bodies: &mut Bodies,
+ bodies: &mut RigidBodySet,
wake_up: bool,
- ) -> Option<ImpulseJoint>
- where
- Bodies: ComponentSetMut<RigidBodyActivation>
- + ComponentSet<RigidBodyType>
- + ComponentSetMut<RigidBodyIds>,
- {
+ ) -> Option<ImpulseJoint> {
let id = self.joint_ids.remove(handle.0)?;
let endpoints = self.joint_graph.graph.edge_endpoints(id)?;
@@ -302,17 +295,12 @@ impl ImpulseJointSet {
/// The provided rigid-body handle is not required to identify a rigid-body that
/// is still contained by the `bodies` component set.
/// Returns the (now invalid) handles of the removed impulse_joints.
- pub fn remove_joints_attached_to_rigid_body<Bodies>(
+ pub fn remove_joints_attached_to_rigid_body(
&mut self,
handle: RigidBodyHandle,
islands: &mut IslandManager,
- bodies: &mut Bodies,
- ) -> Vec<ImpulseJointHandle>
- where
- Bodies: ComponentSetMut<RigidBodyActivation>
- + ComponentSet<RigidBodyType>
- + ComponentSetMut<RigidBodyIds>,
- {
+ bodies: &mut RigidBodySet,
+ ) -> Vec<ImpulseJointHandle> {
let mut deleted = vec![];
if let Some(deleted_id) = self