forked from StrafesNET/roblox-bot-player
factor in world offset
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user