Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c835961c4 |
@@ -1,2 +0,0 @@
|
|||||||
[registries.strafesnet]
|
|
||||||
index = "sparse+https://git.itzana.me/api/packages/strafesnet/cargo/"
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
/target
|
/target
|
||||||
|
/textures
|
||||||
1154
Cargo.lock
generated
1154
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
34
Cargo.toml
34
Cargo.toml
@@ -1,36 +1,26 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "strafe-client"
|
name = "strafe-client"
|
||||||
version = "0.10.2"
|
version = "0.9.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
repository = "https://git.itzana.me/StrafesNET/strafe-client"
|
|
||||||
license = "Custom"
|
|
||||||
description = "StrafesNET game client for bhop and surf."
|
|
||||||
authors = ["Rhys Lloyd <krakow20@gmail.com>"]
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
[features]
|
|
||||||
default = ["snf"]
|
|
||||||
snf = ["dep:strafesnet_snf"]
|
|
||||||
source = ["dep:strafesnet_deferred_loader", "dep:strafesnet_bsp_loader"]
|
|
||||||
roblox = ["dep:strafesnet_deferred_loader", "dep:strafesnet_rbx_loader"]
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bytemuck = { version = "1.13.1", features = ["derive"] }
|
bytemuck = { version = "1.13.1", features = ["derive"] }
|
||||||
configparser = "3.0.2"
|
configparser = "3.0.2"
|
||||||
ddsfile = "0.5.1"
|
ddsfile = "0.5.1"
|
||||||
glam = "0.28.0"
|
glam = "0.25.0"
|
||||||
id = { version = "0.1.0", registry = "strafesnet" }
|
id = { git = "https://git.itzana.me/Quaternions/id", rev = "1f710976cc786c8853dab73d6e1cee53158deeb0" }
|
||||||
parking_lot = "0.12.1"
|
parking_lot = "0.12.1"
|
||||||
pollster = "0.3.0"
|
pollster = "0.3.0"
|
||||||
strafesnet_bsp_loader = { version = "0.1.3", registry = "strafesnet", optional = true }
|
strafesnet_common = { git = "https://git.itzana.me/StrafesNET/common", rev = "093a54c527134ef7020a22a0f5778df8cba60228" }
|
||||||
strafesnet_common = { version = "0.2.1", registry = "strafesnet" }
|
strafesnet_bsp_loader = { git = "https://git.itzana.me/StrafesNET/bsp_loader", rev = "671b86802179572af3385bbd90cbe3bb5b6401a2" }
|
||||||
strafesnet_deferred_loader = { version = "0.3.1", features = ["legacy"], registry = "strafesnet", optional = true }
|
strafesnet_rbx_loader = { git = "https://git.itzana.me/StrafesNET/rbx_loader", rev = "e0739fa792ad506e210f076b90697194005bb7de" }
|
||||||
strafesnet_rbx_loader = { version = "0.3.2", registry = "strafesnet", optional = true }
|
strafesnet_deferred_loader = { git = "https://git.itzana.me/StrafesNET/deferred_loader", rev = "c03cd0e905daf70b03b60b3e12509f96ee94a658", features = ["legacy"] }
|
||||||
strafesnet_snf = { version = "0.1.0", registry = "strafesnet", optional = true }
|
wgpu = "0.19.0"
|
||||||
wgpu = "22.0.0"
|
winit = "0.29.2"
|
||||||
winit = "0.30.4"
|
|
||||||
|
|
||||||
[profile.release]
|
#[profile.release]
|
||||||
#lto = true
|
#lto = true
|
||||||
strip = true
|
#strip = true
|
||||||
codegen-units = 1
|
#codegen-units = 1
|
||||||
|
|||||||
15
rustfmt.toml
Normal file
15
rustfmt.toml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
hard_tabs=true
|
||||||
|
imports_layout="HorizontalVertical"
|
||||||
|
match_arm_blocks=false
|
||||||
|
match_block_trailing_comma=true
|
||||||
|
newline_style="Unix"
|
||||||
|
#overflow_delimited_expr=true
|
||||||
|
reorder_impl_items=true
|
||||||
|
reorder_imports=false
|
||||||
|
group_imports="StdExternalCrate"
|
||||||
|
reorder_modules=false
|
||||||
|
space_after_colon=false
|
||||||
|
type_punctuation_density="Compressed"
|
||||||
|
use_field_init_shorthand=true
|
||||||
|
use_try_shorthand=true
|
||||||
|
#wrap_comments=true
|
||||||
44
src/file.rs
44
src/file.rs
@@ -2,14 +2,8 @@ use std::io::Read;
|
|||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum ReadError{
|
pub enum ReadError{
|
||||||
#[cfg(feature="roblox")]
|
|
||||||
Roblox(strafesnet_rbx_loader::ReadError),
|
Roblox(strafesnet_rbx_loader::ReadError),
|
||||||
#[cfg(feature="source")]
|
|
||||||
Source(strafesnet_bsp_loader::ReadError),
|
Source(strafesnet_bsp_loader::ReadError),
|
||||||
#[cfg(feature="snf")]
|
|
||||||
StrafesNET(strafesnet_snf::Error),
|
|
||||||
#[cfg(feature="snf")]
|
|
||||||
StrafesNETMap(strafesnet_snf::map::Error),
|
|
||||||
Io(std::io::Error),
|
Io(std::io::Error),
|
||||||
UnknownFileFormat,
|
UnknownFileFormat,
|
||||||
}
|
}
|
||||||
@@ -21,27 +15,16 @@ impl std::fmt::Display for ReadError{
|
|||||||
impl std::error::Error for ReadError{}
|
impl std::error::Error for ReadError{}
|
||||||
|
|
||||||
pub enum DataStructure{
|
pub enum DataStructure{
|
||||||
#[cfg(feature="roblox")]
|
|
||||||
Roblox(strafesnet_rbx_loader::Dom),
|
Roblox(strafesnet_rbx_loader::Dom),
|
||||||
#[cfg(feature="source")]
|
Source(strafesnet_bsp_loader::Bsp)
|
||||||
Source(strafesnet_bsp_loader::Bsp),
|
|
||||||
#[cfg(feature="snf")]
|
|
||||||
StrafesNET(strafesnet_common::map::CompleteMap),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn read<R:Read+std::io::Seek>(input:R)->Result<DataStructure,ReadError>{
|
pub fn read<R:Read>(input:R)->Result<DataStructure,ReadError>{
|
||||||
let mut buf=std::io::BufReader::new(input);
|
let mut buf=std::io::BufReader::new(input);
|
||||||
let peek=std::io::BufRead::fill_buf(&mut buf).map_err(ReadError::Io)?;
|
let peek=std::io::BufRead::fill_buf(&mut buf).map_err(ReadError::Io)?;
|
||||||
match &peek[0..4]{
|
match &peek[0..4]{
|
||||||
#[cfg(feature="roblox")]
|
|
||||||
b"<rob"=>Ok(DataStructure::Roblox(strafesnet_rbx_loader::read(buf).map_err(ReadError::Roblox)?)),
|
b"<rob"=>Ok(DataStructure::Roblox(strafesnet_rbx_loader::read(buf).map_err(ReadError::Roblox)?)),
|
||||||
#[cfg(feature="source")]
|
|
||||||
b"VBSP"=>Ok(DataStructure::Source(strafesnet_bsp_loader::read(buf).map_err(ReadError::Source)?)),
|
b"VBSP"=>Ok(DataStructure::Source(strafesnet_bsp_loader::read(buf).map_err(ReadError::Source)?)),
|
||||||
#[cfg(feature="snf")]
|
|
||||||
b"SNFM"=>Ok(DataStructure::StrafesNET(
|
|
||||||
strafesnet_snf::read_map(buf).map_err(ReadError::StrafesNET)?
|
|
||||||
.into_complete_map().map_err(ReadError::StrafesNETMap)?
|
|
||||||
)),
|
|
||||||
_=>Err(ReadError::UnknownFileFormat),
|
_=>Err(ReadError::UnknownFileFormat),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,31 +46,17 @@ pub fn load<P:AsRef<std::path::Path>>(path:P)->Result<strafesnet_common::map::Co
|
|||||||
//blocking because it's simpler...
|
//blocking because it's simpler...
|
||||||
let file=std::fs::File::open(path).map_err(LoadError::File)?;
|
let file=std::fs::File::open(path).map_err(LoadError::File)?;
|
||||||
match read(file).map_err(LoadError::ReadError)?{
|
match read(file).map_err(LoadError::ReadError)?{
|
||||||
#[cfg(feature="snf")]
|
|
||||||
DataStructure::StrafesNET(map)=>Ok(map),
|
|
||||||
#[cfg(feature="roblox")]
|
|
||||||
DataStructure::Roblox(dom)=>{
|
DataStructure::Roblox(dom)=>{
|
||||||
let mut loader=strafesnet_deferred_loader::roblox_legacy();
|
let mut loader=strafesnet_deferred_loader::roblox_legacy();
|
||||||
|
|
||||||
let (texture_loader,mesh_loader)=loader.get_inner_mut();
|
|
||||||
|
|
||||||
let map_step1=strafesnet_rbx_loader::convert(
|
let map_step1=strafesnet_rbx_loader::convert(
|
||||||
&dom,
|
&dom,
|
||||||
|name|texture_loader.acquire_render_config_id(name),
|
|name|loader.acquire_render_config_id(name)
|
||||||
|name|mesh_loader.acquire_mesh_id(name),
|
|
||||||
);
|
|
||||||
|
|
||||||
let meshpart_meshes=mesh_loader.load_meshes().map_err(LoadError::Io)?;
|
|
||||||
|
|
||||||
let map_step2=map_step1.add_meshpart_meshes_and_calculate_attributes(
|
|
||||||
meshpart_meshes.into_iter().map(|(mesh_id,loader_model)|
|
|
||||||
(mesh_id,strafesnet_rbx_loader::data::RobloxMeshBytes::new(loader_model.get()))
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
let (textures,render_configs)=loader.into_render_configs().map_err(LoadError::Io)?.consume();
|
let (textures,render_configs)=loader.into_render_configs().map_err(LoadError::Io)?.consume();
|
||||||
|
|
||||||
let map=map_step2.add_render_configs_and_textures(
|
let map=map_step1.add_render_configs_and_textures(
|
||||||
render_configs.into_iter(),
|
render_configs.into_iter(),
|
||||||
textures.into_iter().map(|(texture_id,texture)|
|
textures.into_iter().map(|(texture_id,texture)|
|
||||||
(texture_id,match texture{
|
(texture_id,match texture{
|
||||||
@@ -98,7 +67,6 @@ pub fn load<P:AsRef<std::path::Path>>(path:P)->Result<strafesnet_common::map::Co
|
|||||||
|
|
||||||
Ok(map)
|
Ok(map)
|
||||||
},
|
},
|
||||||
#[cfg(feature="source")]
|
|
||||||
DataStructure::Source(bsp)=>{
|
DataStructure::Source(bsp)=>{
|
||||||
let mut loader=strafesnet_deferred_loader::source_legacy();
|
let mut loader=strafesnet_deferred_loader::source_legacy();
|
||||||
|
|
||||||
@@ -106,7 +74,9 @@ pub fn load<P:AsRef<std::path::Path>>(path:P)->Result<strafesnet_common::map::Co
|
|||||||
|
|
||||||
let map_step1=strafesnet_bsp_loader::convert(
|
let map_step1=strafesnet_bsp_loader::convert(
|
||||||
&bsp,
|
&bsp,
|
||||||
|
//acquire_render_config_id
|
||||||
|name|texture_loader.acquire_render_config_id(name),
|
|name|texture_loader.acquire_render_config_id(name),
|
||||||
|
//acquire_mesh_id
|
||||||
|name|mesh_loader.acquire_mesh_id(name),
|
|name|mesh_loader.acquire_mesh_id(name),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -138,4 +108,4 @@ pub fn load<P:AsRef<std::path::Path>>(path:P)->Result<strafesnet_common::map::Co
|
|||||||
Ok(map)
|
Ok(map)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
148
src/graphics.rs
148
src/graphics.rs
@@ -75,7 +75,7 @@ fn perspective_rh(fov_x_slope:f32,fov_y_slope:f32,z_near:f32,z_far:f32)->glam::M
|
|||||||
}
|
}
|
||||||
impl GraphicsCamera{
|
impl GraphicsCamera{
|
||||||
pub fn proj(&self)->glam::Mat4{
|
pub fn proj(&self)->glam::Mat4{
|
||||||
perspective_rh(self.fov.x,self.fov.y,0.4,4000.0)
|
perspective_rh(self.fov.x,self.fov.y,0.5,2000.0)
|
||||||
}
|
}
|
||||||
pub fn world(&self,pos:glam::Vec3,angles:glam::Vec2)->glam::Mat4{
|
pub fn world(&self,pos:glam::Vec3,angles:glam::Vec2)->glam::Mat4{
|
||||||
//f32 good enough for view matrix
|
//f32 good enough for view matrix
|
||||||
@@ -151,13 +151,7 @@ impl GraphicsState{
|
|||||||
//generate texture view per texture
|
//generate texture view per texture
|
||||||
let texture_views:HashMap<strafesnet_common::model::TextureId,wgpu::TextureView>=map.textures.iter().enumerate().filter_map(|(texture_id,texture_data)|{
|
let texture_views:HashMap<strafesnet_common::model::TextureId,wgpu::TextureView>=map.textures.iter().enumerate().filter_map(|(texture_id,texture_data)|{
|
||||||
let texture_id=model::TextureId::new(texture_id as u32);
|
let texture_id=model::TextureId::new(texture_id as u32);
|
||||||
let image=match ddsfile::Dds::read(std::io::Cursor::new(texture_data)){
|
let image=ddsfile::Dds::read(std::io::Cursor::new(texture_data)).ok()?;
|
||||||
Ok(image)=>image,
|
|
||||||
Err(e)=>{
|
|
||||||
println!("Error loading texture: {e}");
|
|
||||||
return None;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
let (mut width,mut height)=(image.get_width(),image.get_height());
|
let (mut width,mut height)=(image.get_width(),image.get_height());
|
||||||
|
|
||||||
@@ -224,8 +218,14 @@ impl GraphicsState{
|
|||||||
color:GraphicsModelColor4::new(model.color),
|
color:GraphicsModelColor4::new(model.color),
|
||||||
};
|
};
|
||||||
//get or create owned mesh map
|
//get or create owned mesh map
|
||||||
let owned_mesh_map=owned_mesh_id_from_mesh_id_render_config_id
|
if let Some(owned_mesh_map)=owned_mesh_id_from_mesh_id_render_config_id.get(&model.mesh){
|
||||||
.entry(model.mesh).or_insert_with(||{
|
//the mesh has already been split into a set of unique renderconfig meshes
|
||||||
|
//simply add one instance to each of them
|
||||||
|
for owned_mesh_id in owned_mesh_map.values(){
|
||||||
|
let owned_mesh=unique_render_config_models.get_mut(owned_mesh_id.get() as usize).unwrap();
|
||||||
|
owned_mesh.instances.push(instance.clone());
|
||||||
|
}
|
||||||
|
}else{
|
||||||
let mut owned_mesh_map=HashMap::new();
|
let mut owned_mesh_map=HashMap::new();
|
||||||
//add mesh if renderid never before seen for this model
|
//add mesh if renderid never before seen for this model
|
||||||
//add instance
|
//add instance
|
||||||
@@ -233,11 +233,17 @@ impl GraphicsState{
|
|||||||
//check each group, if it's using a new render config then make a new clone of the model
|
//check each group, if it's using a new render config then make a new clone of the model
|
||||||
if let Some(mesh)=map.meshes.get(model.mesh.get() as usize){
|
if let Some(mesh)=map.meshes.get(model.mesh.get() as usize){
|
||||||
for graphics_group in mesh.graphics_groups.iter(){
|
for graphics_group in mesh.graphics_groups.iter(){
|
||||||
|
let render_config=&map.render_configs[graphics_group.render.get() as usize];
|
||||||
|
if model.color.w==0.0&&render_config.texture.is_none(){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
//get or create owned mesh
|
//get or create owned mesh
|
||||||
let owned_mesh_id=owned_mesh_map
|
let owned_mesh_id=if let Some(&owned_mesh_id)=owned_mesh_map.get(&graphics_group.render){
|
||||||
.entry(graphics_group.render).or_insert_with(||{
|
owned_mesh_id
|
||||||
|
}else{
|
||||||
//create
|
//create
|
||||||
let owned_mesh_id=IndexedGraphicsMeshOwnedRenderConfigId::new(unique_render_config_models.len() as u32);
|
let owned_mesh_id=IndexedGraphicsMeshOwnedRenderConfigId::new(unique_render_config_models.len() as u32);
|
||||||
|
owned_mesh_map.insert(graphics_group.render,owned_mesh_id);
|
||||||
unique_render_config_models.push(IndexedGraphicsMeshOwnedRenderConfig{
|
unique_render_config_models.push(IndexedGraphicsMeshOwnedRenderConfig{
|
||||||
unique_pos:mesh.unique_pos.iter().map(|&v|*Into::<glam::Vec3>::into(v).as_ref()).collect(),
|
unique_pos:mesh.unique_pos.iter().map(|&v|*Into::<glam::Vec3>::into(v).as_ref()).collect(),
|
||||||
unique_tex:mesh.unique_tex.iter().map(|v|*v.as_ref()).collect(),
|
unique_tex:mesh.unique_tex.iter().map(|v|*v.as_ref()).collect(),
|
||||||
@@ -246,10 +252,10 @@ impl GraphicsState{
|
|||||||
unique_vertices:mesh.unique_vertices.clone(),
|
unique_vertices:mesh.unique_vertices.clone(),
|
||||||
render_config:graphics_group.render,
|
render_config:graphics_group.render,
|
||||||
polys:model::PolygonGroup::PolygonList(model::PolygonList::new(Vec::new())),
|
polys:model::PolygonGroup::PolygonList(model::PolygonList::new(Vec::new())),
|
||||||
instances:Vec::new(),
|
instances:vec![instance.clone()],
|
||||||
});
|
});
|
||||||
owned_mesh_id
|
owned_mesh_id
|
||||||
});
|
};
|
||||||
let owned_mesh=unique_render_config_models.get_mut(owned_mesh_id.get() as usize).unwrap();
|
let owned_mesh=unique_render_config_models.get_mut(owned_mesh_id.get() as usize).unwrap();
|
||||||
match &mut owned_mesh.polys{
|
match &mut owned_mesh.polys{
|
||||||
model::PolygonGroup::PolygonList(polygon_list)=>polygon_list.extend(
|
model::PolygonGroup::PolygonList(polygon_list)=>polygon_list.extend(
|
||||||
@@ -263,16 +269,8 @@ impl GraphicsState{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
owned_mesh_map
|
owned_mesh_id_from_mesh_id_render_config_id.insert(model.mesh,owned_mesh_map);
|
||||||
});
|
};
|
||||||
for owned_mesh_id in owned_mesh_map.values(){
|
|
||||||
let owned_mesh=unique_render_config_models.get_mut(owned_mesh_id.get() as usize).unwrap();
|
|
||||||
let render_config=&map.render_configs[owned_mesh.render_config.get() as usize];
|
|
||||||
if model.color.w==0.0&&render_config.texture.is_none(){
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
owned_mesh.instances.push(instance.clone());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//check every model to see if it's using the same (texture,color) but has few instances,if it is combine it into one model
|
//check every model to see if it's using the same (texture,color) but has few instances,if it is combine it into one model
|
||||||
//1. collect unique instances of texture and color,note model id
|
//1. collect unique instances of texture and color,note model id
|
||||||
@@ -291,14 +289,24 @@ impl GraphicsState{
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//populate hashmap
|
//populate hashmap
|
||||||
let unique_color=unique_texture_color
|
let unique_color=if let Some(unique_color)=unique_texture_color.get_mut(&model.render_config){
|
||||||
.entry(model.render_config)
|
unique_color
|
||||||
.or_insert_with(||HashMap::new());
|
}else{
|
||||||
|
//make new hashmap
|
||||||
|
let unique_color=HashMap::new();
|
||||||
|
unique_texture_color.insert(model.render_config,unique_color);
|
||||||
|
unique_texture_color.get_mut(&model.render_config).unwrap()
|
||||||
|
};
|
||||||
//separate instances by color
|
//separate instances by color
|
||||||
for (instance_id,instance) in model.instances.iter().enumerate(){
|
for (instance_id,instance) in model.instances.iter().enumerate(){
|
||||||
let model_instance_list=unique_color
|
let model_instance_list=if let Some(model_instance_list)=unique_color.get_mut(&instance.color){
|
||||||
.entry(instance.color)
|
model_instance_list
|
||||||
.or_insert_with(||Vec::new());
|
}else{
|
||||||
|
//make new hashmap
|
||||||
|
let model_instance_list=Vec::new();
|
||||||
|
unique_color.insert(instance.color.clone(),model_instance_list);
|
||||||
|
unique_color.get_mut(&instance.color).unwrap()
|
||||||
|
};
|
||||||
//add model instance to list
|
//add model instance to list
|
||||||
model_instance_list.push((model_id,instance_id));
|
model_instance_list.push((model_id,instance_id));
|
||||||
}
|
}
|
||||||
@@ -334,34 +342,46 @@ impl GraphicsState{
|
|||||||
let map_pos_id:Vec<PositionId>=model.unique_pos.iter().map(|untransformed_pos|{
|
let map_pos_id:Vec<PositionId>=model.unique_pos.iter().map(|untransformed_pos|{
|
||||||
let pos=instance.transform.transform_point3(glam::Vec3::from_array(untransformed_pos.clone())).to_array();
|
let pos=instance.transform.transform_point3(glam::Vec3::from_array(untransformed_pos.clone())).to_array();
|
||||||
let h=bytemuck::cast::<[f32;3],[u32;3]>(pos);
|
let h=bytemuck::cast::<[f32;3],[u32;3]>(pos);
|
||||||
PositionId::new(*pos_id_from.entry(h).or_insert_with(||{
|
PositionId::new((if let Some(&pos_id)=pos_id_from.get(&h){
|
||||||
|
pos_id
|
||||||
|
}else{
|
||||||
let pos_id=unique_pos.len();
|
let pos_id=unique_pos.len();
|
||||||
unique_pos.push(pos);
|
unique_pos.push(pos);
|
||||||
|
pos_id_from.insert(h,pos_id);
|
||||||
pos_id
|
pos_id
|
||||||
}) as u32)
|
}) as u32)
|
||||||
}).collect();
|
}).collect();
|
||||||
let map_tex_id:Vec<TextureCoordinateId>=model.unique_tex.iter().map(|&tex|{
|
let map_tex_id:Vec<TextureCoordinateId>=model.unique_tex.iter().map(|&tex|{
|
||||||
let h=bytemuck::cast::<[f32;2],[u32;2]>(tex);
|
let h=bytemuck::cast::<[f32;2],[u32;2]>(tex);
|
||||||
TextureCoordinateId::new(*tex_id_from.entry(h).or_insert_with(||{
|
TextureCoordinateId::new((if let Some(&tex_id)=tex_id_from.get(&h){
|
||||||
|
tex_id
|
||||||
|
}else{
|
||||||
let tex_id=unique_tex.len();
|
let tex_id=unique_tex.len();
|
||||||
unique_tex.push(tex);
|
unique_tex.push(tex);
|
||||||
|
tex_id_from.insert(h,tex_id);
|
||||||
tex_id
|
tex_id
|
||||||
}) as u32)
|
}) as u32)
|
||||||
}).collect();
|
}).collect();
|
||||||
let map_normal_id:Vec<NormalId>=model.unique_normal.iter().map(|untransformed_normal|{
|
let map_normal_id:Vec<NormalId>=model.unique_normal.iter().map(|untransformed_normal|{
|
||||||
let normal=(instance.normal_transform*glam::Vec3::from_array(untransformed_normal.clone())).to_array();
|
let normal=(instance.normal_transform*glam::Vec3::from_array(untransformed_normal.clone())).to_array();
|
||||||
let h=bytemuck::cast::<[f32;3],[u32;3]>(normal);
|
let h=bytemuck::cast::<[f32;3],[u32;3]>(normal);
|
||||||
NormalId::new(*normal_id_from.entry(h).or_insert_with(||{
|
NormalId::new((if let Some(&normal_id)=normal_id_from.get(&h){
|
||||||
|
normal_id
|
||||||
|
}else{
|
||||||
let normal_id=unique_normal.len();
|
let normal_id=unique_normal.len();
|
||||||
unique_normal.push(normal);
|
unique_normal.push(normal);
|
||||||
|
normal_id_from.insert(h,normal_id);
|
||||||
normal_id
|
normal_id
|
||||||
}) as u32)
|
}) as u32)
|
||||||
}).collect();
|
}).collect();
|
||||||
let map_color_id:Vec<ColorId>=model.unique_color.iter().map(|&color|{
|
let map_color_id:Vec<ColorId>=model.unique_color.iter().map(|&color|{
|
||||||
let h=bytemuck::cast::<[f32;4],[u32;4]>(color);
|
let h=bytemuck::cast::<[f32;4],[u32;4]>(color);
|
||||||
ColorId::new(*color_id_from.entry(h).or_insert_with(||{
|
ColorId::new((if let Some(&color_id)=color_id_from.get(&h){
|
||||||
|
color_id
|
||||||
|
}else{
|
||||||
let color_id=unique_color.len();
|
let color_id=unique_color.len();
|
||||||
unique_color.push(color);
|
unique_color.push(color);
|
||||||
|
color_id_from.insert(h,color_id);
|
||||||
color_id
|
color_id
|
||||||
}) as u32)
|
}) as u32)
|
||||||
}).collect();
|
}).collect();
|
||||||
@@ -374,9 +394,12 @@ impl GraphicsState{
|
|||||||
normal:map_normal_id[unmapped_vertex.normal.get() as usize],
|
normal:map_normal_id[unmapped_vertex.normal.get() as usize],
|
||||||
color:map_color_id[unmapped_vertex.color.get() as usize],
|
color:map_color_id[unmapped_vertex.color.get() as usize],
|
||||||
};
|
};
|
||||||
VertexId::new(*vertex_id_from.entry(vertex.clone()).or_insert_with(||{
|
VertexId::new((if let Some(&vertex_id)=vertex_id_from.get(&vertex){
|
||||||
|
vertex_id
|
||||||
|
}else{
|
||||||
let vertex_id=unique_vertices.len();
|
let vertex_id=unique_vertices.len();
|
||||||
unique_vertices.push(vertex);
|
unique_vertices.push(vertex.clone());
|
||||||
|
vertex_id_from.insert(vertex,vertex_id);
|
||||||
vertex_id
|
vertex_id
|
||||||
}) as u32)
|
}) as u32)
|
||||||
}).collect();
|
}).collect();
|
||||||
@@ -419,26 +442,25 @@ impl GraphicsState{
|
|||||||
//this mut be combined in a more complex way if the models use different render patterns per group
|
//this mut be combined in a more complex way if the models use different render patterns per group
|
||||||
let mut indices=Vec::new();
|
let mut indices=Vec::new();
|
||||||
for poly in model.polys.polys(){
|
for poly in model.polys.polys(){
|
||||||
let mut poly_vertices=poly.iter()
|
for end_index in 2..poly.len(){
|
||||||
.map(|&vertex_index|*index_from_vertex.entry(vertex_index).or_insert_with(||{
|
for index in [0,end_index-1,end_index]{
|
||||||
let i=vertices.len();
|
let vertex_index=poly[index];
|
||||||
let vertex=&model.unique_vertices[vertex_index.get() as usize];
|
if let Some(&i)=index_from_vertex.get(&vertex_index){
|
||||||
vertices.push(GraphicsVertex{
|
indices.push(i);
|
||||||
pos:model.unique_pos[vertex.pos.get() as usize],
|
}else{
|
||||||
tex:model.unique_tex[vertex.tex.get() as usize],
|
let i=vertices.len();
|
||||||
normal:model.unique_normal[vertex.normal.get() as usize],
|
let vertex=&model.unique_vertices[vertex_index.get() as usize];
|
||||||
color:model.unique_color[vertex.color.get() as usize],
|
vertices.push(GraphicsVertex{
|
||||||
});
|
pos:model.unique_pos[vertex.pos.get() as usize],
|
||||||
i
|
tex:model.unique_tex[vertex.tex.get() as usize],
|
||||||
}));
|
normal:model.unique_normal[vertex.normal.get() as usize],
|
||||||
|
color:model.unique_color[vertex.color.get() as usize],
|
||||||
let a=poly_vertices.next().unwrap();
|
});
|
||||||
let mut b=poly_vertices.next().unwrap();
|
index_from_vertex.insert(vertex_index,i);
|
||||||
|
indices.push(i);
|
||||||
poly_vertices.for_each(|c|{
|
}
|
||||||
indices.extend([a,b,c]);
|
}
|
||||||
b=c;
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
GraphicsMeshOwnedRenderConfig{
|
GraphicsMeshOwnedRenderConfig{
|
||||||
instances:model.instances,
|
instances:model.instances,
|
||||||
@@ -463,9 +485,7 @@ impl GraphicsState{
|
|||||||
instance_count+=model.instances.len();
|
instance_count+=model.instances.len();
|
||||||
for instances_chunk in model.instances.rchunks(chunk_size){
|
for instances_chunk in model.instances.rchunks(chunk_size){
|
||||||
model_count+=1;
|
model_count+=1;
|
||||||
let mut model_uniforms=get_instances_buffer_data(instances_chunk);
|
let model_uniforms=get_instances_buffer_data(instances_chunk);
|
||||||
//TEMP: fill with zeroes to pass validation
|
|
||||||
model_uniforms.resize(MODEL_BUFFER_SIZE*512,0.0f32);
|
|
||||||
let model_buf=device.create_buffer_init(&wgpu::util::BufferInitDescriptor{
|
let model_buf=device.create_buffer_init(&wgpu::util::BufferInitDescriptor{
|
||||||
label:Some(format!("Model{} Buf",model_count).as_str()),
|
label:Some(format!("Model{} Buf",model_count).as_str()),
|
||||||
contents:bytemuck::cast_slice(&model_uniforms),
|
contents:bytemuck::cast_slice(&model_uniforms),
|
||||||
@@ -756,13 +776,11 @@ impl GraphicsState{
|
|||||||
module:&shader,
|
module:&shader,
|
||||||
entry_point:"vs_sky",
|
entry_point:"vs_sky",
|
||||||
buffers:&[],
|
buffers:&[],
|
||||||
compilation_options:wgpu::PipelineCompilationOptions::default(),
|
|
||||||
},
|
},
|
||||||
fragment:Some(wgpu::FragmentState{
|
fragment:Some(wgpu::FragmentState{
|
||||||
module:&shader,
|
module:&shader,
|
||||||
entry_point:"fs_sky",
|
entry_point:"fs_sky",
|
||||||
targets:&[Some(config.view_formats[0].into())],
|
targets:&[Some(config.view_formats[0].into())],
|
||||||
compilation_options:wgpu::PipelineCompilationOptions::default(),
|
|
||||||
}),
|
}),
|
||||||
primitive:wgpu::PrimitiveState{
|
primitive:wgpu::PrimitiveState{
|
||||||
front_face:wgpu::FrontFace::Cw,
|
front_face:wgpu::FrontFace::Cw,
|
||||||
@@ -777,7 +795,6 @@ impl GraphicsState{
|
|||||||
}),
|
}),
|
||||||
multisample:wgpu::MultisampleState::default(),
|
multisample:wgpu::MultisampleState::default(),
|
||||||
multiview:None,
|
multiview:None,
|
||||||
cache:None,
|
|
||||||
});
|
});
|
||||||
let model_pipeline=device.create_render_pipeline(&wgpu::RenderPipelineDescriptor{
|
let model_pipeline=device.create_render_pipeline(&wgpu::RenderPipelineDescriptor{
|
||||||
label:Some("Model Pipeline"),
|
label:Some("Model Pipeline"),
|
||||||
@@ -790,13 +807,11 @@ impl GraphicsState{
|
|||||||
step_mode:wgpu::VertexStepMode::Vertex,
|
step_mode:wgpu::VertexStepMode::Vertex,
|
||||||
attributes:&wgpu::vertex_attr_array![0=>Float32x3,1=>Float32x2,2=>Float32x3,3=>Float32x4],
|
attributes:&wgpu::vertex_attr_array![0=>Float32x3,1=>Float32x2,2=>Float32x3,3=>Float32x4],
|
||||||
}],
|
}],
|
||||||
compilation_options:wgpu::PipelineCompilationOptions::default(),
|
|
||||||
},
|
},
|
||||||
fragment:Some(wgpu::FragmentState{
|
fragment:Some(wgpu::FragmentState{
|
||||||
module:&shader,
|
module:&shader,
|
||||||
entry_point:"fs_entity_texture",
|
entry_point:"fs_entity_texture",
|
||||||
targets:&[Some(config.view_formats[0].into())],
|
targets:&[Some(config.view_formats[0].into())],
|
||||||
compilation_options:wgpu::PipelineCompilationOptions::default(),
|
|
||||||
}),
|
}),
|
||||||
primitive:wgpu::PrimitiveState{
|
primitive:wgpu::PrimitiveState{
|
||||||
front_face:wgpu::FrontFace::Cw,
|
front_face:wgpu::FrontFace::Cw,
|
||||||
@@ -812,11 +827,10 @@ impl GraphicsState{
|
|||||||
}),
|
}),
|
||||||
multisample:wgpu::MultisampleState::default(),
|
multisample:wgpu::MultisampleState::default(),
|
||||||
multiview:None,
|
multiview:None,
|
||||||
cache:None,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let camera=GraphicsCamera::default();
|
let camera=GraphicsCamera::default();
|
||||||
let camera_uniforms=camera.to_uniform_data(crate::physics::PhysicsOutputState::default().extrapolate(crate::physics::MouseState::default()));
|
let camera_uniforms=camera.to_uniform_data(crate::physics::PhysicsOutputState::default().extrapolate(glam::IVec2::ZERO,integer::Time::ZERO));
|
||||||
let camera_buf=device.create_buffer_init(&wgpu::util::BufferInitDescriptor{
|
let camera_buf=device.create_buffer_init(&wgpu::util::BufferInitDescriptor{
|
||||||
label:Some("Camera"),
|
label:Some("Camera"),
|
||||||
contents:bytemuck::cast_slice(&camera_uniforms),
|
contents:bytemuck::cast_slice(&camera_uniforms),
|
||||||
@@ -893,7 +907,7 @@ impl GraphicsState{
|
|||||||
let mut encoder=device.create_command_encoder(&wgpu::CommandEncoderDescriptor{label:None});
|
let mut encoder=device.create_command_encoder(&wgpu::CommandEncoderDescriptor{label:None});
|
||||||
|
|
||||||
// update rotation
|
// update rotation
|
||||||
let camera_uniforms=self.camera.to_uniform_data(physics_output.extrapolate(crate::physics::MouseState{pos:mouse_pos,time:predicted_time}));
|
let camera_uniforms=self.camera.to_uniform_data(physics_output.extrapolate(mouse_pos,predicted_time));
|
||||||
self.staging_belt
|
self.staging_belt
|
||||||
.write_buffer(
|
.write_buffer(
|
||||||
&mut encoder,
|
&mut encoder,
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
mod file;
|
|
||||||
mod setup;
|
mod setup;
|
||||||
mod window;
|
mod window;
|
||||||
mod worker;
|
mod worker;
|
||||||
@@ -12,6 +11,8 @@ mod model_graphics;
|
|||||||
mod physics_worker;
|
mod physics_worker;
|
||||||
mod graphics_worker;
|
mod graphics_worker;
|
||||||
|
|
||||||
|
mod file;
|
||||||
|
|
||||||
fn main(){
|
fn main(){
|
||||||
setup::setup_and_start(format!("Strafe Client v{}",env!("CARGO_PKG_VERSION")));
|
setup::setup_and_start(format!("Strafe Client v{}",env!("CARGO_PKG_VERSION")));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,22 +137,22 @@ impl PhysicsMesh{
|
|||||||
//go go gadget debug print mesh
|
//go go gadget debug print mesh
|
||||||
let data=PhysicsMeshData{
|
let data=PhysicsMeshData{
|
||||||
faces:vec![
|
faces:vec![
|
||||||
Face{normal:Planar64Vec3::raw_xyz( 4294967296, 0, 0),dot:Planar64::raw(4294967296)},
|
Face{normal:Planar64Vec3::raw( 4294967296, 0, 0),dot:Planar64::raw(4294967296)},
|
||||||
Face{normal:Planar64Vec3::raw_xyz( 0, 4294967296, 0),dot:Planar64::raw(4294967296)},
|
Face{normal:Planar64Vec3::raw( 0, 4294967296, 0),dot:Planar64::raw(4294967296)},
|
||||||
Face{normal:Planar64Vec3::raw_xyz( 0, 0, 4294967296),dot:Planar64::raw(4294967296)},
|
Face{normal:Planar64Vec3::raw( 0, 0, 4294967296),dot:Planar64::raw(4294967296)},
|
||||||
Face{normal:Planar64Vec3::raw_xyz(-4294967296, 0, 0),dot:Planar64::raw(4294967296)},
|
Face{normal:Planar64Vec3::raw(-4294967296, 0, 0),dot:Planar64::raw(4294967296)},
|
||||||
Face{normal:Planar64Vec3::raw_xyz( 0,-4294967296, 0),dot:Planar64::raw(4294967296)},
|
Face{normal:Planar64Vec3::raw( 0,-4294967296, 0),dot:Planar64::raw(4294967296)},
|
||||||
Face{normal:Planar64Vec3::raw_xyz( 0, 0,-4294967296),dot:Planar64::raw(4294967296)}
|
Face{normal:Planar64Vec3::raw( 0, 0,-4294967296),dot:Planar64::raw(4294967296)}
|
||||||
],
|
],
|
||||||
verts:vec![
|
verts:vec![
|
||||||
Vert(Planar64Vec3::raw_xyz( 4294967296,-4294967296,-4294967296)),
|
Vert(Planar64Vec3::raw( 4294967296,-4294967296,-4294967296)),
|
||||||
Vert(Planar64Vec3::raw_xyz( 4294967296, 4294967296,-4294967296)),
|
Vert(Planar64Vec3::raw( 4294967296, 4294967296,-4294967296)),
|
||||||
Vert(Planar64Vec3::raw_xyz( 4294967296, 4294967296, 4294967296)),
|
Vert(Planar64Vec3::raw( 4294967296, 4294967296, 4294967296)),
|
||||||
Vert(Planar64Vec3::raw_xyz( 4294967296,-4294967296, 4294967296)),
|
Vert(Planar64Vec3::raw( 4294967296,-4294967296, 4294967296)),
|
||||||
Vert(Planar64Vec3::raw_xyz(-4294967296, 4294967296,-4294967296)),
|
Vert(Planar64Vec3::raw(-4294967296, 4294967296,-4294967296)),
|
||||||
Vert(Planar64Vec3::raw_xyz(-4294967296, 4294967296, 4294967296)),
|
Vert(Planar64Vec3::raw(-4294967296, 4294967296, 4294967296)),
|
||||||
Vert(Planar64Vec3::raw_xyz(-4294967296,-4294967296, 4294967296)),
|
Vert(Planar64Vec3::raw(-4294967296,-4294967296, 4294967296)),
|
||||||
Vert(Planar64Vec3::raw_xyz(-4294967296,-4294967296,-4294967296))
|
Vert(Planar64Vec3::raw(-4294967296,-4294967296,-4294967296))
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
let mesh_topology=PhysicsMeshTopology{
|
let mesh_topology=PhysicsMeshTopology{
|
||||||
@@ -167,17 +167,17 @@ impl PhysicsMesh{
|
|||||||
FaceRefs{edges:vec![SubmeshDirectedEdgeId(4),SubmeshDirectedEdgeId(0),SubmeshDirectedEdgeId((9223372036854775819u64-(1<<63)+(1<<31)) as u32),SubmeshDirectedEdgeId(9)]}
|
FaceRefs{edges:vec![SubmeshDirectedEdgeId(4),SubmeshDirectedEdgeId(0),SubmeshDirectedEdgeId((9223372036854775819u64-(1<<63)+(1<<31)) as u32),SubmeshDirectedEdgeId(9)]}
|
||||||
],
|
],
|
||||||
edge_topology:vec![
|
edge_topology:vec![
|
||||||
EdgeRefs{faces:[SubmeshFaceId(0),SubmeshFaceId(5)],verts:[SubmeshVertId(0),SubmeshVertId(1)]},
|
EdgeRefs{faces:[SubmeshFaceId(0),SubmeshFaceId(5)],verts:[SubmeshVertId(0),SubmeshVertId(1)]},
|
||||||
EdgeRefs{faces:[SubmeshFaceId(0),SubmeshFaceId(1)],verts:[SubmeshVertId(1),SubmeshVertId(2)]},
|
EdgeRefs{faces:[SubmeshFaceId(0),SubmeshFaceId(1)],verts:[SubmeshVertId(1),SubmeshVertId(2)]},
|
||||||
EdgeRefs{faces:[SubmeshFaceId(0),SubmeshFaceId(2)],verts:[SubmeshVertId(2),SubmeshVertId(3)]},
|
EdgeRefs{faces:[SubmeshFaceId(0),SubmeshFaceId(2)],verts:[SubmeshVertId(2),SubmeshVertId(3)]},
|
||||||
EdgeRefs{faces:[SubmeshFaceId(4),SubmeshFaceId(0)],verts:[SubmeshVertId(0),SubmeshVertId(3)]},
|
EdgeRefs{faces:[SubmeshFaceId(4),SubmeshFaceId(0)],verts:[SubmeshVertId(0),SubmeshVertId(3)]},
|
||||||
EdgeRefs{faces:[SubmeshFaceId(1),SubmeshFaceId(5)],verts:[SubmeshVertId(1),SubmeshVertId(4)]},
|
EdgeRefs{faces:[SubmeshFaceId(1),SubmeshFaceId(5)],verts:[SubmeshVertId(1),SubmeshVertId(4)]},
|
||||||
EdgeRefs{faces:[SubmeshFaceId(1),SubmeshFaceId(3)],verts:[SubmeshVertId(4),SubmeshVertId(5)]},
|
EdgeRefs{faces:[SubmeshFaceId(1),SubmeshFaceId(3)],verts:[SubmeshVertId(4),SubmeshVertId(5)]},
|
||||||
EdgeRefs{faces:[SubmeshFaceId(2),SubmeshFaceId(1)],verts:[SubmeshVertId(2),SubmeshVertId(5)]},
|
EdgeRefs{faces:[SubmeshFaceId(2),SubmeshFaceId(1)],verts:[SubmeshVertId(2),SubmeshVertId(5)]},
|
||||||
EdgeRefs{faces:[SubmeshFaceId(4),SubmeshFaceId(2)],verts:[SubmeshVertId(3),SubmeshVertId(6)]},
|
EdgeRefs{faces:[SubmeshFaceId(4),SubmeshFaceId(2)],verts:[SubmeshVertId(3),SubmeshVertId(6)]},
|
||||||
EdgeRefs{faces:[SubmeshFaceId(2),SubmeshFaceId(3)],verts:[SubmeshVertId(5),SubmeshVertId(6)]},
|
EdgeRefs{faces:[SubmeshFaceId(2),SubmeshFaceId(3)],verts:[SubmeshVertId(5),SubmeshVertId(6)]},
|
||||||
EdgeRefs{faces:[SubmeshFaceId(3),SubmeshFaceId(5)],verts:[SubmeshVertId(4),SubmeshVertId(7)]},
|
EdgeRefs{faces:[SubmeshFaceId(3),SubmeshFaceId(5)],verts:[SubmeshVertId(4),SubmeshVertId(7)]},
|
||||||
EdgeRefs{faces:[SubmeshFaceId(4),SubmeshFaceId(3)],verts:[SubmeshVertId(6),SubmeshVertId(7)]},
|
EdgeRefs{faces:[SubmeshFaceId(4),SubmeshFaceId(3)],verts:[SubmeshVertId(6),SubmeshVertId(7)]},
|
||||||
EdgeRefs{faces:[SubmeshFaceId(5),SubmeshFaceId(4)],verts:[SubmeshVertId(0),SubmeshVertId(7)]}
|
EdgeRefs{faces:[SubmeshFaceId(5),SubmeshFaceId(4)],verts:[SubmeshVertId(0),SubmeshVertId(7)]}
|
||||||
],
|
],
|
||||||
vert_topology:vec![
|
vert_topology:vec![
|
||||||
@@ -284,7 +284,6 @@ impl EdgePool{
|
|||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum PhysicsMeshError{
|
pub enum PhysicsMeshError{
|
||||||
ZeroVertices,
|
ZeroVertices,
|
||||||
NoPhysicsGroups,
|
|
||||||
}
|
}
|
||||||
impl std::fmt::Display for PhysicsMeshError{
|
impl std::fmt::Display for PhysicsMeshError{
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
@@ -405,7 +404,7 @@ impl TryFrom<&model::Mesh> for PhysicsMesh{
|
|||||||
faces,
|
faces,
|
||||||
verts,
|
verts,
|
||||||
},
|
},
|
||||||
complete_mesh:mesh_topologies.pop().ok_or(PhysicsMeshError::NoPhysicsGroups)?,
|
complete_mesh:mesh_topologies.pop().unwrap(),
|
||||||
submeshes:mesh_topologies,
|
submeshes:mesh_topologies,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -961,4 +960,4 @@ fn test_is_empty_volume(){
|
|||||||
fn build_me_a_cube(){
|
fn build_me_a_cube(){
|
||||||
let mesh=PhysicsMesh::unit_cube();
|
let mesh=PhysicsMesh::unit_cube();
|
||||||
//println!("mesh={:?}",mesh);
|
//println!("mesh={:?}",mesh);
|
||||||
}
|
}
|
||||||
1085
src/physics.rs
1085
src/physics.rs
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,6 @@
|
|||||||
use crate::physics::{MouseState,PhysicsInputInstruction};
|
use crate::physics::{MouseState,PhysicsInputInstruction};
|
||||||
use strafesnet_common::integer::Time;
|
use strafesnet_common::integer::Time;
|
||||||
use strafesnet_common::instruction::TimedInstruction;
|
use strafesnet_common::instruction::{TimedInstruction,InstructionConsumer};
|
||||||
use strafesnet_common::timer::{Scaled,Timer,TimerState};
|
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum InputInstruction{
|
pub enum InputInstruction{
|
||||||
MoveMouse(glam::IVec2),
|
MoveMouse(glam::IVec2),
|
||||||
@@ -14,9 +12,7 @@ pub enum InputInstruction{
|
|||||||
MoveForward(bool),
|
MoveForward(bool),
|
||||||
Jump(bool),
|
Jump(bool),
|
||||||
Zoom(bool),
|
Zoom(bool),
|
||||||
Restart,
|
Reset,
|
||||||
Spawn(strafesnet_common::gameplay_modes::ModeId,strafesnet_common::gameplay_modes::StageId),
|
|
||||||
PracticeFly,
|
|
||||||
}
|
}
|
||||||
pub enum Instruction{
|
pub enum Instruction{
|
||||||
Input(InputInstruction),
|
Input(InputInstruction),
|
||||||
@@ -24,163 +20,114 @@ pub enum Instruction{
|
|||||||
Resize(winit::dpi::PhysicalSize<u32>,crate::settings::UserSettings),
|
Resize(winit::dpi::PhysicalSize<u32>,crate::settings::UserSettings),
|
||||||
GenerateModels(strafesnet_common::map::CompleteMap),
|
GenerateModels(strafesnet_common::map::CompleteMap),
|
||||||
ClearModels,
|
ClearModels,
|
||||||
SetPaused(bool),
|
|
||||||
//Graphics(crate::graphics_worker::Instruction),
|
//Graphics(crate::graphics_worker::Instruction),
|
||||||
}
|
}
|
||||||
pub struct MouseInterpolator{
|
|
||||||
timeline:std::collections::VecDeque<TimedInstruction<PhysicsInputInstruction>>,
|
pub fn new(mut physics:crate::physics::PhysicsContext,mut graphics_worker:crate::compat_worker::INWorker<crate::graphics_worker::Instruction>)->crate::compat_worker::QNWorker<TimedInstruction<Instruction>>{
|
||||||
last_mouse_time:Time,//this value is pre-transformed to simulation time
|
let mut mouse_blocking=true;
|
||||||
mouse_blocking:bool,
|
let mut last_mouse_time=physics.state.next_mouse.time;
|
||||||
timer:Timer<Scaled>,
|
let mut timeline=std::collections::VecDeque::new();
|
||||||
}
|
crate::compat_worker::QNWorker::new(move |ins:TimedInstruction<Instruction>|{
|
||||||
impl MouseInterpolator{
|
if if let Some(phys_input)=match &ins.instruction{
|
||||||
fn push_mouse_instruction(&mut self,physics:&crate::physics::PhysicsContext,ins:&TimedInstruction<Instruction>,m:glam::IVec2){
|
Instruction::Input(input_instruction)=>match input_instruction{
|
||||||
if self.mouse_blocking{
|
&InputInstruction::MoveMouse(m)=>{
|
||||||
//tell the game state which is living in the past about its future
|
if mouse_blocking{
|
||||||
self.timeline.push_front(TimedInstruction{
|
//tell the game state which is living in the past about its future
|
||||||
time:self.last_mouse_time,
|
timeline.push_front(TimedInstruction{
|
||||||
instruction:PhysicsInputInstruction::SetNextMouse(MouseState{time:self.timer.time(ins.time),pos:m}),
|
time:last_mouse_time,
|
||||||
});
|
instruction:PhysicsInputInstruction::SetNextMouse(MouseState{time:ins.time,pos:m}),
|
||||||
}else{
|
});
|
||||||
//mouse has just started moving again after being still for longer than 10ms.
|
}else{
|
||||||
//replace the entire mouse interpolation state to avoid an intermediate state with identical m0.t m1.t timestamps which will divide by zero
|
//mouse has just started moving again after being still for longer than 10ms.
|
||||||
self.timeline.push_front(TimedInstruction{
|
//replace the entire mouse interpolation state to avoid an intermediate state with identical m0.t m1.t timestamps which will divide by zero
|
||||||
time:self.last_mouse_time,
|
timeline.push_front(TimedInstruction{
|
||||||
instruction:PhysicsInputInstruction::ReplaceMouse(
|
time:last_mouse_time,
|
||||||
MouseState{time:self.last_mouse_time,pos:physics.get_next_mouse().pos},
|
instruction:PhysicsInputInstruction::ReplaceMouse(
|
||||||
MouseState{time:self.timer.time(ins.time),pos:m}
|
MouseState{time:last_mouse_time,pos:physics.state.next_mouse.pos},
|
||||||
),
|
MouseState{time:ins.time,pos:m}
|
||||||
});
|
),
|
||||||
//delay physics execution until we have an interpolation target
|
});
|
||||||
self.mouse_blocking=true;
|
//delay physics execution until we have an interpolation target
|
||||||
}
|
mouse_blocking=true;
|
||||||
self.last_mouse_time=self.timer.time(ins.time);
|
}
|
||||||
}
|
last_mouse_time=ins.time;
|
||||||
/// returns the mapped physics input instruction
|
None
|
||||||
/// may or may not mutate internal state XD!
|
},
|
||||||
fn map_instruction(&mut self,physics:&crate::physics::PhysicsContext,ins:&TimedInstruction<Instruction>)->Option<PhysicsInputInstruction>{
|
&InputInstruction::MoveForward(s)=>Some(PhysicsInputInstruction::SetMoveForward(s)),
|
||||||
match &ins.instruction{
|
&InputInstruction::MoveLeft(s)=>Some(PhysicsInputInstruction::SetMoveLeft(s)),
|
||||||
Instruction::Input(input_instruction)=>match input_instruction{
|
&InputInstruction::MoveBack(s)=>Some(PhysicsInputInstruction::SetMoveBack(s)),
|
||||||
&InputInstruction::MoveMouse(m)=>{
|
&InputInstruction::MoveRight(s)=>Some(PhysicsInputInstruction::SetMoveRight(s)),
|
||||||
if !self.timer.is_paused(){
|
&InputInstruction::MoveUp(s)=>Some(PhysicsInputInstruction::SetMoveUp(s)),
|
||||||
self.push_mouse_instruction(physics,ins,m);
|
&InputInstruction::MoveDown(s)=>Some(PhysicsInputInstruction::SetMoveDown(s)),
|
||||||
}
|
&InputInstruction::Jump(s)=>Some(PhysicsInputInstruction::SetJump(s)),
|
||||||
None
|
&InputInstruction::Zoom(s)=>Some(PhysicsInputInstruction::SetZoom(s)),
|
||||||
|
InputInstruction::Reset=>Some(PhysicsInputInstruction::Reset),
|
||||||
},
|
},
|
||||||
&InputInstruction::MoveForward(s)=>Some(PhysicsInputInstruction::SetMoveForward(s)),
|
Instruction::GenerateModels(_)=>Some(PhysicsInputInstruction::Idle),
|
||||||
&InputInstruction::MoveLeft(s)=>Some(PhysicsInputInstruction::SetMoveLeft(s)),
|
Instruction::ClearModels=>Some(PhysicsInputInstruction::Idle),
|
||||||
&InputInstruction::MoveBack(s)=>Some(PhysicsInputInstruction::SetMoveBack(s)),
|
Instruction::Resize(_,_)=>Some(PhysicsInputInstruction::Idle),
|
||||||
&InputInstruction::MoveRight(s)=>Some(PhysicsInputInstruction::SetMoveRight(s)),
|
Instruction::Render=>Some(PhysicsInputInstruction::Idle),
|
||||||
&InputInstruction::MoveUp(s)=>Some(PhysicsInputInstruction::SetMoveUp(s)),
|
}{
|
||||||
&InputInstruction::MoveDown(s)=>Some(PhysicsInputInstruction::SetMoveDown(s)),
|
//non-mouse event
|
||||||
&InputInstruction::Jump(s)=>Some(PhysicsInputInstruction::SetJump(s)),
|
timeline.push_back(TimedInstruction{
|
||||||
&InputInstruction::Zoom(s)=>Some(PhysicsInputInstruction::SetZoom(s)),
|
time:ins.time,
|
||||||
&InputInstruction::Spawn(mode_id,stage_id)=>Some(PhysicsInputInstruction::Spawn(mode_id,stage_id)),
|
instruction:phys_input,
|
||||||
InputInstruction::Restart=>Some(PhysicsInputInstruction::Restart),
|
|
||||||
InputInstruction::PracticeFly=>Some(PhysicsInputInstruction::PracticeFly),
|
|
||||||
},
|
|
||||||
//do these really need to idle the physics?
|
|
||||||
//sending None dumps the instruction queue
|
|
||||||
Instruction::GenerateModels(_)=>Some(PhysicsInputInstruction::Idle),
|
|
||||||
Instruction::ClearModels=>Some(PhysicsInputInstruction::Idle),
|
|
||||||
Instruction::Resize(_,_)=>Some(PhysicsInputInstruction::Idle),
|
|
||||||
Instruction::Render=>Some(PhysicsInputInstruction::Idle),
|
|
||||||
&Instruction::SetPaused(paused)=>{
|
|
||||||
if let Err(e)=self.timer.set_paused(ins.time,paused){
|
|
||||||
println!("Cannot pause: {e}");
|
|
||||||
}
|
|
||||||
Some(PhysicsInputInstruction::Idle)
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fn update_mouse_blocking(&mut self,physics:&crate::physics::PhysicsContext,ins:&TimedInstruction<Instruction>)->bool{
|
|
||||||
if self.mouse_blocking{
|
|
||||||
//assume the mouse has stopped moving after 10ms.
|
|
||||||
//shitty mice are 125Hz which is 8ms so this should cover that.
|
|
||||||
//setting this to 100us still doesn't print even though it's 10x lower than the polling rate,
|
|
||||||
//so mouse events are probably not handled separately from drawing and fire right before it :(
|
|
||||||
if Time::from_millis(10)<self.timer.time(ins.time)-physics.get_next_mouse().time{
|
|
||||||
//push an event to extrapolate no movement from
|
|
||||||
self.timeline.push_front(TimedInstruction{
|
|
||||||
time:self.last_mouse_time,
|
|
||||||
instruction:PhysicsInputInstruction::SetNextMouse(MouseState{time:self.timer.time(ins.time),pos:physics.get_next_mouse().pos}),
|
|
||||||
});
|
});
|
||||||
self.last_mouse_time=self.timer.time(ins.time);
|
|
||||||
//stop blocking. the mouse is not moving so the physics does not need to live in the past and wait for interpolation targets.
|
if mouse_blocking{
|
||||||
self.mouse_blocking=false;
|
//assume the mouse has stopped moving after 10ms.
|
||||||
true
|
//shitty mice are 125Hz which is 8ms so this should cover that.
|
||||||
|
//setting this to 100us still doesn't print even though it's 10x lower than the polling rate,
|
||||||
|
//so mouse events are probably not handled separately from drawing and fire right before it :(
|
||||||
|
if Time::from_millis(10)<ins.time-physics.state.next_mouse.time{
|
||||||
|
//push an event to extrapolate no movement from
|
||||||
|
timeline.push_front(TimedInstruction{
|
||||||
|
time:last_mouse_time,
|
||||||
|
instruction:PhysicsInputInstruction::SetNextMouse(MouseState{time:ins.time,pos:physics.state.next_mouse.pos}),
|
||||||
|
});
|
||||||
|
last_mouse_time=ins.time;
|
||||||
|
//stop blocking. the mouse is not moving so the physics does not need to live in the past and wait for interpolation targets.
|
||||||
|
mouse_blocking=false;
|
||||||
|
true
|
||||||
|
}else{
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
//keep this up to date so that it can be used as a known-timestamp
|
||||||
|
//that the mouse was not moving when the mouse starts moving again
|
||||||
|
last_mouse_time=ins.time;
|
||||||
|
true
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
false
|
//mouse event
|
||||||
|
true
|
||||||
|
}{
|
||||||
|
//empty queue
|
||||||
|
while let Some(instruction)=timeline.pop_front(){
|
||||||
|
physics.run(instruction.time);
|
||||||
|
physics.process_instruction(TimedInstruction{
|
||||||
|
time:instruction.time,
|
||||||
|
instruction:crate::physics::PhysicsInstruction::Input(instruction.instruction),
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
match ins.instruction{
|
||||||
//keep this up to date so that it can be used as a known-timestamp
|
Instruction::Render=>{
|
||||||
//that the mouse was Timer<Scaled>not moving when the mouse starts moving again
|
graphics_worker.send(crate::graphics_worker::Instruction::Render(physics.state.output(),ins.time,physics.state.next_mouse.pos)).unwrap();
|
||||||
self.last_mouse_time=self.timer.time(ins.time);
|
},
|
||||||
true
|
Instruction::Resize(size,user_settings)=>{
|
||||||
}
|
graphics_worker.send(crate::graphics_worker::Instruction::Resize(size,user_settings)).unwrap();
|
||||||
}
|
},
|
||||||
/// returns whether or not to empty the instruction queue
|
Instruction::GenerateModels(map)=>{
|
||||||
fn handle_physics_input(&mut self,physics:&crate::physics::PhysicsContext,ins:&TimedInstruction<Instruction>,phys_input_option:Option<PhysicsInputInstruction>)->bool{
|
physics.generate_models(&map);
|
||||||
if let Some(phys_input)=phys_input_option{
|
physics.spawn();
|
||||||
//non-mouse event
|
graphics_worker.send(crate::graphics_worker::Instruction::GenerateModels(map)).unwrap();
|
||||||
self.timeline.push_back(TimedInstruction{
|
},
|
||||||
time:self.timer.time(ins.time),
|
Instruction::ClearModels=>{
|
||||||
instruction:phys_input,
|
physics.state.clear();
|
||||||
});
|
graphics_worker.send(crate::graphics_worker::Instruction::ClearModels).unwrap();
|
||||||
|
},
|
||||||
//this returns the bool for us
|
_=>(),
|
||||||
self.update_mouse_blocking(physics,ins)
|
}
|
||||||
}else{
|
})
|
||||||
//mouse event
|
}
|
||||||
true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fn empty_queue(&mut self,physics:&mut crate::physics::PhysicsContext){
|
|
||||||
while let Some(ins)=self.timeline.pop_front(){
|
|
||||||
physics.run_input_instruction(ins);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fn handle_instruction(&mut self,physics:&mut crate::physics::PhysicsContext,ins:&TimedInstruction<Instruction>){
|
|
||||||
let physics_input_option=self.map_instruction(physics,ins);
|
|
||||||
let should_empty_queue=self.handle_physics_input(physics,ins,physics_input_option);
|
|
||||||
if should_empty_queue{
|
|
||||||
self.empty_queue(physics);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn new(mut physics:crate::physics::PhysicsContext,mut graphics_worker:crate::compat_worker::INWorker<crate::graphics_worker::Instruction>)->crate::compat_worker::QNWorker<TimedInstruction<Instruction>>{
|
|
||||||
let mut interpolator=MouseInterpolator{
|
|
||||||
mouse_blocking:true,
|
|
||||||
last_mouse_time:physics.get_next_mouse().time,
|
|
||||||
timeline:std::collections::VecDeque::new(),
|
|
||||||
timer:Timer::from_state(Scaled::identity(),false),
|
|
||||||
};
|
|
||||||
crate::compat_worker::QNWorker::new(move |ins:TimedInstruction<Instruction>|{
|
|
||||||
interpolator.handle_instruction(&mut physics,&ins);
|
|
||||||
match ins.instruction{
|
|
||||||
Instruction::Render=>{
|
|
||||||
graphics_worker.send(crate::graphics_worker::Instruction::Render(physics.output(),interpolator.timer.time(ins.time),physics.get_next_mouse().pos)).unwrap();
|
|
||||||
},
|
|
||||||
Instruction::Resize(size,user_settings)=>{
|
|
||||||
graphics_worker.send(crate::graphics_worker::Instruction::Resize(size,user_settings)).unwrap();
|
|
||||||
},
|
|
||||||
Instruction::GenerateModels(map)=>{
|
|
||||||
physics.generate_models(&map);
|
|
||||||
//important!
|
|
||||||
//bots will not work properly without this exact restart + spawn setup
|
|
||||||
//reset the physics state to start a new run on the new map
|
|
||||||
physics.restart();
|
|
||||||
//generate a spawn event so bots work properly on the first run
|
|
||||||
//no run started so does not invalidate the run
|
|
||||||
physics.spawn();
|
|
||||||
graphics_worker.send(crate::graphics_worker::Instruction::GenerateModels(map)).unwrap();
|
|
||||||
},
|
|
||||||
Instruction::ClearModels=>{
|
|
||||||
physics.clear();
|
|
||||||
graphics_worker.send(crate::graphics_worker::Instruction::ClearModels).unwrap();
|
|
||||||
},
|
|
||||||
_=>(),
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
16
src/setup.rs
16
src/setup.rs
@@ -25,14 +25,14 @@ struct SetupContextPartial1{
|
|||||||
instance:wgpu::Instance,
|
instance:wgpu::Instance,
|
||||||
}
|
}
|
||||||
fn create_window(title:&str,event_loop:&winit::event_loop::EventLoop<()>)->Result<winit::window::Window,winit::error::OsError>{
|
fn create_window(title:&str,event_loop:&winit::event_loop::EventLoop<()>)->Result<winit::window::Window,winit::error::OsError>{
|
||||||
let mut attr=winit::window::WindowAttributes::default();
|
let mut builder = winit::window::WindowBuilder::new();
|
||||||
attr=attr.with_title(title);
|
builder = builder.with_title(title);
|
||||||
#[cfg(windows_OFF)] // TODO
|
#[cfg(windows_OFF)] // TODO
|
||||||
{
|
{
|
||||||
use winit::platform::windows::WindowBuilderExtWindows;
|
use winit::platform::windows::WindowBuilderExtWindows;
|
||||||
builder=builder.with_no_redirection_bitmap(true);
|
builder = builder.with_no_redirection_bitmap(true);
|
||||||
}
|
}
|
||||||
event_loop.create_window(attr)
|
builder.build(event_loop)
|
||||||
}
|
}
|
||||||
fn create_instance()->SetupContextPartial1{
|
fn create_instance()->SetupContextPartial1{
|
||||||
let backends=wgpu::util::backend_bits_from_env().unwrap_or_else(wgpu::Backends::all);
|
let backends=wgpu::util::backend_bits_from_env().unwrap_or_else(wgpu::Backends::all);
|
||||||
@@ -143,7 +143,6 @@ impl<'a> SetupContextPartial3<'a>{
|
|||||||
label: None,
|
label: None,
|
||||||
required_features: (optional_features & self.adapter.features()) | required_features,
|
required_features: (optional_features & self.adapter.features()) | required_features,
|
||||||
required_limits: needed_limits,
|
required_limits: needed_limits,
|
||||||
memory_hints:wgpu::MemoryHints::Performance,
|
|
||||||
},
|
},
|
||||||
trace_dir.ok().as_ref().map(std::path::Path::new),
|
trace_dir.ok().as_ref().map(std::path::Path::new),
|
||||||
))
|
))
|
||||||
@@ -217,8 +216,9 @@ pub fn setup_and_start(title:String){
|
|||||||
//the thread that spawns the physics thread
|
//the thread that spawns the physics thread
|
||||||
let mut window_thread=window.into_worker(setup_context);
|
let mut window_thread=window.into_worker(setup_context);
|
||||||
|
|
||||||
if let Some(arg)=std::env::args().nth(1){
|
let args:Vec<String>=std::env::args().collect();
|
||||||
let path=std::path::PathBuf::from(arg);
|
if args.len()==2{
|
||||||
|
let path=std::path::PathBuf::from(&args[1]);
|
||||||
window_thread.send(TimedInstruction{
|
window_thread.send(TimedInstruction{
|
||||||
time:integer::Time::ZERO,
|
time:integer::Time::ZERO,
|
||||||
instruction:WindowInstruction::WindowEvent(winit::event::WindowEvent::DroppedFile(path)),
|
instruction:WindowInstruction::WindowEvent(winit::event::WindowEvent::DroppedFile(path)),
|
||||||
@@ -287,4 +287,4 @@ fn run_event_loop(
|
|||||||
_=>{}
|
_=>{}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,7 @@ struct ModelInstance{
|
|||||||
//my fancy idea is to create a megatexture for each model that includes all the textures each intance will need
|
//my fancy idea is to create a megatexture for each model that includes all the textures each intance will need
|
||||||
//the texture transform then maps the texture coordinates to the location of the specific texture
|
//the texture transform then maps the texture coordinates to the location of the specific texture
|
||||||
//group 1 is the model
|
//group 1 is the model
|
||||||
const MAX_MODEL_INSTANCES=512;
|
const MAX_MODEL_INSTANCES=4096;
|
||||||
@group(2)
|
@group(2)
|
||||||
@binding(0)
|
@binding(0)
|
||||||
var<uniform> model_instances: array<ModelInstance, MAX_MODEL_INSTANCES>;
|
var<uniform> model_instances: array<ModelInstance, MAX_MODEL_INSTANCES>;
|
||||||
|
|||||||
@@ -35,12 +35,8 @@ impl WindowContext<'_>{
|
|||||||
Err(e)=>println!("Failed to load map: {e}"),
|
Err(e)=>println!("Failed to load map: {e}"),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
winit::event::WindowEvent::Focused(state)=>{
|
winit::event::WindowEvent::Focused(_state)=>{
|
||||||
//pause unpause
|
//pause unpause
|
||||||
self.physics_thread.send(TimedInstruction{
|
|
||||||
time,
|
|
||||||
instruction:crate::physics_worker::Instruction::SetPaused(!state),
|
|
||||||
}).unwrap();
|
|
||||||
//recalculate pressed keys on focus
|
//recalculate pressed keys on focus
|
||||||
},
|
},
|
||||||
winit::event::WindowEvent::KeyboardInput{
|
winit::event::WindowEvent::KeyboardInput{
|
||||||
@@ -111,12 +107,7 @@ impl WindowContext<'_>{
|
|||||||
"e"=>Some(InputInstruction::MoveUp(s)),
|
"e"=>Some(InputInstruction::MoveUp(s)),
|
||||||
"q"=>Some(InputInstruction::MoveDown(s)),
|
"q"=>Some(InputInstruction::MoveDown(s)),
|
||||||
"z"=>Some(InputInstruction::Zoom(s)),
|
"z"=>Some(InputInstruction::Zoom(s)),
|
||||||
"r"=>if s{
|
"r"=>if s{Some(InputInstruction::Reset)}else{None},
|
||||||
//mouse needs to be reset since the position is absolute
|
|
||||||
self.mouse=crate::physics::MouseState::default();
|
|
||||||
Some(InputInstruction::Restart)
|
|
||||||
}else{None},
|
|
||||||
"f"=>if s{Some(InputInstruction::PracticeFly)}else{None},
|
|
||||||
_=>None,
|
_=>None,
|
||||||
},
|
},
|
||||||
_=>None,
|
_=>None,
|
||||||
@@ -182,7 +173,7 @@ impl<'a> WindowContextSetup<'a>{
|
|||||||
let user_settings=crate::settings::read_user_settings();
|
let user_settings=crate::settings::read_user_settings();
|
||||||
|
|
||||||
let mut physics=crate::physics::PhysicsContext::default();
|
let mut physics=crate::physics::PhysicsContext::default();
|
||||||
physics.load_user_settings(&user_settings);
|
physics.state.load_user_settings(&user_settings);
|
||||||
|
|
||||||
let mut graphics=crate::graphics::GraphicsState::new(&context.device,&context.queue,&context.config);
|
let mut graphics=crate::graphics::GraphicsState::new(&context.device,&context.queue,&context.config);
|
||||||
graphics.load_user_settings(&user_settings);
|
graphics.load_user_settings(&user_settings);
|
||||||
@@ -241,4 +232,4 @@ impl<'a> WindowContextSetup<'a>{
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -190,7 +190,7 @@ mod test{
|
|||||||
for _ in 0..5 {
|
for _ in 0..5 {
|
||||||
let task = instruction::TimedInstruction{
|
let task = instruction::TimedInstruction{
|
||||||
time:integer::Time::ZERO,
|
time:integer::Time::ZERO,
|
||||||
instruction:physics::PhysicsInputInstruction::Idle,
|
instruction:physics::PhysicsInstruction::StrafeTick,
|
||||||
};
|
};
|
||||||
worker.send(task).unwrap();
|
worker.send(task).unwrap();
|
||||||
}
|
}
|
||||||
@@ -204,7 +204,7 @@ mod test{
|
|||||||
// Send a new task
|
// Send a new task
|
||||||
let task = instruction::TimedInstruction{
|
let task = instruction::TimedInstruction{
|
||||||
time:integer::Time::ZERO,
|
time:integer::Time::ZERO,
|
||||||
instruction:physics::PhysicsInputInstruction::Idle,
|
instruction:physics::PhysicsInstruction::StrafeTick,
|
||||||
};
|
};
|
||||||
worker.send(task).unwrap();
|
worker.send(task).unwrap();
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
mangohud ../target/release/strafe-client bhop_maps/5692113331.snfm
|
mangohud ../target/release/strafe-client bhop_maps/5692113331.rbxm
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
/run/media/quat/Files/Documents/map-files/verify-scripts/maps/bhop_snfm
|
/run/media/quat/Files/Documents/map-files/verify-scripts/maps/bhop_all/
|
||||||
@@ -1 +1 @@
|
|||||||
cargo build --release --target x86_64-pc-windows-gnu --all-features
|
cargo build --release --target x86_64-pc-windows-gnu
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
mangohud ../target/release/strafe-client bhop_maps/5692124338.snfm
|
|
||||||
@@ -1 +1 @@
|
|||||||
/run/media/quat/Files/Documents/map-files/verify-scripts/maps/surf_snfm
|
/run/media/quat/Files/Documents/map-files/verify-scripts/maps/surf_all/
|
||||||
1
tools/textures
Symbolic link
1
tools/textures
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/run/media/quat/Files/Documents/map-files/verify-scripts/textures/dds/
|
||||||
@@ -1 +1 @@
|
|||||||
mangohud ../target/release/strafe-client bhop_maps/5692152916.snfm
|
mangohud ../target/release/strafe-client bhop_maps/5692152916.rbxm
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
mangohud ../target/release/strafe-client surf_maps/5692145408.snfm
|
mangohud ../target/release/strafe-client surf_maps/5692145408.rbxm
|
||||||
|
|||||||
Reference in New Issue
Block a user