feat: solver improvements + release v0.29.0 (#876)
* feat: solver improvements * feat: add function to get/set whether gyroscopic forces are enabled on a rigid-body * chore: switch to released versions of parry and wide instead of local patches * fix cargo doc * chore: typo fixes * chore: clippy fix * Release v0.29.0 * chore: more clippy fixes
This commit is contained in:
@@ -75,21 +75,25 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
testbed.add_callback(move |_, physics, _, run_state| {
|
||||
let velocity = vector![
|
||||
0.0,
|
||||
(run_state.time * 2.0).sin(),
|
||||
(run_state.time * 2.0).cos(),
|
||||
run_state.time.sin() * 2.0
|
||||
];
|
||||
|
||||
// Update the velocity-based kinematic body by setting its velocity.
|
||||
if let Some(platform) = physics.bodies.get_mut(velocity_based_platform_handle) {
|
||||
platform.set_linvel(velocity, true);
|
||||
platform.set_angvel(vector![0.0, 0.2, 0.0], true);
|
||||
platform.set_angvel(vector![0.0, 1.0, 0.0], true);
|
||||
}
|
||||
|
||||
// Update the position-based kinematic body by setting its next position.
|
||||
if let Some(platform) = physics.bodies.get_mut(position_based_platform_handle) {
|
||||
let mut next_tra = *platform.translation();
|
||||
next_tra += velocity * physics.integration_parameters.dt;
|
||||
let mut next_rot = *platform.rotation();
|
||||
next_tra += -velocity * physics.integration_parameters.dt;
|
||||
next_rot = Rotation::new(vector![0.0, -0.5 * physics.integration_parameters.dt, 0.0])
|
||||
* next_rot;
|
||||
platform.set_next_kinematic_translation(next_tra);
|
||||
platform.set_next_kinematic_rotation(next_rot);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user