IntegrationParameters: deprectate dt() and inv_dt() methods
This commit is contained in:
@@ -139,6 +139,7 @@ impl IntegrationParameters {
|
|||||||
|
|
||||||
/// The current time-stepping length.
|
/// The current time-stepping length.
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
|
#[deprecated = "You can just read the `IntegrationParams::dt` value directly"]
|
||||||
pub fn dt(&self) -> f32 {
|
pub fn dt(&self) -> f32 {
|
||||||
self.dt
|
self.dt
|
||||||
}
|
}
|
||||||
@@ -157,6 +158,7 @@ impl IntegrationParameters {
|
|||||||
|
|
||||||
/// Sets the time-stepping length.
|
/// Sets the time-stepping length.
|
||||||
#[inline]
|
#[inline]
|
||||||
|
#[deprecated = "You can just set the `IntegrationParams::dt` value directly"]
|
||||||
pub fn set_dt(&mut self, dt: f32) {
|
pub fn set_dt(&mut self, dt: f32) {
|
||||||
assert!(dt >= 0.0, "The time-stepping length cannot be negative.");
|
assert!(dt >= 0.0, "The time-stepping length cannot be negative.");
|
||||||
self.dt = dt;
|
self.dt = dt;
|
||||||
|
|||||||
@@ -59,8 +59,7 @@ impl IslandSolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
counters.solver.velocity_update_time.resume();
|
counters.solver.velocity_update_time.resume();
|
||||||
bodies
|
bodies.foreach_active_island_body_mut_internal(island_id, |_, rb| rb.integrate(params.dt));
|
||||||
.foreach_active_island_body_mut_internal(island_id, |_, rb| rb.integrate(params.dt()));
|
|
||||||
counters.solver.velocity_update_time.pause();
|
counters.solver.velocity_update_time.pause();
|
||||||
|
|
||||||
if manifold_indices.len() != 0 || joint_indices.len() != 0 {
|
if manifold_indices.len() != 0 || joint_indices.len() != 0 {
|
||||||
|
|||||||
@@ -234,7 +234,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.world_inv_inertia_sqrt.transform_vector(dvel.angular);
|
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;
|
positions[rb.active_set_offset] = rb.position;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ impl PhysicsPipeline {
|
|||||||
self.counters.stages.update_time.start();
|
self.counters.stages.update_time.start();
|
||||||
bodies.foreach_active_dynamic_body_mut_internal(|_, b| {
|
bodies.foreach_active_dynamic_body_mut_internal(|_, b| {
|
||||||
b.update_world_mass_properties();
|
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();
|
self.counters.stages.update_time.pause();
|
||||||
|
|
||||||
@@ -239,7 +239,7 @@ impl PhysicsPipeline {
|
|||||||
rb.linvel = na::zero();
|
rb.linvel = na::zero();
|
||||||
rb.angvel = na::zero();
|
rb.angvel = na::zero();
|
||||||
} else {
|
} else {
|
||||||
rb.update_predicted_position(integration_parameters.dt());
|
rb.update_predicted_position(integration_parameters.dt);
|
||||||
}
|
}
|
||||||
|
|
||||||
rb.update_colliders_positions(colliders);
|
rb.update_colliders_positions(colliders);
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ impl Box2dWorld {
|
|||||||
|
|
||||||
counters.step_started();
|
counters.step_started();
|
||||||
self.world.step(
|
self.world.step(
|
||||||
params.dt(),
|
params.dt,
|
||||||
params.max_velocity_iterations as i32,
|
params.max_velocity_iterations as i32,
|
||||||
params.max_position_iterations as i32,
|
params.max_position_iterations as i32,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ impl Harness {
|
|||||||
|
|
||||||
self.events.poll_all();
|
self.events.poll_all();
|
||||||
|
|
||||||
self.state.time += self.physics.integration_parameters.dt();
|
self.state.time += self.physics.integration_parameters.dt;
|
||||||
self.state.timestep_id += 1;
|
self.state.timestep_id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ impl NPhysicsWorld {
|
|||||||
.max_velocity_iterations = params.max_velocity_iterations;
|
.max_velocity_iterations = params.max_velocity_iterations;
|
||||||
self.mechanical_world
|
self.mechanical_world
|
||||||
.integration_parameters
|
.integration_parameters
|
||||||
.set_dt(params.dt());
|
.set_dt(params.dt);
|
||||||
|
|
||||||
counters.step_started();
|
counters.step_started();
|
||||||
self.mechanical_world.step(
|
self.mechanical_world.step(
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ impl PhysxWorld {
|
|||||||
|
|
||||||
pub fn step(&mut self, counters: &mut Counters, params: &IntegrationParameters) {
|
pub fn step(&mut self, counters: &mut Counters, params: &IntegrationParameters) {
|
||||||
counters.step_started();
|
counters.step_started();
|
||||||
self.scene.step(params.dt(), true);
|
self.scene.step(params.dt, true);
|
||||||
counters.step_completed();
|
counters.step_completed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user