This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! An example showing how to save screenshots to disk | |
use bevy::prelude::*; | |
use bevy::render::view::screenshot::ScreenshotManager; | |
use bevy::window::PrimaryWindow; | |
fn main() { | |
App::new() | |
.add_plugins(DefaultPlugins.set(WindowPlugin { | |
primary_window: Some(Window { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! produce inexistent children using DynamicScene duplication | |
use bevy::{prelude::*, ecs::entity::EntityHashMap}; | |
#[derive(Component, Reflect, Default)] | |
#[reflect(Component)] | |
struct Cat; | |
#[derive(Component, Reflect, Default)] | |
#[reflect(Component)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "smol" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies.bevy] | |
version = "0.13.0" | |
default-features = false | |
features = [ | |
"multi-threaded", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! process input from mic with fundsp | |
use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; | |
use cpal::{FromSample, SizedSample}; | |
use fundsp::hacker32::*; | |
use crossbeam_channel::{bounded, Receiver, Sender}; | |
#[derive(Clone)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "smol" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
bevy = "0.14.0-rc.3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// phasor (ramp from 0..1) | |
/// - input 0: frequency | |
/// - output 0: ramp output | |
#[derive(Default, Clone)] | |
pub struct Ramp { | |
val: f32, | |
sr: f32, | |
} | |
impl Ramp { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// phasor (ramp from 0..1) | |
/// - input 0: frequency | |
/// - output 0: ramp output | |
#[derive(Default, Clone)] | |
pub struct Phasor { | |
val: f32, | |
sr: f32, | |
} | |
impl Phasor { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//bgawk https://github.com/tomara-x/bgawk | |
// with sensor (in draw settings) turned on | |
let h = []; | |
let l = []; | |
let th = []; | |
let tl = []; | |
//original | |
for i in 0..10 { | |
for j in 0..10 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// show how having an offset in viewport position affects bevy picking | |
use bevy::prelude::*; | |
#[cfg(not(target_arch = "wasm32"))] | |
use bevy::sprite::{Wireframe2dConfig, Wireframe2dPlugin}; | |
fn main() { | |
let mut app = App::new(); | |
app.add_plugins(( | |
MeshPickingPlugin, |