diff options
Diffstat (limited to 'apps/fparkan-game/src/designer_model.rs')
| -rw-r--r-- | apps/fparkan-game/src/designer_model.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/fparkan-game/src/designer_model.rs b/apps/fparkan-game/src/designer_model.rs index 19f3fba2..9bf24600 100644 --- a/apps/fparkan-game/src/designer_model.rs +++ b/apps/fparkan-game/src/designer_model.rs @@ -13,7 +13,7 @@ const HALF_FOV: f32 = std::f32::consts::FRAC_PI_6; pub(super) struct DesignerModels(Vec<Option<DesignerModel>>); -struct DesignerModel { +pub(super) struct DesignerModel { draws: Range<usize>, counts: Vec<u32>, center: [f32; 3], @@ -67,6 +67,14 @@ impl DesignerModels { } impl DesignerModel { + pub(super) fn uploaded(draws: Range<usize>, center: [f32; 3], radius: f32) -> Self { + Self { + draws, + counts: Vec::new(), + center, + radius, + } + } fn prepare(root: usize, scene: &mut StaticPreviewScene) -> Result<Option<Self>, String> { let source = scene.dynamic_component_geometry[root] .iter() @@ -151,7 +159,7 @@ impl DesignerModel { })) } - fn view(&self, elapsed_ms: u32, drawable: [f32; 2]) -> VulkanModelPreview { + pub(super) fn view(&self, elapsed_ms: u32, drawable: [f32; 2]) -> VulkanModelPreview { let yaw = elapsed_ms as f64 * f64::from(SPIN_RADIANS_PER_MS); let (sin_yaw, cos_yaw) = yaw.sin_cos(); let (sin_elevation, cos_elevation) = ELEVATION.sin_cos(); @@ -190,6 +198,7 @@ impl DesignerModel { }; VulkanModelPreview { ranges: self.draws.clone(), + draw_before: None, viewport, camera, eye, |
