summaryrefslogtreecommitdiff
path: root/src/sim/rb_manager/debug_ops.rs
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2026-08-22 16:49:56 -0700
committerKai Stevenson <kai@kaistevenson.com>2026-08-22 16:49:56 -0700
commitbdad89910dcf3a56790dba60ed1f0db679432323 (patch)
tree19e65e2d0e9fa4a6227abc71ef28a6dd622161f0 /src/sim/rb_manager/debug_ops.rs
parent1a515237afb7ad09353a65f5fbc6e98a7c29ce8e (diff)
refactor entities
Diffstat (limited to 'src/sim/rb_manager/debug_ops.rs')
-rw-r--r--src/sim/rb_manager/debug_ops.rs48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/sim/rb_manager/debug_ops.rs b/src/sim/rb_manager/debug_ops.rs
deleted file mode 100644
index cb56256..0000000
--- a/src/sim/rb_manager/debug_ops.rs
+++ /dev/null
@@ -1,48 +0,0 @@
-use glam::{ivec2, vec2};
-
-use crate::sim::{
- cell::{cell::Cell, materials::MaterialId},
- rb_manager::RbManager,
-};
-
-pub trait DebugOperator {
- fn test_spawn_box(&mut self, x: f32, y: f32, material: MaterialId) -> ();
- fn test_spawn_ball(&mut self, x: f32, y: f32, material: MaterialId) -> ();
-}
-
-impl DebugOperator for RbManager {
- fn test_spawn_box(&mut self, x: f32, y: f32, material: MaterialId) {
- let w = 10;
- let h = 10;
- let mut test_cells = vec![Cell::void(); (w * h) as usize];
-
- for x in 0..w {
- for y in 0..h {
- let cell_idx = x + y * w;
- test_cells[cell_idx as usize] = Cell::from_material(material);
- test_cells[cell_idx as usize].set_rb(true);
- }
- }
-
- self.create_rb_entity(vec2(x, y), test_cells, w, h);
- }
-
- fn test_spawn_ball(&mut self, x: f32, y: f32, material: MaterialId) {
- let r = 5;
- let w = r * 2;
- let h = r * 2;
- let mut test_cells = vec![Cell::void(); (w * h) as usize];
-
- for x in 0..w {
- for y in 0..h {
- let cell_idx = x + y * w;
- if ivec2(x, y).distance_squared(ivec2(w / 2, h / 2)) < r.pow(2) {
- test_cells[cell_idx as usize] = Cell::from_material(material);
- test_cells[cell_idx as usize].set_rb(true);
- }
- }
- }
-
- self.create_rb_entity(vec2(x, y), test_cells, w, h);
- }
-}