forked from StrafesNET/strafe-project
rename crawl_fev to crawl
This commit is contained in:
parent
6066e82fd2
commit
08f419f931
@ -111,7 +111,7 @@ impl<F:Copy,M:MeshQuery<Normal=Vector3<F>,Offset=Fixed<4,128>>> FEV<M>
|
||||
}
|
||||
best_transition
|
||||
}
|
||||
pub fn crawl_fev(mut self,mesh:&M,relative_body:&Body,start_time:Time,time_limit:Time)->CrawlResult<M>{
|
||||
pub fn crawl(mut self,mesh:&M,relative_body:&Body,start_time:Time,time_limit:Time)->CrawlResult<M>{
|
||||
let mut body_time={
|
||||
let r=(start_time-relative_body.time).to_ratio();
|
||||
Ratio::new(r.num.fix_4(),r.den.fix_4())
|
||||
|
@ -720,7 +720,7 @@ impl MinkowskiMesh<'_>{
|
||||
infinity_body.acceleration=vec3::ZERO;
|
||||
//crawl in from negative infinity along a tangent line to get the closest fev
|
||||
// TODO: change crawl_fev args to delta time? Optional values?
|
||||
match infinity_fev.crawl_fev(self,&infinity_body,Time::MIN/4,infinity_body.time){
|
||||
match infinity_fev.crawl(self,&infinity_body,Time::MIN/4,infinity_body.time){
|
||||
crate::face_crawler::CrawlResult::Miss(fev)=>Some(fev),
|
||||
crate::face_crawler::CrawlResult::Hit(_,_)=>None,
|
||||
}
|
||||
@ -729,7 +729,7 @@ impl MinkowskiMesh<'_>{
|
||||
pub fn predict_collision_in(&self,relative_body:&Body,time_limit:Time)->Option<(MinkowskiFace,GigaTime)>{
|
||||
self.closest_fev_not_inside(relative_body.clone()).map_or(None,|fev|{
|
||||
//continue forwards along the body parabola
|
||||
match fev.crawl_fev(self,relative_body,relative_body.time,time_limit){
|
||||
match fev.crawl(self,relative_body,relative_body.time,time_limit){
|
||||
crate::face_crawler::CrawlResult::Miss(_)=>None,
|
||||
crate::face_crawler::CrawlResult::Hit(face,time)=>Some((face,time)),
|
||||
}
|
||||
@ -745,7 +745,7 @@ impl MinkowskiMesh<'_>{
|
||||
);
|
||||
self.closest_fev_not_inside(infinity_body).map_or(None,|fev|{
|
||||
//continue backwards along the body parabola
|
||||
match fev.crawl_fev(self,&-relative_body.clone(),-time_limit,-relative_body.time){
|
||||
match fev.crawl(self,&-relative_body.clone(),-time_limit,-relative_body.time){
|
||||
crate::face_crawler::CrawlResult::Miss(_)=>None,
|
||||
crate::face_crawler::CrawlResult::Hit(face,time)=>Some((face,-time)),//no need to test -time<time_limit because of the first step
|
||||
}
|
||||
@ -780,7 +780,7 @@ impl MinkowskiMesh<'_>{
|
||||
}
|
||||
fn infinity_in(&self,infinity_body:Body)->Option<(MinkowskiFace,GigaTime)>{
|
||||
let infinity_fev=self.infinity_fev(-infinity_body.velocity,infinity_body.position);
|
||||
match infinity_fev.crawl_fev(self,&infinity_body,Time::MIN/4,infinity_body.time){
|
||||
match infinity_fev.crawl(self,&infinity_body,Time::MIN/4,infinity_body.time){
|
||||
crate::face_crawler::CrawlResult::Miss(_)=>None,
|
||||
crate::face_crawler::CrawlResult::Hit(face,time)=>Some((face,time)),
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user