View widget_system.rs
This file contains 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
/// implemention of SystemParam-based egui Widgets for bevy 0.10 | |
/// adapted from: https://github.com/bevyengine/bevy/discussions/5522 | |
/// | |
/// Effectively widgets can access world components/resources similar | |
/// to systems. | |
#![allow(clippy::type_complexity)] | |
use bevy::ecs::system::{SystemParam, SystemState}; | |
use bevy::prelude::*; | |
use bevy_egui::egui; |
View main.rs
This file contains 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
/// minimal example of adding a custom render pipeline in bevy 0.11. | |
/// | |
/// When this example runs, you should only see a blue screen. There are no | |
/// vertex buffers, or anything else in this example. Effectively it is | |
/// shader-toy written in bevy. | |
/// | |
/// This revision adds a post-processing node to the RenderGraph to | |
/// execute the shader. Thanks to @Jasmine on the bevy discord for | |
/// suggesting I take a second look at the bevy post-processing example | |
/// |
View stun_test.rs
This file contains 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
//! Example workaround for ecs-based race-conditions when used in muds. | |
//! The key problem is two characters stunning each other in the same | |
//! frame, only one of them should end up stunned. | |
//! | |
//! This solution in bevy uses an exclusive system that runs without | |
//! world deferment. | |
#[allow(unused)] | |
use anyhow::{bail, Result}; | |
use bevy::{log::LogPlugin, prelude::*}; |
View cscope.lua
This file contains 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
--[[ | |
Navigate cscope in neovim using telescope with multiple databases | |
Setup: | |
local cscope = require('cscope') | |
-- look for cscope.out in the current working directory | |
cscope.add_database { path = "." } | |
-- add a second database and set the top-level path for files in that db | |
cscope.add_database { | |
path = "/project/altitude/src", |
View egui_tile_palette.rs
This file contains 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
#![allow(clippy::type_complexity)] | |
#![allow(clippy::too_many_arguments)] | |
use bevy::{ | |
core_pipeline::tonemapping::Tonemapping, prelude::*, render::view::RenderLayers, | |
scene::SceneInstance, | |
}; | |
use bevy_dolly::prelude::*; | |
use bevy_egui::{egui, EguiContexts, EguiPlugin, EguiUserTextures}; | |
use bevy_inspector_egui::quick::WorldInspectorPlugin; |
View scene_aabb.rs
This file contains 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
//! Load a GLB Scene, and draw an Axis-Aligned Bounding-Box around the entire | |
//! scene | |
//! | |
//! Works in Bevy v0.10 | |
#![allow(clippy::type_complexity)] | |
use bevy::{ | |
core_pipeline::tonemapping::Tonemapping, prelude::*, render::primitives::Aabb, | |
scene::SceneInstance, transform::TransformSystem::TransformPropagate, | |
}; |
View picking_raycast_multiple.rs
This file contains 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
// This is a rough & dirty fork of `bevy_picking_raycast` that supports multiple raycast sets. | |
// This is needed when you have multiple cameras you want to raycast from at the same time. | |
// The key change is making the `Backend` generic for raycast sets. It's harder to work | |
// with as it requires an understanding of `bevy_mod_raycast`. | |
// | |
// Other changes: removed `Picking` component management; added enable/disable via config | |
//! A raycasting backend for `bevy_mod_picking` that uses `bevy_mod_raycast` for raycasting. | |
use bevy::{prelude::*, utils::HashMap, window::PrimaryWindow}; |
View fzf-cscope.vim
This file contains 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
" Requires the fzf-vim plugin to work. Performs cscope queries against | |
" cscope.out, uses fzf-vim to display results and previews. | |
" specify multiple cscope databases to search. | |
" " short form, list of directories containing cscope.out | |
" let g:fzf_cscope_databases = [".", "~/kernels/2.6.12"] | |
" | |
" " long form database in separate directory from sources | |
" let g:fzf_cscope_databases = [ | |
" [".", "build/cscope.out"], |