include world offset

This commit is contained in:
2026-03-27 09:24:12 -07:00
parent 293daf3ab2
commit 93c01910cb

View File

@@ -89,6 +89,9 @@ fn training() {
.unwrap();
let timelines =
strafesnet_roblox_bot_file::v0::read_all_to_block(std::io::Cursor::new(bot_file)).unwrap();
let bot = strafesnet_roblox_bot_player::bot::CompleteBot::new(timelines).unwrap();
let world_offset = bot.world_offset();
let timelines = bot.timelines();
// setup graphics
let desc = wgpu::InstanceDescriptor::new_without_display_handle_from_env();
@@ -235,6 +238,9 @@ fn training() {
fn a(a: v0::Vector3) -> [f32; 2] {
[a.y, a.x]
}
fn sub<T: core::ops::Sub>(lhs: T, rhs: T) -> T::Output {
lhs - rhs
}
let mut encoder = device.create_command_encoder(&wgpu::CommandEncoderDescriptor {
label: Some("wgpu encoder"),
@@ -244,7 +250,7 @@ fn training() {
graphics.encode_commands(
&mut encoder,
&graphics_texture_view,
p(output_event.event.position).into(),
sub(p(output_event.event.position).into(), world_offset),
a(output_event.event.angles).into(),
);