dialog WIP paths consolidation and rendering

This commit is contained in:
Jonas H
2026-03-28 10:34:19 +01:00
parent 4c3ebca96e
commit 11b31169b1
70 changed files with 2658 additions and 485 deletions

View File

@@ -13,6 +13,7 @@ pub struct Space
pub mesh_data: Vec<(Mesh, Vec<InstanceData>)>,
pub spotlights: Vec<LightData>,
pub player_spawn: Vec3,
pub test_char_spawn: Vec3,
}
impl Space
@@ -27,18 +28,20 @@ impl Space
let spotlights = lights.into_spotlights();
let player_spawn = Self::get_player_spawn(gltf_path)?;
let player_spawn = Self::get_spawn(gltf_path, "PlayerSpawn")?;
let test_char_spawn = Self::get_spawn(gltf_path, "TestCharSpawn")?;
Ok(Space {
mesh_data,
spotlights,
player_spawn,
test_char_spawn,
})
}
fn get_player_spawn(gltf_path: &str) -> Result<Vec3>
fn get_spawn(gltf_path: &str, name: &str) -> Result<Vec3>
{
let empty = Empties::get_empty_by_name(gltf_path, "PlayerSpawn")?;
let empty = Empties::get_empty_by_name(gltf_path, name)?;
if let Some(empty_node) = empty
{
@@ -48,7 +51,7 @@ impl Space
}
else
{
println!("Warning: PlayerSpawn empty not found, using default position");
println!("Warning: {} empty not found, using default position", name);
Ok(Vec3::new(0.0, 5.0, 0.0))
}
}