aboutsummaryrefslogtreecommitdiff
path: root/src/dynamics/joint
diff options
context:
space:
mode:
authorCrozet Sébastien <developer@crozet.re>2021-02-03 16:33:08 +0100
committerCrozet Sébastien <developer@crozet.re>2021-02-03 18:16:50 +0100
commitcf77d17d9e6c425b1899c03db8e07f265259791b (patch)
tree691e13cae7006b769be55a83d4f53d251e24be82 /src/dynamics/joint
parent16ba01be16fbf86cf51dab4eea30ae49b7cbea0d (diff)
downloadrapier-cf77d17d9e6c425b1899c03db8e07f265259791b.tar.gz
rapier-cf77d17d9e6c425b1899c03db8e07f265259791b.tar.bz2
rapier-cf77d17d9e6c425b1899c03db8e07f265259791b.zip
Experiment with incremental island computation.
Diffstat (limited to 'src/dynamics/joint')
-rw-r--r--src/dynamics/joint/joint_set.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dynamics/joint/joint_set.rs b/src/dynamics/joint/joint_set.rs
index a87532a..cad9869 100644
--- a/src/dynamics/joint/joint_set.rs
+++ b/src/dynamics/joint/joint_set.rs
@@ -2,7 +2,7 @@ use super::Joint;
use crate::geometry::{InteractionGraph, RigidBodyGraphIndex, TemporaryInteractionIndex};
use crate::data::arena::Arena;
-use crate::dynamics::{JointParams, RigidBodyHandle, RigidBodySet};
+use crate::dynamics::{IslandSet, JointParams, RigidBodyHandle, RigidBodySet};
/// The unique identifier of a joint added to the joint set.
/// The unique identifier of a collider added to a collider set.
@@ -178,10 +178,11 @@ impl JointSet {
// NOTE: this is very similar to the code from NarrowPhase::select_active_interactions.
pub(crate) fn select_active_interactions(
&self,
+ islands: &IslandSet,
bodies: &RigidBodySet,
out: &mut Vec<Vec<JointIndex>>,
) {
- for out_island in &mut out[..bodies.num_islands()] {
+ for out_island in &mut out[..islands.num_active_islands()] {
out_island.clear();
}
@@ -196,9 +197,9 @@ impl JointSet {
&& (!rb2.is_dynamic() || !rb2.is_sleeping())
{
let island_index = if !rb1.is_dynamic() {
- rb2.active_island_id
+ islands.islands()[rb2.island_id].active_island_id()
} else {
- rb1.active_island_id
+ islands.islands()[rb1.island_id].active_island_id()
};
out[island_index].push(i);