feat: improve get_args functions

This commit is contained in:
2024-04-23 03:41:28 +02:00
parent c87d4b8dda
commit 98cf2e8369
20 changed files with 270 additions and 147 deletions

View File

@@ -1,5 +1,3 @@
use crate::log;
use super::{create_geometry_data, wrap_geometry_data};
use glam::{Mat4, Quat, Vec3};

View File

@@ -15,6 +15,12 @@ pub fn create_geometry_data(vertex_amount: usize, face_amount: usize) -> Vec<i32
let mut geo = vec![0; amount];
log!(
"create_geometry_data: vertices: {} faces: {}",
vertex_amount,
face_amount
);
geo[0] = 0; // opening bracket
geo[1] = amount as i32 - 2; // opening bracket
geo[2] = 1; // type: geometry
@@ -44,13 +50,6 @@ pub fn wrap_geometry_data(geometry: &mut [i32]) -> GeometryData {
let (positions_slice, rest) = rest.split_at_mut(vertices_amount * 3);
let (normals_slice, _) = rest.split_at_mut(vertices_amount * 3);
log!(
"Vertices: {}, normals: {}, Total floats: {}",
positions_slice.len(),
normals_slice.len(),
total_floats
);
assert!(
positions_slice.len() + normals_slice.len() == total_floats,
"Slices do not match the expected sizes."