Remove the default-sets feature
This commit is contained in:
committed by
Sébastien Crozet
parent
f108520b5a
commit
9237bfd530
@@ -16,10 +16,9 @@ edition = "2021"
|
|||||||
maintenance = { status = "actively-developed" }
|
maintenance = { status = "actively-developed" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [ "dim2", "f64", "default-sets" ]
|
default = [ "dim2", "f64" ]
|
||||||
dim2 = [ ]
|
dim2 = [ ]
|
||||||
f64 = [ ]
|
f64 = [ ]
|
||||||
default-sets = [ ]
|
|
||||||
parallel = [ "rayon" ]
|
parallel = [ "rayon" ]
|
||||||
simd-stable = [ "simba/wide", "simd-is-enabled" ]
|
simd-stable = [ "simba/wide", "simd-is-enabled" ]
|
||||||
simd-nightly = [ "simba/packed_simd", "simd-is-enabled" ]
|
simd-nightly = [ "simba/packed_simd", "simd-is-enabled" ]
|
||||||
|
|||||||
@@ -16,10 +16,9 @@ edition = "2021"
|
|||||||
maintenance = { status = "actively-developed" }
|
maintenance = { status = "actively-developed" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [ "dim2", "f32", "default-sets" ]
|
default = [ "dim2", "f32" ]
|
||||||
dim2 = [ ]
|
dim2 = [ ]
|
||||||
f32 = [ ]
|
f32 = [ ]
|
||||||
default-sets = [ ]
|
|
||||||
parallel = [ "rayon" ]
|
parallel = [ "rayon" ]
|
||||||
simd-stable = [ "simba/wide", "simd-is-enabled" ]
|
simd-stable = [ "simba/wide", "simd-is-enabled" ]
|
||||||
simd-nightly = [ "simba/packed_simd", "simd-is-enabled" ]
|
simd-nightly = [ "simba/packed_simd", "simd-is-enabled" ]
|
||||||
|
|||||||
@@ -16,10 +16,9 @@ edition = "2021"
|
|||||||
maintenance = { status = "actively-developed" }
|
maintenance = { status = "actively-developed" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [ "dim3", "f64", "default-sets" ]
|
default = [ "dim3", "f64" ]
|
||||||
dim3 = [ ]
|
dim3 = [ ]
|
||||||
f64 = [ ]
|
f64 = [ ]
|
||||||
default-sets = [ ]
|
|
||||||
parallel = [ "rayon" ]
|
parallel = [ "rayon" ]
|
||||||
simd-stable = [ "parry3d-f64/simd-stable", "simba/wide", "simd-is-enabled" ]
|
simd-stable = [ "parry3d-f64/simd-stable", "simba/wide", "simd-is-enabled" ]
|
||||||
simd-nightly = [ "parry3d-f64/simd-nightly", "simba/packed_simd", "simd-is-enabled" ]
|
simd-nightly = [ "parry3d-f64/simd-nightly", "simba/packed_simd", "simd-is-enabled" ]
|
||||||
|
|||||||
@@ -16,10 +16,9 @@ edition = "2021"
|
|||||||
maintenance = { status = "actively-developed" }
|
maintenance = { status = "actively-developed" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = [ "dim3", "f32", "default-sets" ]
|
default = [ "dim3", "f32" ]
|
||||||
dim3 = [ ]
|
dim3 = [ ]
|
||||||
f32 = [ ]
|
f32 = [ ]
|
||||||
default-sets = [ ]
|
|
||||||
parallel = [ "rayon" ]
|
parallel = [ "rayon" ]
|
||||||
simd-stable = [ "parry3d/simd-stable", "simba/wide", "simd-is-enabled" ]
|
simd-stable = [ "parry3d/simd-stable", "simba/wide", "simd-is-enabled" ]
|
||||||
simd-nightly = [ "parry3d/simd-nightly", "simba/packed_simd", "simd-is-enabled" ]
|
simd-nightly = [ "parry3d/simd-nightly", "simba/packed_simd", "simd-is-enabled" ]
|
||||||
|
|||||||
@@ -14,9 +14,7 @@ pub(crate) use self::solver::IslandSolver;
|
|||||||
pub(crate) use self::solver::ParallelIslandSolver;
|
pub(crate) use self::solver::ParallelIslandSolver;
|
||||||
pub use parry::mass_properties::MassProperties;
|
pub use parry::mass_properties::MassProperties;
|
||||||
|
|
||||||
#[cfg(feature = "default-sets")]
|
|
||||||
pub use self::rigid_body::{RigidBody, RigidBodyBuilder};
|
pub use self::rigid_body::{RigidBody, RigidBodyBuilder};
|
||||||
#[cfg(feature = "default-sets")]
|
|
||||||
pub use self::rigid_body_set::{BodyPair, RigidBodySet};
|
pub use self::rigid_body_set::{BodyPair, RigidBodySet};
|
||||||
|
|
||||||
mod ccd;
|
mod ccd;
|
||||||
@@ -27,7 +25,5 @@ mod joint;
|
|||||||
mod rigid_body_components;
|
mod rigid_body_components;
|
||||||
mod solver;
|
mod solver;
|
||||||
|
|
||||||
#[cfg(feature = "default-sets")]
|
|
||||||
mod rigid_body;
|
mod rigid_body;
|
||||||
#[cfg(feature = "default-sets")]
|
|
||||||
mod rigid_body_set;
|
mod rigid_body_set;
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ pub use self::interaction_graph::{
|
|||||||
pub use self::interaction_groups::InteractionGroups;
|
pub use self::interaction_groups::InteractionGroups;
|
||||||
pub use self::narrow_phase::NarrowPhase;
|
pub use self::narrow_phase::NarrowPhase;
|
||||||
|
|
||||||
#[cfg(feature = "default-sets")]
|
|
||||||
pub use self::collider::{Collider, ColliderBuilder};
|
pub use self::collider::{Collider, ColliderBuilder};
|
||||||
#[cfg(feature = "default-sets")]
|
|
||||||
pub use self::collider_set::ColliderSet;
|
pub use self::collider_set::ColliderSet;
|
||||||
|
|
||||||
pub use parry::query::TrackedContact;
|
pub use parry::query::TrackedContact;
|
||||||
@@ -121,7 +119,5 @@ mod interaction_graph;
|
|||||||
mod interaction_groups;
|
mod interaction_groups;
|
||||||
mod narrow_phase;
|
mod narrow_phase;
|
||||||
|
|
||||||
#[cfg(feature = "default-sets")]
|
|
||||||
mod collider;
|
mod collider;
|
||||||
#[cfg(feature = "default-sets")]
|
|
||||||
mod collider_set;
|
mod collider_set;
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ use crate::geometry::{
|
|||||||
};
|
};
|
||||||
use crate::math::Real;
|
use crate::math::Real;
|
||||||
use crate::pipeline::{EventHandler, PhysicsHooks};
|
use crate::pipeline::{EventHandler, PhysicsHooks};
|
||||||
|
|
||||||
#[cfg(feature = "default-sets")]
|
|
||||||
use crate::{dynamics::RigidBodySet, geometry::ColliderSet};
|
use crate::{dynamics::RigidBodySet, geometry::ColliderSet};
|
||||||
|
|
||||||
/// The collision pipeline, responsible for performing collision detection between colliders.
|
/// The collision pipeline, responsible for performing collision detection between colliders.
|
||||||
@@ -102,7 +100,6 @@ impl CollisionPipeline {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Executes one step of the collision detection.
|
/// Executes one step of the collision detection.
|
||||||
#[cfg(feature = "default-sets")]
|
|
||||||
pub fn step(
|
pub fn step(
|
||||||
&mut self,
|
&mut self,
|
||||||
prediction_distance: Real,
|
prediction_distance: Real,
|
||||||
@@ -117,34 +114,6 @@ impl CollisionPipeline {
|
|||||||
let mut modified_colliders = colliders.take_modified();
|
let mut modified_colliders = colliders.take_modified();
|
||||||
let mut removed_colliders = colliders.take_removed();
|
let mut removed_colliders = colliders.take_removed();
|
||||||
|
|
||||||
self.step_generic(
|
|
||||||
prediction_distance,
|
|
||||||
broad_phase,
|
|
||||||
narrow_phase,
|
|
||||||
bodies,
|
|
||||||
colliders,
|
|
||||||
&mut modified_bodies,
|
|
||||||
&mut modified_colliders,
|
|
||||||
&mut removed_colliders,
|
|
||||||
hooks,
|
|
||||||
events,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Executes one step of the collision detection.
|
|
||||||
pub fn step_generic(
|
|
||||||
&mut self,
|
|
||||||
prediction_distance: Real,
|
|
||||||
broad_phase: &mut BroadPhase,
|
|
||||||
narrow_phase: &mut NarrowPhase,
|
|
||||||
bodies: &mut RigidBodySet,
|
|
||||||
colliders: &mut ColliderSet,
|
|
||||||
modified_bodies: &mut Vec<RigidBodyHandle>,
|
|
||||||
modified_colliders: &mut Vec<ColliderHandle>,
|
|
||||||
removed_colliders: &mut Vec<ColliderHandle>,
|
|
||||||
hooks: &dyn PhysicsHooks,
|
|
||||||
events: &dyn EventHandler,
|
|
||||||
) {
|
|
||||||
super::user_changes::handle_user_changes_to_colliders(
|
super::user_changes::handle_user_changes_to_colliders(
|
||||||
bodies,
|
bodies,
|
||||||
colliders,
|
colliders,
|
||||||
@@ -155,7 +124,7 @@ impl CollisionPipeline {
|
|||||||
bodies,
|
bodies,
|
||||||
colliders,
|
colliders,
|
||||||
&modified_bodies,
|
&modified_bodies,
|
||||||
modified_colliders,
|
&mut modified_colliders,
|
||||||
);
|
);
|
||||||
self.detect_collisions(
|
self.detect_collisions(
|
||||||
prediction_distance,
|
prediction_distance,
|
||||||
@@ -164,13 +133,13 @@ impl CollisionPipeline {
|
|||||||
bodies,
|
bodies,
|
||||||
colliders,
|
colliders,
|
||||||
&modified_colliders[..],
|
&modified_colliders[..],
|
||||||
removed_colliders,
|
&mut removed_colliders,
|
||||||
hooks,
|
hooks,
|
||||||
events,
|
events,
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
|
||||||
self.clear_modified_colliders(colliders, modified_colliders);
|
self.clear_modified_colliders(colliders, &mut modified_colliders);
|
||||||
removed_colliders.clear();
|
removed_colliders.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use crate::counters::Counters;
|
|||||||
use crate::dynamics::IslandSolver;
|
use crate::dynamics::IslandSolver;
|
||||||
use crate::dynamics::{
|
use crate::dynamics::{
|
||||||
CCDSolver, ImpulseJointSet, IntegrationParameters, IslandManager, MultibodyJointSet,
|
CCDSolver, ImpulseJointSet, IntegrationParameters, IslandManager, MultibodyJointSet,
|
||||||
RigidBodyHandle, RigidBodyPosition, RigidBodyType,
|
RigidBodyPosition, RigidBodyType,
|
||||||
};
|
};
|
||||||
#[cfg(feature = "parallel")]
|
#[cfg(feature = "parallel")]
|
||||||
use crate::dynamics::{JointGraphEdge, ParallelIslandSolver as IslandSolver};
|
use crate::dynamics::{JointGraphEdge, ParallelIslandSolver as IslandSolver};
|
||||||
@@ -15,8 +15,6 @@ use crate::geometry::{
|
|||||||
};
|
};
|
||||||
use crate::math::{Real, Vector};
|
use crate::math::{Real, Vector};
|
||||||
use crate::pipeline::{EventHandler, PhysicsHooks};
|
use crate::pipeline::{EventHandler, PhysicsHooks};
|
||||||
|
|
||||||
#[cfg(feature = "default-sets")]
|
|
||||||
use {crate::dynamics::RigidBodySet, crate::geometry::ColliderSet};
|
use {crate::dynamics::RigidBodySet, crate::geometry::ColliderSet};
|
||||||
|
|
||||||
/// The physics pipeline, responsible for stepping the whole physics simulation.
|
/// The physics pipeline, responsible for stepping the whole physics simulation.
|
||||||
@@ -358,7 +356,6 @@ impl PhysicsPipeline {
|
|||||||
///
|
///
|
||||||
/// This is the same as `self.step_generic`, except that it is specialized
|
/// This is the same as `self.step_generic`, except that it is specialized
|
||||||
/// to work with `RigidBodySet` and `ColliderSet`.
|
/// to work with `RigidBodySet` and `ColliderSet`.
|
||||||
#[cfg(feature = "default-sets")]
|
|
||||||
pub fn step(
|
pub fn step(
|
||||||
&mut self,
|
&mut self,
|
||||||
gravity: &Vector<Real>,
|
gravity: &Vector<Real>,
|
||||||
@@ -374,48 +371,10 @@ impl PhysicsPipeline {
|
|||||||
hooks: &dyn PhysicsHooks,
|
hooks: &dyn PhysicsHooks,
|
||||||
events: &dyn EventHandler,
|
events: &dyn EventHandler,
|
||||||
) {
|
) {
|
||||||
let mut modified_bodies = bodies.take_modified();
|
let modified_bodies = bodies.take_modified();
|
||||||
let mut modified_colliders = colliders.take_modified();
|
let mut modified_colliders = colliders.take_modified();
|
||||||
let mut removed_colliders = colliders.take_removed();
|
let mut removed_colliders = colliders.take_removed();
|
||||||
|
|
||||||
self.step_generic(
|
|
||||||
gravity,
|
|
||||||
integration_parameters,
|
|
||||||
islands,
|
|
||||||
broad_phase,
|
|
||||||
narrow_phase,
|
|
||||||
bodies,
|
|
||||||
colliders,
|
|
||||||
&mut modified_bodies,
|
|
||||||
&mut modified_colliders,
|
|
||||||
&mut removed_colliders,
|
|
||||||
impulse_joints,
|
|
||||||
multibody_joints,
|
|
||||||
ccd_solver,
|
|
||||||
hooks,
|
|
||||||
events,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Executes one timestep of the physics simulation.
|
|
||||||
pub fn step_generic(
|
|
||||||
&mut self,
|
|
||||||
gravity: &Vector<Real>,
|
|
||||||
integration_parameters: &IntegrationParameters,
|
|
||||||
islands: &mut IslandManager,
|
|
||||||
broad_phase: &mut BroadPhase,
|
|
||||||
narrow_phase: &mut NarrowPhase,
|
|
||||||
bodies: &mut RigidBodySet,
|
|
||||||
colliders: &mut ColliderSet,
|
|
||||||
modified_bodies: &mut Vec<RigidBodyHandle>,
|
|
||||||
modified_colliders: &mut Vec<ColliderHandle>,
|
|
||||||
removed_colliders: &mut Vec<ColliderHandle>,
|
|
||||||
impulse_joints: &mut ImpulseJointSet,
|
|
||||||
multibody_joints: &mut MultibodyJointSet,
|
|
||||||
ccd_solver: &mut CCDSolver,
|
|
||||||
hooks: &dyn PhysicsHooks,
|
|
||||||
events: &dyn EventHandler,
|
|
||||||
) {
|
|
||||||
self.counters.reset();
|
self.counters.reset();
|
||||||
self.counters.step_started();
|
self.counters.step_started();
|
||||||
|
|
||||||
@@ -429,7 +388,7 @@ impl PhysicsPipeline {
|
|||||||
bodies,
|
bodies,
|
||||||
colliders,
|
colliders,
|
||||||
&modified_bodies,
|
&modified_bodies,
|
||||||
modified_colliders,
|
&mut modified_colliders,
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: do this only on user-change.
|
// TODO: do this only on user-change.
|
||||||
@@ -449,13 +408,13 @@ impl PhysicsPipeline {
|
|||||||
bodies,
|
bodies,
|
||||||
colliders,
|
colliders,
|
||||||
&modified_colliders[..],
|
&modified_colliders[..],
|
||||||
removed_colliders,
|
&mut removed_colliders,
|
||||||
hooks,
|
hooks,
|
||||||
events,
|
events,
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
|
||||||
self.clear_modified_colliders(colliders, modified_colliders);
|
self.clear_modified_colliders(colliders, &mut modified_colliders);
|
||||||
removed_colliders.clear();
|
removed_colliders.clear();
|
||||||
|
|
||||||
let mut remaining_time = integration_parameters.dt;
|
let mut remaining_time = integration_parameters.dt;
|
||||||
@@ -563,7 +522,7 @@ impl PhysicsPipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
self.advance_to_final_positions(islands, bodies, colliders, modified_colliders);
|
self.advance_to_final_positions(islands, bodies, colliders, &mut modified_colliders);
|
||||||
|
|
||||||
self.detect_collisions(
|
self.detect_collisions(
|
||||||
&integration_parameters,
|
&integration_parameters,
|
||||||
@@ -572,14 +531,14 @@ impl PhysicsPipeline {
|
|||||||
narrow_phase,
|
narrow_phase,
|
||||||
bodies,
|
bodies,
|
||||||
colliders,
|
colliders,
|
||||||
modified_colliders,
|
&mut modified_colliders,
|
||||||
removed_colliders,
|
&mut removed_colliders,
|
||||||
hooks,
|
hooks,
|
||||||
events,
|
events,
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
|
|
||||||
self.clear_modified_colliders(colliders, modified_colliders);
|
self.clear_modified_colliders(colliders, &mut modified_colliders);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.counters.step_completed();
|
self.counters.step_completed();
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ use crate::geometry::{
|
|||||||
ColliderHandle, InteractionGroups, PointProjection, Ray, RayIntersection, AABB, QBVH,
|
ColliderHandle, InteractionGroups, PointProjection, Ray, RayIntersection, AABB, QBVH,
|
||||||
};
|
};
|
||||||
use crate::math::{Isometry, Point, Real, Vector};
|
use crate::math::{Isometry, Point, Real, Vector};
|
||||||
|
use crate::{dynamics::RigidBodySet, geometry::ColliderSet};
|
||||||
use parry::partitioning::QBVHDataGenerator;
|
use parry::partitioning::QBVHDataGenerator;
|
||||||
use parry::query::details::{
|
use parry::query::details::{
|
||||||
IntersectionCompositeShapeShapeBestFirstVisitor,
|
IntersectionCompositeShapeShapeBestFirstVisitor,
|
||||||
@@ -18,9 +19,6 @@ use parry::query::{DefaultQueryDispatcher, NonlinearRigidMotion, QueryDispatcher
|
|||||||
use parry::shape::{FeatureId, Shape, TypedSimdCompositeShape};
|
use parry::shape::{FeatureId, Shape, TypedSimdCompositeShape};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
#[cfg(feature = "default-sets")]
|
|
||||||
use crate::{dynamics::RigidBodySet, geometry::ColliderSet};
|
|
||||||
|
|
||||||
/// A pipeline for performing queries on all the colliders of a scene.
|
/// A pipeline for performing queries on all the colliders of a scene.
|
||||||
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
@@ -136,23 +134,12 @@ impl QueryPipeline {
|
|||||||
&*self.query_dispatcher
|
&*self.query_dispatcher
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "default-sets")]
|
|
||||||
/// Update the acceleration structure on the query pipeline.
|
/// Update the acceleration structure on the query pipeline.
|
||||||
pub fn update(
|
pub fn update(
|
||||||
&mut self,
|
&mut self,
|
||||||
islands: &IslandManager,
|
islands: &IslandManager,
|
||||||
bodies: &RigidBodySet,
|
bodies: &RigidBodySet,
|
||||||
colliders: &ColliderSet,
|
colliders: &ColliderSet,
|
||||||
) {
|
|
||||||
self.update_generic(islands, bodies, colliders);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Update the acceleration structure on the query pipeline.
|
|
||||||
pub fn update_generic(
|
|
||||||
&mut self,
|
|
||||||
islands: &IslandManager,
|
|
||||||
bodies: &RigidBodySet,
|
|
||||||
colliders: &ColliderSet,
|
|
||||||
) {
|
) {
|
||||||
self.update_with_mode(
|
self.update_with_mode(
|
||||||
islands,
|
islands,
|
||||||
|
|||||||
Reference in New Issue
Block a user