summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKai Stevenson <kai@kaistevenson.com>2026-08-23 23:12:30 -0700
committerKai Stevenson <kai@kaistevenson.com>2026-08-23 23:12:30 -0700
commit245d8eb77d7b92a50a48d4b953e5a8e0d789307c (patch)
tree79712ed26db2c79e1abf053eda7823abe75da59d /src
parent820e4d00837376bc63b614a382809469a719ed0b (diff)
fix shimmering
Diffstat (limited to 'src')
-rw-r--r--src/renderer/mod.rs2
-rw-r--r--src/sim/sim_manager/utils.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs
index b37dc09..f21c794 100644
--- a/src/renderer/mod.rs
+++ b/src/renderer/mod.rs
@@ -752,7 +752,7 @@ impl RendererState {
instances.push(RendererInstance {
centre: pos.to_array(),
cos_sin: [cos, sin],
- half_size: (cells.size.as_vec2() / 2.0).to_array(),
+ half_size: (cells.size / 2).as_vec2().to_array(),
dims: cells.size.as_uvec2().to_array(),
cell_offset: (slot * CHUNK_SIZE as usize * CHUNK_SIZE as usize) as u32,
_padding: 0,
diff --git a/src/sim/sim_manager/utils.rs b/src/sim/sim_manager/utils.rs
index 264597d..c8c28d6 100644
--- a/src/sim/sim_manager/utils.rs
+++ b/src/sim/sim_manager/utils.rs
@@ -18,7 +18,7 @@ fn write_entity_to_world(sim: &mut SimManager, entity_id: EntityId) -> Vec<(u8,
&& let Some(cells) = &entity.data.cells
&& let Some((pos, (cos, sin))) = entity.data._transform(&sim.rb_manager)
{
- let (half_size_x, half_size_y) = (cells.size.x as f32 / 2.0, cells.size.y as f32 / 2.0);
+ let (half_size_x, half_size_y) = ((cells.size.x / 2) as f32, (cells.size.y / 2) as f32);
// half-extent of the rotated grid's axis-aligned bounding box, plus a cell of margin
let (radius_x, radius_y) = (
half_size_x * (cos.abs() + sin.abs()) + 1.0,