From 3ac853862b5965c1ebfb10b12fb35cf5c671232f Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 10 Jan 2025 20:06:01 +0100 Subject: physics extension and fixes --- world/src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'world/src/main.rs') diff --git a/world/src/main.rs b/world/src/main.rs index 5dbfd06..c90ff0c 100644 --- a/world/src/main.rs +++ b/world/src/main.rs @@ -16,6 +16,7 @@ */ #![feature(iter_array_chunks)] pub mod mesh; +pub mod physics; use anyhow::{Result, bail}; use clap::Parser; @@ -23,6 +24,7 @@ use gltf::{Gltf, image::Source, import_buffers}; use image::{ImageReader, codecs::webp::WebPEncoder}; use log::info; use mesh::import_mesh; +use physics::import_physics; use rand::random; use std::{ fs::File, @@ -93,6 +95,7 @@ fn main() -> Result<()> { for node in gltf.nodes() { if let Some(mesh) = node.mesh() { + info!("--- MESH ---"); import_mesh( mesh, &buffers, @@ -105,7 +108,11 @@ fn main() -> Result<()> { } let (position, _, _) = node.transform().decomposed(); if let Some(light) = node.light() { + info!("--- LIGHT ---"); let emission = Some(Vec3A::from_array(light.color()) * light.intensity()); + if let Some(e) = emission { + info!("emission is {e}"); + } prefab.light.push(( Vec3A::from_array(position), store.set(&LightPart { @@ -114,6 +121,7 @@ fn main() -> Result<()> { })?, )); } + import_physics(&gltf, &node, &mut prefab, &store, &buffers)?; } if let Some(skybox) = args.skybox { -- cgit v1.2.3-70-g09d2