From 70fb970582df974616fca58720a3d9f21119708e Mon Sep 17 00:00:00 2001 From: Quaternions <krakow20@gmail.com> Date: Mon, 10 Mar 2025 13:44:31 -0700 Subject: [PATCH] bsp_loader: create a cube of destiny for teleport destinations --- lib/bsp_loader/src/bsp.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/bsp_loader/src/bsp.rs b/lib/bsp_loader/src/bsp.rs index 4c966e7..38fb404 100644 --- a/lib/bsp_loader/src/bsp.rs +++ b/lib/bsp_loader/src/bsp.rs @@ -209,6 +209,10 @@ pub fn convert<'a>( color:glam::Vec4::W, }); + // THE CUBE OF DESTINY + let destination_mesh_id=model::MeshId::new(world_meshes.len() as u32); + world_meshes.push(crate::brush::unit_cube()); + const WHITE:vbsp::Color=vbsp::Color{r:255,g:255,b:255}; const ENTITY_ATTRIBUTE:gameplay_attributes::CollisionAttributesId=ATTRIBUTE_DECORATION; const ENTITY_TRIGGER_ATTRIBUTE:gameplay_attributes::CollisionAttributesId=ATTRIBUTE_INTERSECT_DEFAULT; @@ -454,13 +458,10 @@ pub fn convert<'a>( let mut modes_list=Vec::new(); if let Some(spawn_point)=found_spawn{ - // create a new mesh - let mesh_id=model::MeshId::new(world_meshes.len() as u32); - world_meshes.push(crate::brush::unit_cube()); // create a new model let model_id=model::ModelId::new(world_models.len() as u32); world_models.push(model::Model{ - mesh:mesh_id, + mesh:destination_mesh_id, attributes:ATTRIBUTE_INTERSECT_DEFAULT, transform:integer::Planar64Affine3::from_translation(valve_transform(spawn_point.into())), color:glam::Vec4::W,