From 18bb4ac54caf1f99a49b0426ee48fa9f28b10b8b Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Fri, 24 Nov 2023 08:07:10 -0500 Subject: [PATCH] Add fill argument for MDL::pad_slice --- src/model.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/model.rs b/src/model.rs index 7791299..d4e5b35 100755 --- a/src/model.rs +++ b/src/model.rs @@ -719,8 +719,8 @@ impl MDL { cursor.write_le::<[f32; 4]>(vec) } - fn pad_slice(small_slice: &[f32; N]) -> [f32; 4] { - let mut bigger_slice: [f32; 4] = [0.0, 0.0, 0.0, 0.0]; + fn pad_slice(small_slice: &[f32; N], fill: f32) -> [f32; 4] { + let mut bigger_slice: [f32; 4] = [fill, fill, fill, fill]; bigger_slice[..N].copy_from_slice(&small_slice[..N]); bigger_slice }