aboutsummaryrefslogtreecommitdiff
path: root/examples3d/keva3.rs
diff options
context:
space:
mode:
authorSébastien Crozet <sebcrozet@dimforge.com>2024-01-27 16:49:53 +0100
committerSébastien Crozet <sebastien@crozet.re>2024-01-27 17:13:08 +0100
commitda92e5c2837b27433286cf0dd9d887fd44dda254 (patch)
tree00428ce290288f5c64e53dee13d88ffdde4df0ca /examples3d/keva3.rs
parentaef873f20e7a1ee66b9d4c066884fa794048587b (diff)
downloadrapier-da92e5c2837b27433286cf0dd9d887fd44dda254.tar.gz
rapier-da92e5c2837b27433286cf0dd9d887fd44dda254.tar.bz2
rapier-da92e5c2837b27433286cf0dd9d887fd44dda254.zip
Fix clippy and enable clippy on CI
Diffstat (limited to 'examples3d/keva3.rs')
-rw-r--r--examples3d/keva3.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/examples3d/keva3.rs b/examples3d/keva3.rs
index ecd6e77..4f5cd54 100644
--- a/examples3d/keva3.rs
+++ b/examples3d/keva3.rs
@@ -7,9 +7,7 @@ pub fn build_block(
colliders: &mut ColliderSet,
half_extents: Vector<f32>,
shift: Vector<f32>,
- mut numx: usize,
- numy: usize,
- mut numz: usize,
+ (mut numx, numy, mut numz): (usize, usize, usize),
) {
let dimensions = [half_extents.xyz(), half_extents.zyx()];
let block_width = 2.0 * half_extents.z * numx as f32;
@@ -56,8 +54,8 @@ pub fn build_block(
// Close the top.
let dim = half_extents.zxy();
- for i in 0..(block_width / (dim.x as f32 * 2.0)) as usize {
- for j in 0..(block_width / (dim.z as f32 * 2.0)) as usize {
+ for i in 0..(block_width / (dim.x * 2.0)) as usize {
+ for j in 0..(block_width / (dim.z * 2.0)) as usize {
// Build the rigid body.
let rigid_body = RigidBodyBuilder::dynamic().translation(vector![
i as f32 * dim.x * 2.0 + dim.x + shift.x,
@@ -114,9 +112,7 @@ pub fn init_world(testbed: &mut Testbed) {
&mut colliders,
half_extents,
vector![-block_width / 2.0, block_height, -block_width / 2.0],
- numx,
- numy,
- numz,
+ (numx, numy, numz),
);
block_height += numy as f32 * half_extents.y * 2.0 + half_extents.x * 2.0;
num_blocks_built += numx * numy * numz;