rename stages to modes

This commit is contained in:
Quaternions 2023-10-03 19:42:07 -07:00
parent 696f383aee
commit 7a8de938af
4 changed files with 6 additions and 8 deletions

View File

@ -328,7 +328,7 @@ pub struct PhysicsState{
//all models //all models
pub models:Vec<ModelPhysics>, pub models:Vec<ModelPhysics>,
pub stages:Vec<crate::model::StageDescription>, pub modes:Vec<crate::model::ModeDescription>,
//the spawn point is where you spawn when you load into the map. //the spawn point is where you spawn when you load into the map.
//This is not the same as Reset which teleports you to Spawn0 //This is not the same as Reset which teleports you to Spawn0
pub spawn_point:glam::Vec3, pub spawn_point:glam::Vec3,

View File

@ -171,8 +171,6 @@ pub fn generate_indexed_models(dom:rbx_dom_weak::WeakDom) -> crate::model::Index
//IndexedModelInstances includes textures //IndexedModelInstances includes textures
let mut spawn_point=glam::Vec3::ZERO; let mut spawn_point=glam::Vec3::ZERO;
let mut stages=Vec::new();
let mut indexed_models=Vec::new(); let mut indexed_models=Vec::new();
let mut model_id_from_description=std::collections::HashMap::<RobloxBasePartDescription,usize>::new(); let mut model_id_from_description=std::collections::HashMap::<RobloxBasePartDescription,usize>::new();
@ -424,6 +422,6 @@ pub fn generate_indexed_models(dom:rbx_dom_weak::WeakDom) -> crate::model::Index
textures:asset_id_from_texture_id.iter().map(|t|t.to_string()).collect(), textures:asset_id_from_texture_id.iter().map(|t|t.to_string()).collect(),
models:indexed_models, models:indexed_models,
spawn_point, spawn_point,
stages, modes:Vec::new(),
} }
} }

View File

@ -528,7 +528,7 @@ impl framework::Example for GraphicsData {
controls: 0, controls: 0,
world:body::WorldState{}, world:body::WorldState{},
game:body::GameMechanicsState::default(), game:body::GameMechanicsState::default(),
stages:Vec::new(), modes:Vec::new(),
}; };
//load textures //load textures
@ -784,7 +784,7 @@ impl framework::Example for GraphicsData {
textures:Vec::new(), textures:Vec::new(),
models:indexed_models, models:indexed_models,
spawn_point:glam::Vec3::Y*50.0, spawn_point:glam::Vec3::Y*50.0,
stages:Vec::new(), modes:Vec::new(),
}; };
graphics.generate_model_physics(&indexed_model_instances); graphics.generate_model_physics(&indexed_model_instances);
graphics.generate_model_graphics(&device,&queue,indexed_model_instances); graphics.generate_model_graphics(&device,&queue,indexed_model_instances);

View File

@ -65,11 +65,11 @@ pub struct IndexedModelInstances{
pub textures:Vec<String>,//RenderPattern pub textures:Vec<String>,//RenderPattern
pub models:Vec<IndexedModel>, pub models:Vec<IndexedModel>,
//may make this into an object later. //may make this into an object later.
pub stages:Vec<StageDescription>, pub modes:Vec<ModeDescription>,
pub spawn_point:glam::Vec3, pub spawn_point:glam::Vec3,
} }
//stage description referencing flattened ids is spooky, but the map loading is meant to be deterministic. //stage description referencing flattened ids is spooky, but the map loading is meant to be deterministic.
pub struct StageDescription{ pub struct ModeDescription{
pub start:u32,//start=model_id pub start:u32,//start=model_id
pub spawns:Vec<u32>,//spawns[spawn_id]=model_id pub spawns:Vec<u32>,//spawns[spawn_id]=model_id
pub ordered_checkpoints:Vec<u32>,//ordered_checkpoints[checkpoint_id]=model_id pub ordered_checkpoints:Vec<u32>,//ordered_checkpoints[checkpoint_id]=model_id