fixup some warnings

This commit is contained in:
Quaternions 2024-02-08 21:26:53 -08:00
parent 1540710942
commit 46965441b0
5 changed files with 9 additions and 13 deletions

View File

@ -2,7 +2,7 @@ use std::borrow::Cow;
use std::collections::{HashSet,HashMap};
use strafesnet_common::map;
use strafesnet_common::integer;
use strafesnet_common::model::{self, ColorId, MapVertexId, NormalId, PolygonIter, PositionId, RenderConfigId, TextureCoordinateId, VertexId};
use strafesnet_common::model::{self, ColorId, NormalId, PolygonIter, PositionId, RenderConfigId, TextureCoordinateId, VertexId};
use wgpu::{util::DeviceExt,AstcBlock,AstcChannel};
use crate::model_graphics::{self,IndexedGraphicsMeshOwnedRenderConfig,IndexedGraphicsMeshOwnedRenderConfigId,GraphicsMeshOwnedRenderConfig,GraphicsModelColor4,GraphicsModelOwned,GraphicsVertex};

View File

@ -201,10 +201,6 @@ impl PhysicsMesh{
Self::unit_cube()
}
#[inline]
pub const fn mesh_data(&self)->&PhysicsMeshData{
&self.data
}
#[inline]
pub const fn complete_mesh(&self)->&PhysicsMeshTopology{
&self.complete_mesh
}

View File

@ -1066,7 +1066,7 @@ impl PhysicsContext{
//check for collision starts
let mut aabb=aabb::Aabb::default();
state.body.grow_aabb(&mut aabb,state.time,collector.time());
aabb.inflate(state.style.hitbox.halfsize);
aabb.inflate(data.hitbox_mesh.halfsize);
//common body
let relative_body=VirtualBody::relative(&Body::default(),&state.body).body(state.time);
data.bvh.the_tester(&aabb,&mut |convex_mesh_id|{
@ -1447,11 +1447,11 @@ fn run_teleport_behaviour(wormhole:&Option<gameplay_attributes::Wormhole>,models
mod test{
use super::*;
fn test_collision_axis_aligned(relative_body:Body,expected_collision_time:Option<Time>){
let h0=HitboxMesh::from_mesh_scale(PhysicsMesh::unit_cube(),Planar64Vec3::int(5,1,5)/2);
let h1=HitboxMesh::roblox();
let h0=HitboxMesh::new(PhysicsMesh::unit_cube(),integer::Planar64Affine3::new(Planar64Mat3::from_diagonal(Planar64Vec3::int(5,1,5)/2),Planar64Vec3::ZERO));
let h1=StyleModifiers::roblox_bhop().calculate_mesh();
let hitbox_mesh=h1.transformed_mesh();
let platform_mesh=h0.transformed_mesh();
let minkowski=model_physics::MinkowskiMesh::minkowski_sum(&platform_mesh,&hitbox_mesh);
let minkowski=model_physics::MinkowskiMesh::minkowski_sum(platform_mesh,hitbox_mesh);
let collision=minkowski.predict_collision_in(&relative_body,Time::MAX);
assert_eq!(collision.map(|tup|tup.1),expected_collision_time,"Incorrect time of collision");
}
@ -1466,7 +1466,7 @@ mod test{
Planar64Vec3::ZERO,
)
);
let h1=HitboxMesh::roblox();
let h1=StyleModifiers::roblox_bhop().calculate_mesh();
let hitbox_mesh=h1.transformed_mesh();
let platform_mesh=h0.transformed_mesh();
let minkowski=model_physics::MinkowskiMesh::minkowski_sum(platform_mesh,hitbox_mesh);

View File

@ -217,12 +217,12 @@ pub fn setup_and_start(title:String){
let mut window_thread=window.into_worker(setup_context);
let args:Vec<String>=std::env::args().collect();
let indexed_model_instances=if args.len()==2{
if args.len()==2{
let path=std::path::PathBuf::from(&args[1]);
window_thread.send(TimedInstruction{
time:integer::Time::ZERO,
instruction:WindowInstruction::WindowEvent(winit::event::WindowEvent::DroppedFile(path)),
});
}).unwrap();
};
println!("Entering event loop...");