aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEmil Ernerfeldt <emil.ernerfeldt@gmail.com>2021-01-22 13:38:59 +0100
committerEmil Ernerfeldt <emil.ernerfeldt@gmail.com>2021-01-22 13:38:59 +0100
commit315493ebfb06af9924fdabb8f26da4d1a9b095bc (patch)
tree93b9e80de2f8139e813d784271bcf0b659133981 /src
parent581d13edbd5b23bdbe32c59f2bc35a164f4e86ff (diff)
downloadrapier-315493ebfb06af9924fdabb8f26da4d1a9b095bc.tar.gz
rapier-315493ebfb06af9924fdabb8f26da4d1a9b095bc.tar.bz2
rapier-315493ebfb06af9924fdabb8f26da4d1a9b095bc.zip
IntegrationParameters: deprectate dt() and inv_dt() methods
Diffstat (limited to 'src')
-rw-r--r--src/dynamics/integration_parameters.rs2
-rw-r--r--src/dynamics/solver/island_solver.rs3
-rw-r--r--src/dynamics/solver/parallel_island_solver.rs2
-rw-r--r--src/pipeline/physics_pipeline.rs4
4 files changed, 6 insertions, 5 deletions
diff --git a/src/dynamics/integration_parameters.rs b/src/dynamics/integration_parameters.rs
index eac8676..56b5801 100644
--- a/src/dynamics/integration_parameters.rs
+++ b/src/dynamics/integration_parameters.rs
@@ -139,6 +139,7 @@ impl IntegrationParameters {
/// The current time-stepping length.
#[inline(always)]
+ #[deprecated = "You can just read the `IntegrationParams::dt` value directly"]
pub fn dt(&self) -> f32 {
self.dt
}
@@ -157,6 +158,7 @@ impl IntegrationParameters {
/// Sets the time-stepping length.
#[inline]
+ #[deprecated = "You can just set the `IntegrationParams::dt` value directly"]
pub fn set_dt(&mut self, dt: f32) {
assert!(dt >= 0.0, "The time-stepping length cannot be negative.");
self.dt = dt;
diff --git a/src/dynamics/solver/island_solver.rs b/src/dynamics/solver/island_solver.rs
index 7ce142a..b548c6b 100644
--- a/src/dynamics/solver/island_solver.rs
+++ b/src/dynamics/solver/island_solver.rs
@@ -59,8 +59,7 @@ impl IslandSolver {
}
counters.solver.velocity_update_time.resume();
- bodies
- .foreach_active_island_body_mut_internal(island_id, |_, rb| rb.integrate(params.dt()));
+ bodies.foreach_active_island_body_mut_internal(island_id, |_, rb| rb.integrate(params.dt));
counters.solver.velocity_update_time.pause();
if manifold_indices.len() != 0 || joint_indices.len() != 0 {
diff --git a/src/dynamics/solver/parallel_island_solver.rs b/src/dynamics/solver/parallel_island_solver.rs
index 3b7ab9f..1393067 100644
--- a/src/dynamics/solver/parallel_island_solver.rs
+++ b/src/dynamics/solver/parallel_island_solver.rs
@@ -234,7 +234,7 @@ impl ParallelIslandSolver {
let dvel = mj_lambdas[rb.active_set_offset];
rb.linvel += dvel.linear;
rb.angvel += rb.world_inv_inertia_sqrt.transform_vector(dvel.angular);
- rb.integrate(params.dt());
+ rb.integrate(params.dt);
positions[rb.active_set_offset] = rb.position;
}
}
diff --git a/src/pipeline/physics_pipeline.rs b/src/pipeline/physics_pipeline.rs
index dc4b69f..e970125 100644
--- a/src/pipeline/physics_pipeline.rs
+++ b/src/pipeline/physics_pipeline.rs
@@ -160,7 +160,7 @@ impl PhysicsPipeline {
self.counters.stages.update_time.start();
bodies.foreach_active_dynamic_body_mut_internal(|_, b| {
b.update_world_mass_properties();
- b.integrate_accelerations(integration_parameters.dt(), *gravity)
+ b.integrate_accelerations(integration_parameters.dt, *gravity)
});
self.counters.stages.update_time.pause();
@@ -239,7 +239,7 @@ impl PhysicsPipeline {
rb.linvel = na::zero();
rb.angvel = na::zero();
} else {
- rb.update_predicted_position(integration_parameters.dt());
+ rb.update_predicted_position(integration_parameters.dt);
}
rb.update_colliders_positions(colliders);