Fix compilation in 2D.
This commit is contained in:
@@ -251,7 +251,7 @@ impl ParallelIslandSolver {
|
|||||||
let dvel = mj_lambdas[rb.active_set_offset];
|
let dvel = mj_lambdas[rb.active_set_offset];
|
||||||
rb.linvel += dvel.linear;
|
rb.linvel += dvel.linear;
|
||||||
rb.angvel += rb.effective_world_inv_inertia_sqrt.transform_vector(dvel.angular);
|
rb.angvel += rb.effective_world_inv_inertia_sqrt.transform_vector(dvel.angular);
|
||||||
rb.integrate(params.dt));
|
rb.integrate(params.dt);
|
||||||
positions[rb.active_set_offset] = rb.position;
|
positions[rb.active_set_offset] = rb.position;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ use crate::geometry::{ColliderShape, InteractionGroups};
|
|||||||
use crate::math::{AngVector, Isometry, Point, Real, Rotation, Vector, DIM};
|
use crate::math::{AngVector, Isometry, Point, Real, Rotation, Vector, DIM};
|
||||||
use cdl::bounding_volume::AABB;
|
use cdl::bounding_volume::AABB;
|
||||||
use cdl::shape::Shape;
|
use cdl::shape::Shape;
|
||||||
#[cfg(feature = "dim2")]
|
|
||||||
use cdl::shape::{ConvexPolygon, RoundConvexPolygon};
|
|
||||||
|
|
||||||
bitflags::bitflags! {
|
bitflags::bitflags! {
|
||||||
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
||||||
|
|||||||
@@ -154,6 +154,14 @@ impl ColliderShape {
|
|||||||
let mut parts = vec![];
|
let mut parts = vec![];
|
||||||
let decomp = VHACD::decompose(params, &vertices, &indices, true);
|
let decomp = VHACD::decompose(params, &vertices, &indices, true);
|
||||||
|
|
||||||
|
#[cfg(feature = "dim2")]
|
||||||
|
for vertices in decomp.compute_exact_convex_hulls(&vertices, &indices) {
|
||||||
|
if let Some(convex) = Self::convex_polyline(vertices) {
|
||||||
|
parts.push((Isometry::identity(), convex));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "dim3")]
|
||||||
for (vertices, indices) in decomp.compute_exact_convex_hulls(&vertices, &indices) {
|
for (vertices, indices) in decomp.compute_exact_convex_hulls(&vertices, &indices) {
|
||||||
if let Some(convex) = Self::convex_mesh(vertices, &indices) {
|
if let Some(convex) = Self::convex_mesh(vertices, &indices) {
|
||||||
parts.push((Isometry::identity(), convex));
|
parts.push((Isometry::identity(), convex));
|
||||||
@@ -174,6 +182,14 @@ impl ColliderShape {
|
|||||||
let mut parts = vec![];
|
let mut parts = vec![];
|
||||||
let decomp = VHACD::decompose(params, &vertices, &indices, true);
|
let decomp = VHACD::decompose(params, &vertices, &indices, true);
|
||||||
|
|
||||||
|
#[cfg(feature = "dim2")]
|
||||||
|
for vertices in decomp.compute_exact_convex_hulls(&vertices, &indices) {
|
||||||
|
if let Some(convex) = Self::round_convex_polyline(vertices, border_radius) {
|
||||||
|
parts.push((Isometry::identity(), convex));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "dim3")]
|
||||||
for (vertices, indices) in decomp.compute_exact_convex_hulls(&vertices, &indices) {
|
for (vertices, indices) in decomp.compute_exact_convex_hulls(&vertices, &indices) {
|
||||||
if let Some(convex) = Self::round_convex_mesh(vertices, &indices, border_radius) {
|
if let Some(convex) = Self::round_convex_mesh(vertices, &indices, border_radius) {
|
||||||
parts.push((Isometry::identity(), convex));
|
parts.push((Isometry::identity(), convex));
|
||||||
|
|||||||
@@ -70,12 +70,6 @@ impl Harness {
|
|||||||
#[cfg(feature = "parallel")]
|
#[cfg(feature = "parallel")]
|
||||||
let num_threads = num_cpus::get_physical();
|
let num_threads = num_cpus::get_physical();
|
||||||
|
|
||||||
#[cfg(feature = "parallel")]
|
|
||||||
let thread_pool = rapier::rayon::ThreadPoolBuilder::new()
|
|
||||||
.num_threads(num_threads)
|
|
||||||
.build()
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let contact_channel = crossbeam::channel::unbounded();
|
let contact_channel = crossbeam::channel::unbounded();
|
||||||
let proximity_channel = crossbeam::channel::unbounded();
|
let proximity_channel = crossbeam::channel::unbounded();
|
||||||
let event_handler = ChannelEventCollector::new(proximity_channel.0, contact_channel.0);
|
let event_handler = ChannelEventCollector::new(proximity_channel.0, contact_channel.0);
|
||||||
|
|||||||
@@ -269,10 +269,10 @@ impl Testbed {
|
|||||||
{
|
{
|
||||||
if self.state.selected_backend == BOX2D_BACKEND {
|
if self.state.selected_backend == BOX2D_BACKEND {
|
||||||
self.box2d = Some(Box2dWorld::from_rapier(
|
self.box2d = Some(Box2dWorld::from_rapier(
|
||||||
physics.gravity,
|
self.harness.physics.gravity,
|
||||||
&physics.bodies,
|
&self.harness.physics.bodies,
|
||||||
&physics.colliders,
|
&self.harness.physics.colliders,
|
||||||
&physics.joints,
|
&self.harness.physics.joints,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -483,7 +483,7 @@ impl Testbed {
|
|||||||
if self.state.selected_backend == BOX2D_BACKEND {
|
if self.state.selected_backend == BOX2D_BACKEND {
|
||||||
self.box2d.as_mut().unwrap().step(
|
self.box2d.as_mut().unwrap().step(
|
||||||
&mut self.harness.physics.pipeline.counters,
|
&mut self.harness.physics.pipeline.counters,
|
||||||
&physics.integration_parameters,
|
&self.harness.physics.integration_parameters,
|
||||||
);
|
);
|
||||||
self.box2d.as_mut().unwrap().sync(
|
self.box2d.as_mut().unwrap().sync(
|
||||||
&mut self.harness.physics.bodies,
|
&mut self.harness.physics.bodies,
|
||||||
@@ -1270,13 +1270,13 @@ impl State for Testbed {
|
|||||||
{
|
{
|
||||||
if self.state.selected_backend == BOX2D_BACKEND {
|
if self.state.selected_backend == BOX2D_BACKEND {
|
||||||
self.box2d.as_mut().unwrap().step(
|
self.box2d.as_mut().unwrap().step(
|
||||||
&mut physics.pipeline.counters,
|
&mut self.harness.physics.pipeline.counters,
|
||||||
&physics.integration_parameters,
|
&self.harness.physics.integration_parameters,
|
||||||
|
);
|
||||||
|
self.box2d.as_mut().unwrap().sync(
|
||||||
|
&mut self.harness.physics.bodies,
|
||||||
|
&mut self.harness.physics.colliders,
|
||||||
);
|
);
|
||||||
self.box2d
|
|
||||||
.as_mut()
|
|
||||||
.unwrap()
|
|
||||||
.sync(&mut physics.bodies, &mut physics.colliders);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ impl TestbedUi {
|
|||||||
let curr_vel_iters = integration_parameters.max_velocity_iterations;
|
let curr_vel_iters = integration_parameters.max_velocity_iterations;
|
||||||
let curr_pos_iters = integration_parameters.max_position_iterations;
|
let curr_pos_iters = integration_parameters.max_position_iterations;
|
||||||
#[cfg(feature = "parallel")]
|
#[cfg(feature = "parallel")]
|
||||||
let curr_num_threads = run_state.num_threads;
|
let curr_num_threads = _run_state.num_threads;
|
||||||
let curr_max_ccd_substeps = integration_parameters.max_ccd_substeps;
|
let curr_max_ccd_substeps = integration_parameters.max_ccd_substeps;
|
||||||
let curr_min_island_size = integration_parameters.min_island_size;
|
let curr_min_island_size = integration_parameters.min_island_size;
|
||||||
let curr_warmstart_coeff = integration_parameters.warmstart_coeff;
|
let curr_warmstart_coeff = integration_parameters.warmstart_coeff;
|
||||||
@@ -307,10 +307,10 @@ impl TestbedUi {
|
|||||||
.w_h(ELEMENT_W, ELEMENT_H)
|
.w_h(ELEMENT_W, ELEMENT_H)
|
||||||
.set(self.ids.slider_num_threads, &mut ui)
|
.set(self.ids.slider_num_threads, &mut ui)
|
||||||
{
|
{
|
||||||
if run_state.num_threads != val as usize {
|
if _run_state.num_threads != val as usize {
|
||||||
run_state.num_threads = val as usize;
|
_run_state.num_threads = val as usize;
|
||||||
run_state.thread_pool = rapier::rayon::ThreadPoolBuilder::new()
|
_run_state.thread_pool = rapier::rayon::ThreadPoolBuilder::new()
|
||||||
.num_threads(run_state.num_threads)
|
.num_threads(_run_state.num_threads)
|
||||||
.build()
|
.build()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user