diff --git a/lib/src/bvh.rs b/lib/src/bvh.rs index d074d49..8e598b0 100644 --- a/lib/src/bvh.rs +++ b/lib/src/bvh.rs @@ -73,6 +73,7 @@ impl Bvh{ } /// Find the exact timestamp on the bot timeline that is closest to the given point. pub fn closest_time_to_point(&self,bot:&CompleteBot,point:glam::Vec3)->Option{ + let point=point+bot.world_offset(); let start_point=vec3::try_from_f32_array(point.to_array()).unwrap(); let output_events=&bot.timelines().output_events; // grow a sphere starting at start_point until we find the closest point on the bot output events diff --git a/lib/src/head.rs b/lib/src/head.rs index 50f8296..39f474d 100644 --- a/lib/src/head.rs +++ b/lib/src/head.rs @@ -121,7 +121,7 @@ impl PlaybackHead{ } pub fn get_position(&self,bot:&CompleteBot,time:SessionTime)->glam::Vec3{ let interp=self.interpolate_output(bot,time); - interp.position() + interp.position()-bot.world_offset() } pub fn get_velocity(&self,bot:&CompleteBot,time:SessionTime)->glam::Vec3{ let interp=self.interpolate_output(bot,time);