From a4e2573a7cf623f7cc25249b728dabe6f8aa8148 Mon Sep 17 00:00:00 2001 From: numzero Date: Sat, 14 Sep 2024 19:50:49 +0300 Subject: [PATCH] Use put_object for objects as well --- src/bin/flat/main.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/bin/flat/main.rs b/src/bin/flat/main.rs index 23596a9..ceea540 100644 --- a/src/bin/flat/main.rs +++ b/src/bin/flat/main.rs @@ -49,15 +49,11 @@ pub fn main() { .enumerate() .map(|(k, &y)| Object { id: k as i32, - loc: { - let pos = vec2(0.0, y * tube.external_halflength); - let adj: Mat2 = tube.sqrt_at(pos).inverse().into(); - let rot = Mat2::from_angle(y); - Location { - pos, - rot: adj * rot, - } - }, + loc: put_object( + &tube, + vec2(0.0, y * tube.external_halflength), + Mat2::from_angle(y), + ), r: 20.0, }) .collect();