TODO: don't do this!

This commit is contained in:
Quaternions 2023-11-28 21:55:16 -08:00
parent ddb91031b0
commit 2558eac7fa

View File

@ -108,12 +108,14 @@ pub enum CrawlResult<F,E:DirectedEdge,V>{
} }
pub fn crawl_fev<F:Copy,E:Copy+DirectedEdge,V:Copy>(mut fev:FEV<F,E,V>,mesh:&impl MeshQuery<F,E,V>,relative_body:&Body,start_time:Time,time_limit:Time)->CrawlResult<F,E,V>{ pub fn crawl_fev<F:Copy,E:Copy+DirectedEdge,V:Copy>(mut fev:FEV<F,E,V>,mesh:&impl MeshQuery<F,E,V>,relative_body:&Body,start_time:Time,time_limit:Time)->CrawlResult<F,E,V>{
let mut time=start_time; let mut time=start_time;
for _ in 0..10{ for _ in 0..20{
match next_transition(&fev,time,mesh,relative_body,time_limit){ match next_transition(&fev,time,mesh,relative_body,time_limit){
Transition::Miss=>return CrawlResult::Miss(fev), Transition::Miss=>return CrawlResult::Miss(fev),
Transition::Next(next_fev,next_time)=>(fev,time)=(next_fev,next_time), Transition::Next(next_fev,next_time)=>(fev,time)=(next_fev,next_time),
Transition::Hit(face,time)=>return CrawlResult::Hit(face,time), Transition::Hit(face,time)=>return CrawlResult::Hit(face,time),
} }
} }
panic!("Too many iterations!"); //TODO: fix all bugs
println!("Too many iterations! Using default behaviour instead of crashing...");
CrawlResult::Miss(fev)
} }