factor in world offset

This commit is contained in:
2026-03-13 18:38:24 -07:00
parent ae624f90dc
commit 637fb38131
2 changed files with 2 additions and 1 deletions

View File

@@ -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<PhysicsTime>{
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

View File

@@ -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);