From 9cc11bd1d3b0e143784b8884c2978990b02fe2fe Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Tue, 8 Apr 2025 20:39:53 +0200 Subject: [PATCH] Changing text --- src/main.rs | 77 +++++++++++++++++++++++++++++-------------- src/trap/shapes.rs | 5 +-- src/trap/zmqplugin.rs | 1 + 3 files changed, 56 insertions(+), 27 deletions(-) diff --git a/src/main.rs b/src/main.rs index 83bbfc0..1175dcf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,4 @@ +use bevy::ecs::system::SystemState; use bevy::prelude::*; use bevy::render::view::RenderLayers; use bevy::window::WindowResolution; @@ -5,6 +6,8 @@ use bevy_nannou::prelude::properties::spatial::position; use bevy_nannou::prelude::*; use bevy_nannou::NannouPlugin; use iyes_perf_ui::prelude::*; +use nannou_laser::point::Rgb; +use trap::shapes::PositionAndIntensity; use trap::zmqplugin::ZmqPlugin; // use iyes_perf_ui::PerfUiPlugin; @@ -24,6 +27,7 @@ fn main() { // .add_plugins(bevy::diagnostic::SystemInformationDiagnosticsPlugin) // .add_plugins(PerfUiPlugin) .add_systems(Startup, setup) + .add_systems(Startup, setup_laser) .add_systems(Update, update) @@ -39,7 +43,7 @@ fn main() { } struct LaserModel{ - t: Instant + t: Instant, // register start time, so that animations can be moving } #[derive(Component)] @@ -48,25 +52,12 @@ struct LaserApi{ laser_stream: laser::FrameStream, } +// Because of world.insert_non_send_resource, this is an exclusive system +// see: https://bevy-cheatbook.github.io/programming/exclusive.html +fn setup_laser(mut commands: Commands) { -fn setup(mut commands: Commands) { - // Spawn a camera for our main window - commands.spawn((render::NannouCamera, RenderLayers::none())); - - // let path = "your_future_points_test.json"; - // let file = File::open(path)?; - // let data = fs::read_to_string(path).expect("Unable to read file"); - // let reader = BufReader::new(file); - - - // let res: serde_json::Value = serde_json::from_str(&data).expect("Unable to parse"); - // let res: serde_json::Value = serde_json::from_str(&data).expect("Unable to parse"); - // let max = res[0].iter().cloned().fold(0./0., f64::max); - - // println!("{}",res); - - // let u = serde_json::from_reader(reader)?; - + // laser works on non-exclusive system (like the normal setup()), _but_ world + // is needed in the laser callback // Initialise the state that we want to live on the laser thread and spawn the stream. let laser_model = LaserModel { @@ -84,28 +75,54 @@ fn setup(mut commands: Commands) { laser_stream, }; commands.spawn(api); +} + +fn setup(mut commands: Commands) { + // Spawn a camera for our main window + commands.spawn(render::NannouCamera); + + // let path = "your_future_points_test.json"; + // let file = File::open(path)?; + // let data = fs::read_to_string(path).expect("Unable to read file"); + // let reader = BufReader::new(file); + + + // let res: serde_json::Value = serde_json::from_str(&data).expect("Unable to parse"); + // let res: serde_json::Value = serde_json::from_str(&data).expect("Unable to parse"); + // let max = res[0].iter().cloned().fold(0./0., f64::max); + + // println!("{}",res); + + // let u = serde_json::from_reader(reader)?; + + // create a simple Perf UI with default settings // and all entries provided by the crate: // commands.spawn(PerfUiDefaultEntries::default()); } -fn text2points(position_and_intensity: [f32;3]) -> laser::Point{ + +fn text2points_with_color(position_and_intensity: PositionAndIntensity, color: Rgb) -> laser::Point{ + let used_color = color.map(|v| v * position_and_intensity[2]); + let p = [position_and_intensity[0], -position_and_intensity[1]]; + laser::Point::new(p, color) +} + +fn text2points(position_and_intensity: PositionAndIntensity) -> laser::Point{ let color = match position_and_intensity[2] { 1.0 => [1.0; 3], 0.0 => [0.0; 3], _ => [1.0; 3] // TODO add provided color }; - // let p = &position_and_intensity[0..2]; let p = [position_and_intensity[0], -position_and_intensity[1]]; - return laser::Point::new(p, color) + laser::Point::new(p, color) } -fn laser_frame_producer(_laser: &mut LaserModel, frame: &mut laser::Frame){ +fn laser_frame_producer(model: &mut LaserModel, frame: &mut laser::Frame){ - - let dt = _laser.t.elapsed().as_millis(); + let dt = model.t.elapsed().as_millis(); let use_second = (dt % 1000) > 500; let positions = match use_second { @@ -133,6 +150,7 @@ fn update( mut commands: Commands, keys: Res>, draws: Query<(&Draw, Option<&WindowColor>)>, + lasers: Query<&LaserApi>, mut count: Local, ) { if keys.just_pressed(KeyCode::Space) { @@ -169,5 +187,14 @@ fn update( } draw.ellipse().color(LIGHT_GRAY).w_h(100.0, 100.0); + + for (laser_api) in lasers.iter() { + draw.text("test") + .color(BLACK) + // .glyph_colors(glyph_colors) + .font_size(24); + } } + + } \ No newline at end of file diff --git a/src/trap/shapes.rs b/src/trap/shapes.rs index d680f45..dd8f4a6 100644 --- a/src/trap/shapes.rs +++ b/src/trap/shapes.rs @@ -1,9 +1,10 @@ +pub type PositionAndIntensity = [f32; 3]; // These shapes mostly have been generated from svg strokes using the trap_text repository pub const YOU: [[f32; 2]; 107] = [[0.33800762191421707, 0.5879238779522781], [0.3268223414326286, 0.613215363578254], [0.3226602260682412, 0.6362631583205897], [0.3246304342549215, 0.656942657636883], [0.33184212442653593, 0.6751284478643268], [0.3434052641373563, 0.6906975427013294], [0.3584298209416543, 0.7035253376054891], [0.37602576239370183, 0.7134856097935934], [0.3953022469273653, 0.7204553729640508], [0.41536843297651127, 0.7243100225744593], [0.4353350972158167, 0.7249249540824171], [0.45431139807914817, 0.7221747538251168], [0.4714073031207774, 0.715936435500967], [0.485731970774571, 0.7060837763267552], [0.4963953685948006, 0.6924937900008901], [0.5025074641357381, 0.6750410628605643], [0.5031782249516551, 0.6536017994837813], [0.4979367429667209, 0.6156370609510401], [0.495441415637061, 0.6098526591742117], [0.49274380820609914, 0.6109951371863647], [0.48588165804953437, 0.6284511008083113], [0.47563576635839183, 0.6567800244354363], [0.4483724543049251, 0.7310726509211836], [0.4321592996253773, 0.7735563269170086], [0.41319918117015, 0.8153910883478571], [0.39072262543389086, 0.8534197473926095], [0.3639585406704372, 0.8844899709525775], [0.34872846728321644, 0.8964325881334402], [0.3321382624948419, 0.9054461894474517], [0.3140916409770938, 0.9111504883041646], [0.2944915082813474, 0.913132833296923], [0.2750572452686684, 0.9099529901044575], [0.2660768178912704, 0.9053814598150352], [0.25953427029476256, 0.8983016562694696], [0.2557823789758154, 0.8880420095314384], [0.25624276848637845, 0.8783568382811047], [0.26040892945279187, 0.8692380513144162], [0.26777516162180093, 0.8606856486313729], [0.2900842294341821, 0.8452880873202742], [0.31912275165667403, 0.8321479719397045], [0.3811944235421673, 0.812583440541787], [0.42160998778228187, 0.8019070967950742], [0.49081243779886885, 0.7746211293702616], [0.5572031944073599, 0.7415256774360592], [0.6047414455745159, 0.7169089982280263], [0.6265949785987653, 0.7023529221383434], [0.6461862109700545, 0.6832625352978777], [0.6747886172941396, 0.6504235745321262], [0.6790462088663415, 0.6442863962586273], [0.6805236627262503, 0.6418986819428599], [0.6800851194666279, 0.6419496565283881], [0.6619365487778236, 0.6567581781844957], [0.6446132809023312, 0.6681611120550849], [0.6283426786740135, 0.6820836468674905], [0.6133472502043029, 0.704449353108236], [0.6046807615441253, 0.7304221181153968], [0.6058523678908658, 0.7516235000930489], [0.6150544942592907, 0.7681109465899622], [0.6304771383029509, 0.7799386686732853], [0.650313534157018, 0.7871633047713831], [0.6727552977158532, 0.7898414933126199], [0.6959940448738178, 0.7880282544845498], [0.7182205824048677, 0.7817794175951324], [0.7281687177868938, 0.7736663672921168], [0.736318987628549, 0.7592688788018546], [0.7423380343228877, 0.7406186534618217], [0.7458933093833694, 0.719746583489089], [0.746652264323454, 0.6986835611007274], [0.7442799232953856, 0.6794612876342129], [0.7384453560534343, 0.664109846186211], [0.7288135867498442, 0.6546609380941979], [0.7050189738735022, 0.6490747708166453], [0.6933522667508152, 0.6453706176016053], [0.6853816216391161, 0.6377122929663164], [0.6858387746680583, 0.6366288807437436], [0.6884870257543025, 0.6371839373417159], [0.6949154873736761, 0.6398305701871495], [0.724901489590666, 0.6511493555355974], [0.7563560453431076, 0.6588983016562695], [0.8062269906384769, 0.6641600116513339], [0.8559361118528048, 0.6620765266079246], [0.8748695293346603, 0.6517707600067966], [0.8919500610885905, 0.6430087951388046], [0.8884870257543025, 0.6461789288864077], [0.8834785704460681, 0.6483052973112929], [0.8578132711928863, 0.6987588092984117], [0.8479743670655632, 0.7289422368942723], [0.8479500934534069, 0.7415418598441635], [0.8527562686603394, 0.7510595431706193], [0.8640677719251402, 0.7602398232881035], [0.875913294657378, 0.7659926693691288], [0.8881067391638551, 0.7686069373983543], [0.9004862813635298, 0.7683706742400337], [0.9250997240899419, 0.7605044056606064], [0.9483538445356053, 0.7447006659060936], [0.9688650468076154, 0.7232703028537677], [0.9852335526049633, 0.6985209278992808], [0.9960757660347437, 0.6727633889199052], [1.0, 0.6483052973112929], [0.9940691474298291, 0.6771059381346539], [0.9864795980289828, 0.7059518897007064], [0.9756373845992022, 0.7351692275327492], [0.969253424602115, 0.7562063580681442], [0.9650459984950361, 0.7754237768122275], [0.9650459984950361, 0.7754237768122275], [0.9650459984950361, 0.7754237768122275], [0.9650459984950361, 0.7754237768122275]]; -pub const YOUR_FUTURE: &'static [[f32; 3]] = &[[0.038513974429595775, 0.07736873483541283, 1.0], [0.0382757222679613, 0.1025670238237002, 1.0], [0.0541576489756651, 0.11774344049982961, 1.0], [0.07378058203832892, 0.10288416259806232, 1.0], [0.08722525924196169, 0.0814108126125096, 1.0], [0.09160263301646454, 0.08329815714053822, 1.0], [0.09534264273910519, 0.10840890101548864, 1.0], [0.09916028362894076, 0.13352390177514933, 1.0], [0.10232188216400727, 0.15872672729061565, 1.0], [0.10311951375159167, 0.18408246402623243, 1.0], [0.09840396204269339, 0.20891794923219542, 1.0], [0.08291530920434609, 0.22859913801644804, 1.0], [0.05919014784073643, 0.23216553617443603, 1.0], [0.04902797432052862, 0.21056988740659402, 1.0], [0.0542513157559533, 0.18586563467105832, 1.0], [0.0542513157559533, 0.18586563467105832, 0.0], [0.14461260563490763, 0.07955838236847201, 0.0], [0.14461260563490763, 0.07955838236847201, 1.0], [0.13558063166458387, 0.10103799255000086, 1.0], [0.15322441358055564, 0.11390007560940833, 1.0], [0.1735166365166195, 0.10116155041151406, 1.0], [0.17258100810588609, 0.07966943709972815, 1.0], [0.14961116043044345, 0.08026824305685826, 1.0], [0.14417649530494814, 0.10052196882994967, 1.0], [0.14417649530494814, 0.10052196882994967, 0.0], [0.21234130983179852, 0.07853085592549228, 0.0], [0.21234130983179852, 0.07853085592549228, 1.0], [0.21195135170310608, 0.09939847235719804, 1.0], [0.22573458952023626, 0.11739829833366248, 1.0], [0.24458035764122837, 0.1052878540835099, 1.0], [0.2538725565579727, 0.08313976080541961, 1.0], [0.255807813667129, 0.08850444116299301, 1.0], [0.26244752230288027, 0.11156142530321671, 1.0], [0.278628608562111, 0.11468355008686479, 1.0], [0.28547019597542156, 0.09159341243420857, 1.0], [0.2918362984056859, 0.06838022001936472, 1.0], [0.3005008421006701, 0.07935931502673148, 1.0], [0.30156825900234596, 0.10346905081241903, 1.0], [0.31102190009060793, 0.12433665737167442, 1.0], [0.33339185770206586, 0.11848359229504231, 1.0], [0.3513812674003706, 0.102558533670551, 1.0], [0.3513812674003706, 0.102558533670551, 0.0], [0.42686993143914653, 0.09185645985150065, 0.0], [0.42686993143914653, 0.09185645985150065, 1.0], [0.4412682414620315, 0.07286865615390165, 1.0], [0.45084183686010293, 0.05100171349006759, 1.0], [0.45347869677603575, 0.027341959266008523, 1.0], [0.4435151972236728, 0.00792103659488272, 1.0], [0.4345739206406735, 0.028355940891981273, 1.0], [0.4337797821877698, 0.052244466545959004, 1.0], [0.43513696480231173, 0.07614300509684381, 1.0], [0.43637325350823714, 0.10004361849723883, 1.0], [0.43591794294213454, 0.12396712012975415, 1.0], [0.4343358771636571, 0.14784577117143877, 1.0], [0.43004483999604426, 0.17138258277291252, 1.0], [0.42349546870936716, 0.19435274324567994, 1.0], [0.41636670815063503, 0.18274106404797463, 1.0], [0.41650904831900143, 0.1588259983867111, 1.0], [0.4188002169013092, 0.13505679100517512, 1.0], [0.4268723820603772, 0.11303119410963162, 1.0], [0.4500128242886166, 0.11386831079745637, 1.0], [0.47283807893581375, 0.10841107232468714, 1.0], [0.4872864841393783, 0.08990220621766647, 1.0], [0.48035728645082926, 0.08551550932203601, 1.0], [0.4834331213821757, 0.10892934066665313, 1.0], [0.5026251362218042, 0.11943702192634674, 1.0], [0.5195900915871043, 0.10344307624078676, 1.0], [0.5272883245930242, 0.08113828193061089, 1.0], [0.5267576251141751, 0.10047409952707571, 1.0], [0.5379009893510314, 0.12115852863792714, 1.0], [0.5599032847972661, 0.12145455136649168, 1.0], [0.5744503750287453, 0.10270148231874575, 1.0], [0.5840774712539069, 0.0808410245684861, 1.0], [0.5905433375024336, 0.05786040975866798, 1.0], [0.5934077572159745, 0.03411118608853734, 1.0], [0.5906347675237177, 0.04280542709179432, 1.0], [0.5882110565514761, 0.06662131767684432, 1.0], [0.5876546124770476, 0.09050869359531578, 1.0], [0.5927221122806438, 0.11371001041100556, 1.0], [0.6103545876688272, 0.12783118163410698, 1.0], [0.631373581233142, 0.11875861351991082, 1.0], [0.6428130770693629, 0.0980459105567277, 1.0], [0.6428130770693629, 0.0980459105567277, 0.0], [0.5915479833072788, 0.06721538442214654, 0.0], [0.5915479833072788, 0.06721538442214654, 1.0], [0.6125483814164788, 0.07773324751217321, 1.0], [0.6367947348281895, 0.07962813582103823, 1.0], [0.6440797272649885, 0.07979848741266705, 1.0], [0.6475016404268139, 0.10397501517479255, 1.0], [0.6626330560622519, 0.12190053501513858, 1.0], [0.6805257555025275, 0.107866704576016, 1.0], [0.6893844833457623, 0.08509819459432841, 1.0], [0.6898412200281951, 0.08179501862114127, 1.0], [0.6945160532454058, 0.10575378282261425, 1.0], [0.7111356017515474, 0.12205861820747824, 1.0], [0.7285494206041053, 0.10765446933485708, 1.0], [0.7358597194485729, 0.0843550868151773, 1.0], [0.7361559672985614, 0.08829286880876025, 1.0], [0.7390423305209906, 0.1126434479700143, 1.0], [0.7418058940557418, 0.12129911707099901, 1.0], [0.7436522097068493, 0.09687779686227331, 1.0], [0.7541835238456593, 0.07548783311279784, 1.0], [0.7768954753006071, 0.08156569310321993, 1.0], [0.7984424236797361, 0.09318965596188536, 1.0], [0.8216202473510118, 0.0935224312636923, 1.0], [0.8013323408542665, 0.08915080376332754, 1.0], [0.7884844494912847, 0.10852374739445168, 1.0], [0.800525183632502, 0.1282264852718212, 1.0], [0.8242488641121982, 0.13377113743721275, 1.0], [0.8487698023243145, 0.13342856150487792, 1.0], [0.8731271139483364, 0.13057866700963636, 1.0], [0.8731271139483364, 0.13057866700963636, 0.0], [0.9999714604629248, 0.09321081689567305, 0.0], [0.9999714604629248, 0.09321081689567305, 1.0], [1.0, 0.09297872770874008, 1.0], [0.9999064410407551, 0.09275721141104158, 1.0]]; +pub const YOUR_FUTURE: &'static [PositionAndIntensity] = &[[0.038513974429595775, 0.07736873483541283, 1.0], [0.0382757222679613, 0.1025670238237002, 1.0], [0.0541576489756651, 0.11774344049982961, 1.0], [0.07378058203832892, 0.10288416259806232, 1.0], [0.08722525924196169, 0.0814108126125096, 1.0], [0.09160263301646454, 0.08329815714053822, 1.0], [0.09534264273910519, 0.10840890101548864, 1.0], [0.09916028362894076, 0.13352390177514933, 1.0], [0.10232188216400727, 0.15872672729061565, 1.0], [0.10311951375159167, 0.18408246402623243, 1.0], [0.09840396204269339, 0.20891794923219542, 1.0], [0.08291530920434609, 0.22859913801644804, 1.0], [0.05919014784073643, 0.23216553617443603, 1.0], [0.04902797432052862, 0.21056988740659402, 1.0], [0.0542513157559533, 0.18586563467105832, 1.0], [0.0542513157559533, 0.18586563467105832, 0.0], [0.14461260563490763, 0.07955838236847201, 0.0], [0.14461260563490763, 0.07955838236847201, 1.0], [0.13558063166458387, 0.10103799255000086, 1.0], [0.15322441358055564, 0.11390007560940833, 1.0], [0.1735166365166195, 0.10116155041151406, 1.0], [0.17258100810588609, 0.07966943709972815, 1.0], [0.14961116043044345, 0.08026824305685826, 1.0], [0.14417649530494814, 0.10052196882994967, 1.0], [0.14417649530494814, 0.10052196882994967, 0.0], [0.21234130983179852, 0.07853085592549228, 0.0], [0.21234130983179852, 0.07853085592549228, 1.0], [0.21195135170310608, 0.09939847235719804, 1.0], [0.22573458952023626, 0.11739829833366248, 1.0], [0.24458035764122837, 0.1052878540835099, 1.0], [0.2538725565579727, 0.08313976080541961, 1.0], [0.255807813667129, 0.08850444116299301, 1.0], [0.26244752230288027, 0.11156142530321671, 1.0], [0.278628608562111, 0.11468355008686479, 1.0], [0.28547019597542156, 0.09159341243420857, 1.0], [0.2918362984056859, 0.06838022001936472, 1.0], [0.3005008421006701, 0.07935931502673148, 1.0], [0.30156825900234596, 0.10346905081241903, 1.0], [0.31102190009060793, 0.12433665737167442, 1.0], [0.33339185770206586, 0.11848359229504231, 1.0], [0.3513812674003706, 0.102558533670551, 1.0], [0.3513812674003706, 0.102558533670551, 0.0], [0.42686993143914653, 0.09185645985150065, 0.0], [0.42686993143914653, 0.09185645985150065, 1.0], [0.4412682414620315, 0.07286865615390165, 1.0], [0.45084183686010293, 0.05100171349006759, 1.0], [0.45347869677603575, 0.027341959266008523, 1.0], [0.4435151972236728, 0.00792103659488272, 1.0], [0.4345739206406735, 0.028355940891981273, 1.0], [0.4337797821877698, 0.052244466545959004, 1.0], [0.43513696480231173, 0.07614300509684381, 1.0], [0.43637325350823714, 0.10004361849723883, 1.0], [0.43591794294213454, 0.12396712012975415, 1.0], [0.4343358771636571, 0.14784577117143877, 1.0], [0.43004483999604426, 0.17138258277291252, 1.0], [0.42349546870936716, 0.19435274324567994, 1.0], [0.41636670815063503, 0.18274106404797463, 1.0], [0.41650904831900143, 0.1588259983867111, 1.0], [0.4188002169013092, 0.13505679100517512, 1.0], [0.4268723820603772, 0.11303119410963162, 1.0], [0.4500128242886166, 0.11386831079745637, 1.0], [0.47283807893581375, 0.10841107232468714, 1.0], [0.4872864841393783, 0.08990220621766647, 1.0], [0.48035728645082926, 0.08551550932203601, 1.0], [0.4834331213821757, 0.10892934066665313, 1.0], [0.5026251362218042, 0.11943702192634674, 1.0], [0.5195900915871043, 0.10344307624078676, 1.0], [0.5272883245930242, 0.08113828193061089, 1.0], [0.5267576251141751, 0.10047409952707571, 1.0], [0.5379009893510314, 0.12115852863792714, 1.0], [0.5599032847972661, 0.12145455136649168, 1.0], [0.5744503750287453, 0.10270148231874575, 1.0], [0.5840774712539069, 0.0808410245684861, 1.0], [0.5905433375024336, 0.05786040975866798, 1.0], [0.5934077572159745, 0.03411118608853734, 1.0], [0.5906347675237177, 0.04280542709179432, 1.0], [0.5882110565514761, 0.06662131767684432, 1.0], [0.5876546124770476, 0.09050869359531578, 1.0], [0.5927221122806438, 0.11371001041100556, 1.0], [0.6103545876688272, 0.12783118163410698, 1.0], [0.631373581233142, 0.11875861351991082, 1.0], [0.6428130770693629, 0.0980459105567277, 1.0], [0.6428130770693629, 0.0980459105567277, 0.0], [0.5915479833072788, 0.06721538442214654, 0.0], [0.5915479833072788, 0.06721538442214654, 1.0], [0.6125483814164788, 0.07773324751217321, 1.0], [0.6367947348281895, 0.07962813582103823, 1.0], [0.6440797272649885, 0.07979848741266705, 1.0], [0.6475016404268139, 0.10397501517479255, 1.0], [0.6626330560622519, 0.12190053501513858, 1.0], [0.6805257555025275, 0.107866704576016, 1.0], [0.6893844833457623, 0.08509819459432841, 1.0], [0.6898412200281951, 0.08179501862114127, 1.0], [0.6945160532454058, 0.10575378282261425, 1.0], [0.7111356017515474, 0.12205861820747824, 1.0], [0.7285494206041053, 0.10765446933485708, 1.0], [0.7358597194485729, 0.0843550868151773, 1.0], [0.7361559672985614, 0.08829286880876025, 1.0], [0.7390423305209906, 0.1126434479700143, 1.0], [0.7418058940557418, 0.12129911707099901, 1.0], [0.7436522097068493, 0.09687779686227331, 1.0], [0.7541835238456593, 0.07548783311279784, 1.0], [0.7768954753006071, 0.08156569310321993, 1.0], [0.7984424236797361, 0.09318965596188536, 1.0], [0.8216202473510118, 0.0935224312636923, 1.0], [0.8013323408542665, 0.08915080376332754, 1.0], [0.7884844494912847, 0.10852374739445168, 1.0], [0.800525183632502, 0.1282264852718212, 1.0], [0.8242488641121982, 0.13377113743721275, 1.0], [0.8487698023243145, 0.13342856150487792, 1.0], [0.8731271139483364, 0.13057866700963636, 1.0], [0.8731271139483364, 0.13057866700963636, 0.0], [0.9999714604629248, 0.09321081689567305, 0.0], [0.9999714604629248, 0.09321081689567305, 1.0], [1.0, 0.09297872770874008, 1.0], [0.9999064410407551, 0.09275721141104158, 1.0]]; -pub const ARE_YOU_SURE: &'static [[f32; 3]] = &[[0.08906264164022216, 0.06204500097826589, 1.0], [0.06690320179778532, 0.0612672768120189, 1.0], [0.04828405067825926, 0.07406728672334446, 1.0], [0.036117463574618425, 0.09311647897667968, 1.0], [0.0353817675377397, 0.1149635912920329, 1.0], [0.05558661762165026, 0.11607743938270766, 1.0], [0.07148607461339127, 0.09995359573873826, 1.0], [0.08226686165906576, 0.07986483328927924, 1.0], [0.08887018844711969, 0.06460760054026982, 1.0], [0.08767455968740395, 0.08734848129089828, 1.0], [0.09240808737815621, 0.10937959871051184, 1.0], [0.11164960547133204, 0.11746264713900893, 1.0], [0.12912418276564716, 0.10332294392819107, 1.0], [0.14181669028673535, 0.0844033441140848, 1.0], [0.14948793099772756, 0.08205624250336052, 1.0], [0.14733088160414062, 0.10477325080239089, 1.0], [0.1462858700202529, 0.10101596457459282, 1.0], [0.1498304396700656, 0.07851531463509136, 1.0], [0.15662170856438107, 0.07474594901380517, 1.0], [0.17352865014782193, 0.08913862210692113, 1.0], [0.19529195510748565, 0.08492022079501965, 1.0], [0.21272552656308158, 0.07055579848162823, 1.0], [0.21042456142221266, 0.05285434101915813, 1.0], [0.1918629596711873, 0.06506411008811704, 1.0], [0.1810448117115, 0.08489507590160456, 1.0], [0.1850532723947774, 0.10630608000880498, 1.0], [0.20573847814236873, 0.11435646854917565, 1.0], [0.22845675343141963, 0.11348744914531479, 1.0], [0.25069486949590897, 0.10863510282132295, 1.0], [0.25069486949590897, 0.10863510282132295, 0.0], [0.35414934129278836, 0.061917352121668205, 0.0], [0.35414934129278836, 0.061917352121668205, 1.0], [0.3617630052924724, 0.08099004309522427, 1.0], [0.3802767768977713, 0.0886883472168159, 1.0], [0.39884282929249515, 0.07562544304983154, 1.0], [0.4126825374726493, 0.05741349654195264, 1.0], [0.4142338457602859, 0.06737252809132337, 1.0], [0.41562815143523135, 0.09026390123208418, 1.0], [0.4169303381921167, 0.11316024144293965, 1.0], [0.4169613299400061, 0.13608035334651833, 1.0], [0.41466367496088363, 0.15885289124768656, 1.0], [0.40789537115450786, 0.18068954117654304, 1.0], [0.39448199868211026, 0.19894885667860107, 1.0], [0.3734581814220556, 0.20357456780548847, 1.0], [0.3590125321191797, 0.18716098226616412, 1.0], [0.36004171252712547, 0.1644362725101903, 1.0], [0.36004171252712547, 0.1644362725101903, 0.0], [0.4777155101574179, 0.07234122433912318, 0.0], [0.4777155101574179, 0.07234122433912318, 1.0], [0.4650577218840979, 0.05597818808771205, 1.0], [0.4434251058079497, 0.06035378157371264, 1.0], [0.4275432389874367, 0.0763533387443141, 1.0], [0.4233746794436712, 0.09815963532977597, 1.0], [0.4399487926105944, 0.1100217388299497, 1.0], [0.4583035013763461, 0.09748453106479228, 1.0], [0.4654421231482704, 0.07609529749887255, 1.0], [0.467523736357645, 0.07177962124237698, 1.0], [0.4860691168908355, 0.08408159750444016, 1.0], [0.5060681157487656, 0.0759808352260334, 1.0], [0.5083719277690926, 0.07350738998856214, 1.0], [0.508666888357367, 0.09614979803299603, 1.0], [0.5254101692136219, 0.10132549931429885, 1.0], [0.5360677861493234, 0.0812452290645506, 1.0], [0.5404641768990021, 0.06437047360481414, 1.0], [0.5412134453767743, 0.08716236023512645, 1.0], [0.5515988472931259, 0.10670836471840747, 1.0], [0.5734333313591707, 0.10737628754408744, 1.0], [0.5929237367985304, 0.09559447605258643, 1.0], [0.5929237367985304, 0.09559447605258643, 0.0], [0.6875481023944751, 0.057297510092875786, 0.0], [0.6875481023944751, 0.057297510092875786, 1.0], [0.6652587073495958, 0.05355667498504547, 1.0], [0.643752516159224, 0.06771023378210216, 1.0], [0.6570440518736288, 0.08303967985539576, 1.0], [0.680983369306763, 0.09261777428860629, 1.0], [0.6734204752448539, 0.10841376810679369, 1.0], [0.6492539379423148, 0.10592750969413008, 1.0], [0.6492539379423148, 0.10592750969413008, 0.0], [0.7118872438126562, 0.0631537954418461, 0.0], [0.7118872438126562, 0.0631537954418461, 1.0], [0.7062633620860532, 0.08462279811327705, 1.0], [0.7097003500184106, 0.1068774817461435, 1.0], [0.7270704457573437, 0.09937297796879514, 1.0], [0.7373464086633522, 0.07861813235667603, 1.0], [0.7414695685905711, 0.0682455997882286, 1.0], [0.7410765170671745, 0.09141077319758564, 1.0], [0.7510092844052073, 0.11067779937406756, 1.0], [0.7690279107317524, 0.09946129984538463, 1.0], [0.7790213443326467, 0.07855530081618049, 1.0], [0.7813128989756379, 0.070260693625754, 1.0], [0.7837884278637424, 0.09332322141859425, 1.0], [0.7850457962129945, 0.10066591188893646, 1.0], [0.7866834243158197, 0.07758173753171757, 1.0], [0.7971344465377097, 0.07428718577655165, 1.0], [0.816702280784313, 0.08566979460533024, 1.0], [0.8392933409694656, 0.0818713940124928, 1.0], [0.8564301571713081, 0.0670998914432246, 1.0], [0.842236636845677, 0.057607642835366686, 1.0], [0.8249078118769327, 0.07235718596777736, 1.0], [0.8213753935158387, 0.09409080220209436, 1.0], [0.839128246226824, 0.10814283692695181, 1.0], [0.8618255023673255, 0.11274995480787395, 1.0], [0.8618255023673255, 0.11274995480787395, 0.0], [0.9432273788506644, 0.016562323564328855, 0.0], [0.9432273788506644, 0.016562323564328855, 1.0], [0.9635036062098021, 0.006971062113918285, 1.0], [0.986487695904064, 0.01164653913654565, 1.0], [0.9875335095060781, 0.03251558311198372, 1.0], [0.9729663290762949, 0.05142637834710153, 1.0], [0.9612971585747931, 0.07195260117362987, 1.0], [0.9762469120562658, 0.08642669518768585, 1.0], [1.0, 0.08457487527501524, 1.0], [1.0, 0.08457487527501524, 0.0], [0.967049549713328, 0.12727955647174025, 0.0], [0.967049549713328, 0.12727955647174025, 1.0], [0.966894149383669, 0.1273079398905109, 1.0], [0.9676673242620102, 0.12803498506638827, 1.0]]; +pub const ARE_YOU_SURE: &'static [PositionAndIntensity] = &[[0.08906264164022216, 0.06204500097826589, 1.0], [0.06690320179778532, 0.0612672768120189, 1.0], [0.04828405067825926, 0.07406728672334446, 1.0], [0.036117463574618425, 0.09311647897667968, 1.0], [0.0353817675377397, 0.1149635912920329, 1.0], [0.05558661762165026, 0.11607743938270766, 1.0], [0.07148607461339127, 0.09995359573873826, 1.0], [0.08226686165906576, 0.07986483328927924, 1.0], [0.08887018844711969, 0.06460760054026982, 1.0], [0.08767455968740395, 0.08734848129089828, 1.0], [0.09240808737815621, 0.10937959871051184, 1.0], [0.11164960547133204, 0.11746264713900893, 1.0], [0.12912418276564716, 0.10332294392819107, 1.0], [0.14181669028673535, 0.0844033441140848, 1.0], [0.14948793099772756, 0.08205624250336052, 1.0], [0.14733088160414062, 0.10477325080239089, 1.0], [0.1462858700202529, 0.10101596457459282, 1.0], [0.1498304396700656, 0.07851531463509136, 1.0], [0.15662170856438107, 0.07474594901380517, 1.0], [0.17352865014782193, 0.08913862210692113, 1.0], [0.19529195510748565, 0.08492022079501965, 1.0], [0.21272552656308158, 0.07055579848162823, 1.0], [0.21042456142221266, 0.05285434101915813, 1.0], [0.1918629596711873, 0.06506411008811704, 1.0], [0.1810448117115, 0.08489507590160456, 1.0], [0.1850532723947774, 0.10630608000880498, 1.0], [0.20573847814236873, 0.11435646854917565, 1.0], [0.22845675343141963, 0.11348744914531479, 1.0], [0.25069486949590897, 0.10863510282132295, 1.0], [0.25069486949590897, 0.10863510282132295, 0.0], [0.35414934129278836, 0.061917352121668205, 0.0], [0.35414934129278836, 0.061917352121668205, 1.0], [0.3617630052924724, 0.08099004309522427, 1.0], [0.3802767768977713, 0.0886883472168159, 1.0], [0.39884282929249515, 0.07562544304983154, 1.0], [0.4126825374726493, 0.05741349654195264, 1.0], [0.4142338457602859, 0.06737252809132337, 1.0], [0.41562815143523135, 0.09026390123208418, 1.0], [0.4169303381921167, 0.11316024144293965, 1.0], [0.4169613299400061, 0.13608035334651833, 1.0], [0.41466367496088363, 0.15885289124768656, 1.0], [0.40789537115450786, 0.18068954117654304, 1.0], [0.39448199868211026, 0.19894885667860107, 1.0], [0.3734581814220556, 0.20357456780548847, 1.0], [0.3590125321191797, 0.18716098226616412, 1.0], [0.36004171252712547, 0.1644362725101903, 1.0], [0.36004171252712547, 0.1644362725101903, 0.0], [0.4777155101574179, 0.07234122433912318, 0.0], [0.4777155101574179, 0.07234122433912318, 1.0], [0.4650577218840979, 0.05597818808771205, 1.0], [0.4434251058079497, 0.06035378157371264, 1.0], [0.4275432389874367, 0.0763533387443141, 1.0], [0.4233746794436712, 0.09815963532977597, 1.0], [0.4399487926105944, 0.1100217388299497, 1.0], [0.4583035013763461, 0.09748453106479228, 1.0], [0.4654421231482704, 0.07609529749887255, 1.0], [0.467523736357645, 0.07177962124237698, 1.0], [0.4860691168908355, 0.08408159750444016, 1.0], [0.5060681157487656, 0.0759808352260334, 1.0], [0.5083719277690926, 0.07350738998856214, 1.0], [0.508666888357367, 0.09614979803299603, 1.0], [0.5254101692136219, 0.10132549931429885, 1.0], [0.5360677861493234, 0.0812452290645506, 1.0], [0.5404641768990021, 0.06437047360481414, 1.0], [0.5412134453767743, 0.08716236023512645, 1.0], [0.5515988472931259, 0.10670836471840747, 1.0], [0.5734333313591707, 0.10737628754408744, 1.0], [0.5929237367985304, 0.09559447605258643, 1.0], [0.5929237367985304, 0.09559447605258643, 0.0], [0.6875481023944751, 0.057297510092875786, 0.0], [0.6875481023944751, 0.057297510092875786, 1.0], [0.6652587073495958, 0.05355667498504547, 1.0], [0.643752516159224, 0.06771023378210216, 1.0], [0.6570440518736288, 0.08303967985539576, 1.0], [0.680983369306763, 0.09261777428860629, 1.0], [0.6734204752448539, 0.10841376810679369, 1.0], [0.6492539379423148, 0.10592750969413008, 1.0], [0.6492539379423148, 0.10592750969413008, 0.0], [0.7118872438126562, 0.0631537954418461, 0.0], [0.7118872438126562, 0.0631537954418461, 1.0], [0.7062633620860532, 0.08462279811327705, 1.0], [0.7097003500184106, 0.1068774817461435, 1.0], [0.7270704457573437, 0.09937297796879514, 1.0], [0.7373464086633522, 0.07861813235667603, 1.0], [0.7414695685905711, 0.0682455997882286, 1.0], [0.7410765170671745, 0.09141077319758564, 1.0], [0.7510092844052073, 0.11067779937406756, 1.0], [0.7690279107317524, 0.09946129984538463, 1.0], [0.7790213443326467, 0.07855530081618049, 1.0], [0.7813128989756379, 0.070260693625754, 1.0], [0.7837884278637424, 0.09332322141859425, 1.0], [0.7850457962129945, 0.10066591188893646, 1.0], [0.7866834243158197, 0.07758173753171757, 1.0], [0.7971344465377097, 0.07428718577655165, 1.0], [0.816702280784313, 0.08566979460533024, 1.0], [0.8392933409694656, 0.0818713940124928, 1.0], [0.8564301571713081, 0.0670998914432246, 1.0], [0.842236636845677, 0.057607642835366686, 1.0], [0.8249078118769327, 0.07235718596777736, 1.0], [0.8213753935158387, 0.09409080220209436, 1.0], [0.839128246226824, 0.10814283692695181, 1.0], [0.8618255023673255, 0.11274995480787395, 1.0], [0.8618255023673255, 0.11274995480787395, 0.0], [0.9432273788506644, 0.016562323564328855, 0.0], [0.9432273788506644, 0.016562323564328855, 1.0], [0.9635036062098021, 0.006971062113918285, 1.0], [0.986487695904064, 0.01164653913654565, 1.0], [0.9875335095060781, 0.03251558311198372, 1.0], [0.9729663290762949, 0.05142637834710153, 1.0], [0.9612971585747931, 0.07195260117362987, 1.0], [0.9762469120562658, 0.08642669518768585, 1.0], [1.0, 0.08457487527501524, 1.0], [1.0, 0.08457487527501524, 0.0], [0.967049549713328, 0.12727955647174025, 0.0], [0.967049549713328, 0.12727955647174025, 1.0], [0.966894149383669, 0.1273079398905109, 1.0], [0.9676673242620102, 0.12803498506638827, 1.0]]; // pub const ARE_YOU_SURE: [[f32; 3]; 117] = [[0.08906264164022216, 0.06204500097826589, 1.0], [0.06690320179778532, 0.0612672768120189, 1.0], [0.04828405067825926, 0.07406728672334446, 1.0], [0.036117463574618425, 0.09311647897667968, 1.0], [0.0353817675377397, 0.1149635912920329, 1.0], [0.05558661762165026, 0.11607743938270766, 1.0], [0.07148607461339127, 0.09995359573873826, 1.0], [0.08226686165906576, 0.07986483328927924, 1.0], [0.08887018844711969, 0.06460760054026982, 1.0], [0.08767455968740395, 0.08734848129089828, 1.0], [0.09240808737815621, 0.10937959871051184, 1.0], [0.11164960547133204, 0.11746264713900893, 1.0], [0.12912418276564716, 0.10332294392819107, 1.0], [0.14181669028673535, 0.0844033441140848, 1.0], [0.14948793099772756, 0.08205624250336052, 1.0], [0.14733088160414062, 0.10477325080239089, 1.0], [0.1462858700202529, 0.10101596457459282, 1.0], [0.1498304396700656, 0.07851531463509136, 1.0], [0.15662170856438107, 0.07474594901380517, 1.0], [0.17352865014782193, 0.08913862210692113, 1.0], [0.19529195510748565, 0.08492022079501965, 1.0], [0.21272552656308158, 0.07055579848162823, 1.0], [0.21042456142221266, 0.05285434101915813, 1.0], [0.1918629596711873, 0.06506411008811704, 1.0], [0.1810448117115, 0.08489507590160456, 1.0], [0.1850532723947774, 0.10630608000880498, 1.0], [0.20573847814236873, 0.11435646854917565, 1.0], [0.22845675343141963, 0.11348744914531479, 1.0], [0.25069486949590897, 0.10863510282132295, 1.0], [0.25069486949590897, 0.10863510282132295, 0.0], [0.35414934129278836, 0.061917352121668205, 0.0], [0.35414934129278836, 0.061917352121668205, 1.0], [0.3617630052924724, 0.08099004309522427, 1.0], [0.3802767768977713, 0.0886883472168159, 1.0], [0.39884282929249515, 0.07562544304983154, 1.0], [0.4126825374726493, 0.05741349654195264, 1.0], [0.4142338457602859, 0.06737252809132337, 1.0], [0.41562815143523135, 0.09026390123208418, 1.0], [0.4169303381921167, 0.11316024144293965, 1.0], [0.4169613299400061, 0.13608035334651833, 1.0], [0.41466367496088363, 0.15885289124768656, 1.0], [0.40789537115450786, 0.18068954117654304, 1.0], [0.39448199868211026, 0.19894885667860107, 1.0], [0.3734581814220556, 0.20357456780548847, 1.0], [0.3590125321191797, 0.18716098226616412, 1.0], [0.36004171252712547, 0.1644362725101903, 1.0], [0.36004171252712547, 0.1644362725101903, 0.0], [0.4777155101574179, 0.07234122433912318, 0.0], [0.4777155101574179, 0.07234122433912318, 1.0], [0.4650577218840979, 0.05597818808771205, 1.0], [0.4434251058079497, 0.06035378157371264, 1.0], [0.4275432389874367, 0.0763533387443141, 1.0], [0.4233746794436712, 0.09815963532977597, 1.0], [0.4399487926105944, 0.1100217388299497, 1.0], [0.4583035013763461, 0.09748453106479228, 1.0], [0.4654421231482704, 0.07609529749887255, 1.0], [0.467523736357645, 0.07177962124237698, 1.0], [0.4860691168908355, 0.08408159750444016, 1.0], [0.5060681157487656, 0.0759808352260334, 1.0], [0.5083719277690926, 0.07350738998856214, 1.0], [0.508666888357367, 0.09614979803299603, 1.0], [0.5254101692136219, 0.10132549931429885, 1.0], [0.5360677861493234, 0.0812452290645506, 1.0], [0.5404641768990021, 0.06437047360481414, 1.0], [0.5412134453767743, 0.08716236023512645, 1.0], [0.5515988472931259, 0.10670836471840747, 1.0], [0.5734333313591707, 0.10737628754408744, 1.0], [0.5929237367985304, 0.09559447605258643, 1.0], [0.5929237367985304, 0.09559447605258643, 0.0], [0.6875481023944751, 0.057297510092875786, 0.0], [0.6875481023944751, 0.057297510092875786, 1.0], [0.6652587073495958, 0.05355667498504547, 1.0], [0.643752516159224, 0.06771023378210216, 1.0], [0.6570440518736288, 0.08303967985539576, 1.0], [0.680983369306763, 0.09261777428860629, 1.0], [0.6734204752448539, 0.10841376810679369, 1.0], [0.6492539379423148, 0.10592750969413008, 1.0], [0.6492539379423148, 0.10592750969413008, 0.0], [0.7118872438126562, 0.0631537954418461, 0.0], [0.7118872438126562, 0.0631537954418461, 1.0], [0.7062633620860532, 0.08462279811327705, 1.0], [0.7097003500184106, 0.1068774817461435, 1.0], [0.7270704457573437, 0.09937297796879514, 1.0], [0.7373464086633522, 0.07861813235667603, 1.0], [0.7414695685905711, 0.0682455997882286, 1.0], [0.7410765170671745, 0.09141077319758564, 1.0], [0.7510092844052073, 0.11067779937406756, 1.0], [0.7690279107317524, 0.09946129984538463, 1.0], [0.7790213443326467, 0.07855530081618049, 1.0], [0.7813128989756379, 0.070260693625754, 1.0], [0.7837884278637424, 0.09332322141859425, 1.0], [0.7850457962129945, 0.10066591188893646, 1.0], [0.7866834243158197, 0.07758173753171757, 1.0], [0.7971344465377097, 0.07428718577655165, 1.0], [0.816702280784313, 0.08566979460533024, 1.0], [0.8392933409694656, 0.0818713940124928, 1.0], [0.8564301571713081, 0.0670998914432246, 1.0], [0.842236636845677, 0.057607642835366686, 1.0], [0.8249078118769327, 0.07235718596777736, 1.0], [0.8213753935158387, 0.09409080220209436, 1.0], [0.839128246226824, 0.10814283692695181, 1.0], [0.8618255023673255, 0.11274995480787395, 1.0], [0.8618255023673255, 0.11274995480787395, 0.0], [0.9432273788506644, 0.016562323564328855, 0.0], [0.9432273788506644, 0.016562323564328855, 1.0], [0.9635036062098021, 0.006971062113918285, 1.0], [0.986487695904064, 0.01164653913654565, 1.0], [0.9875335095060781, 0.03251558311198372, 1.0], [0.9729663290762949, 0.05142637834710153, 1.0], [0.9612971585747931, 0.07195260117362987, 1.0], [0.9762469120562658, 0.08642669518768585, 1.0], [1.0, 0.08457487527501524, 1.0], [1.0, 0.08457487527501524, 0.0], [0.967049549713328, 0.12727955647174025, 0.0], [0.967049549713328, 0.12727955647174025, 1.0], [0.966894149383669, 0.1273079398905109, 1.0], [0.9676673242620102, 0.12803498506638827, 1.0]]; \ No newline at end of file diff --git a/src/trap/zmqplugin.rs b/src/trap/zmqplugin.rs index 236b545..e7a9b6e 100644 --- a/src/trap/zmqplugin.rs +++ b/src/trap/zmqplugin.rs @@ -22,6 +22,7 @@ fn setup_zmq(world: &mut World, params: &mut SystemState>) { let filter = &settings.filter; //"msgs"; assert!(subscriber.set_subscribe(filter.as_bytes()).is_ok()); world.insert_non_send_resource(subscriber); + // world.query::<>() } fn receive_zmq_messsages(mut commands: Commands, subscriber: NonSend, mut tracks_q: Query<&mut Track>) {