Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
c5ec89093d
|
|||
|
1fab9524bd
|
|||
|
77fcb52731
|
|||
|
5902f4fb1b
|
|||
|
1f7dbbfee9
|
|||
|
f496b0ecb0
|
|||
|
d60ba4da04
|
12
src/main.rs
12
src/main.rs
@@ -104,6 +104,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();
|
||||
@@ -252,6 +255,9 @@ fn training() {
|
||||
fn a(a: v0::Vector3) -> [f32; 2] {
|
||||
[a.y, a.x]
|
||||
}
|
||||
fn add<T: core::ops::Add>(lhs: T, rhs: T) -> T::Output {
|
||||
lhs + rhs
|
||||
}
|
||||
|
||||
let mut encoder = device.create_command_encoder(&wgpu::CommandEncoderDescriptor {
|
||||
label: Some("wgpu encoder"),
|
||||
@@ -261,7 +267,7 @@ fn training() {
|
||||
graphics.encode_commands(
|
||||
&mut encoder,
|
||||
&graphics_texture_view,
|
||||
p(output_event.event.position).into(),
|
||||
add(world_offset, p(output_event.event.position).into()),
|
||||
a(output_event.event.angles).into(),
|
||||
);
|
||||
|
||||
@@ -279,7 +285,7 @@ fn training() {
|
||||
offset: 0,
|
||||
// This needs to be a multiple of 256.
|
||||
bytes_per_row: Some(stride_size as u32),
|
||||
rows_per_image: Some(size.y),
|
||||
rows_per_image: None,
|
||||
},
|
||||
},
|
||||
wgpu::Extent3d {
|
||||
@@ -322,7 +328,7 @@ fn training() {
|
||||
&inputs[i * INPUT..(i + 1) * INPUT]
|
||||
.iter()
|
||||
.copied()
|
||||
.map(|f| (f * 255.0) as u8)
|
||||
.map(|f| f as u8)
|
||||
.collect::<Vec<u8>>(),
|
||||
(SIZE_X, SIZE_Y),
|
||||
format!("depth_images/{i}.png").into(),
|
||||
|
||||
Reference in New Issue
Block a user