Skip to content

Commit

Permalink
fix simulator for unity
Browse files Browse the repository at this point in the history
  • Loading branch information
s5suzuki committed Feb 26, 2024
1 parent 4fd1974 commit d354c0e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions simulator/assets/shaders/pressure.comp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ layout(push_constant) uniform Config {
uint width;
uint height;
float pixel_size;
float scale;
uint _dummy_1;
uint _pad0;
uint _pad1;
mat4 world;
} config;

Expand All @@ -47,7 +47,7 @@ void main() {
vec3 tp = vec3(source_pos.pos[idx]);
float r = length(point - tp);
float p = source_drive.drive[idx].y - source_drive.drive[idx].w * r;
float amp = source_drive.drive[idx].z * source_drive.drive[idx].x / (4 * PI * r) * config.scale;
float amp = source_drive.drive[idx].z * source_drive.drive[idx].x / (4 * PI * r);
re += amp * cos(p);
im += amp * sin(p);
}
Expand Down
2 changes: 1 addition & 1 deletion simulator/src/field_compute_pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ pub struct Config {
pub width: u32,
pub height: u32,
pub pixel_size: f32,
pub scale: f32,
pub _pad0: u32,
pub _pad1: u32,
pub model: [[f32; 4]; 4],
}

Expand Down
3 changes: 1 addition & 2 deletions simulator/src/simulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::{
update_flag::UpdateFlag,
view::*,
viewer_settings::ViewerSettings,
Quaternion, Vector3, MILLIMETER,
Quaternion, Vector3,
};
use autd3_driver::{cpu::TxDatagram, defined::T4010A1_AMPLITUDE};
use autd3_firmware_emulator::{CPUEmulator, FPGAEmulator};
Expand Down Expand Up @@ -565,7 +565,6 @@ impl Simulator {
/ self.settings.slice_pixel_size)
as _,
pixel_size: self.settings.slice_pixel_size as _,
scale: MILLIMETER,
model: slice_model.into(),
..Default::default()
};
Expand Down

0 comments on commit d354c0e

Please sign in to comment.