summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,