Skip to content

Commit abcc555

Browse files
committed
General cleanup
1 parent 656651a commit abcc555

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

examples/revolute_position.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ fn setup(
5959

6060
commands.spawn(directional_light);
6161

62-
let camera = (Camera3dBundle {
62+
let camera = Camera3dBundle {
6363
transform: Transform::from_xyz(0.0, 0.2, 0.3).looking_at(Vec3::ZERO, Vec3::Y),
6464
..Default::default()
65-
},);
65+
};
6666

6767
commands.spawn(camera);
6868

@@ -77,7 +77,7 @@ fn setup(
7777
let entity1 = {
7878
commands
7979
.spawn((
80-
RigidBody::Kinematic,
80+
RigidBody::Dynamic,
8181
PbrBundle {
8282
mesh: meshes.add(Mesh::from(Cuboid::new(0.1, 0.05, 0.1))),
8383
material: materials.add(Color::srgb(0.6, 0.5, 0.5)),

examples/revolute_velocity.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ fn setup(
5959

6060
commands.spawn(directional_light);
6161

62-
let camera = (Camera3dBundle {
62+
let camera = Camera3dBundle {
6363
transform: Transform::from_xyz(0.0, 0.2, 0.3).looking_at(Vec3::ZERO, Vec3::Y),
6464
..Default::default()
65-
},);
65+
};
6666

6767
commands.spawn(camera);
6868

@@ -77,7 +77,7 @@ fn setup(
7777
let entity1 = {
7878
commands
7979
.spawn((
80-
RigidBody::Kinematic,
80+
RigidBody::Dynamic,
8181
PbrBundle {
8282
mesh: meshes.add(Mesh::from(Cuboid::new(0.1, 0.05, 0.1))),
8383
material: materials.add(Color::srgb(0.6, 0.5, 0.5)),

src/motor.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl Default for RevoluteMotorBundle {
6363
fn default() -> Self {
6464
Self {
6565
motor: RevoluteMotor,
66-
stiffness: MotorProportionalGain(0.0000001),
66+
stiffness: MotorProportionalGain(1e-7),
6767
damping: MotorDerivativeGain(0.0),
6868
integral_gain: MotorIntegralGain(0.0),
6969
max_torque: MotorMaxTorque(None),
@@ -75,21 +75,21 @@ impl Default for RevoluteMotorBundle {
7575
}
7676

7777
pub struct MotorPlugin {
78-
pub remove_dampening: bool,
78+
pub remove_dampning: bool,
7979
pub substep_count: Option<u32>,
8080
}
8181

8282
impl Plugin for MotorPlugin {
8383
fn build(&self, app: &mut App) {
8484
app.add_systems(FixedUpdate, multi_target_warning)
85-
.add_systems(FixedUpdate, non_normalized_axis_warning)
85+
.add_systems(FixedUpdate, warn_if_axis_not_normalized)
8686
.add_systems(FixedUpdate, enforce_velocity_constraints)
8787
.add_systems(FixedUpdate, update_motor_rotation_state)
8888
.add_systems(FixedUpdate, update_motor_angular_velocity_state)
8989
.add_systems(FixedUpdate, apply_velocity_based_torque)
9090
.add_systems(FixedUpdate, apply_rotation_based_torque);
9191

92-
if self.remove_dampening {
92+
if self.remove_dampning {
9393
app.add_systems(FixedUpdate, disable_damping);
9494
}
9595

@@ -102,13 +102,13 @@ impl Plugin for MotorPlugin {
102102
impl Default for MotorPlugin {
103103
fn default() -> Self {
104104
Self {
105-
remove_dampening: true,
105+
remove_dampning: true,
106106
substep_count: Some(1000),
107107
}
108108
}
109109
}
110110

111-
fn non_normalized_axis_warning(query: Query<&RevoluteJoint, Added<RevoluteMotor>>) {
111+
fn warn_if_axis_not_normalized(query: Query<&RevoluteJoint, Added<RevoluteMotor>>) {
112112
for joint in query.iter() {
113113
if joint.aligned_axis.length() != 1.0 {
114114
error!("Aligned axis must be normalized for motor to work")

0 commit comments

Comments
 (0)