Comments (9)
Does this occur on 0.13?
Nope.
from bevy.
I'm currently running a bisect to figure out which commit introduced this bug
from bevy.
Does this occur on 0.13?
from bevy.
This was likely introduced in #10973 by @Aceeri: I would appreciate a before/after test.
from bevy.
Video of behavior on f91fd32 Screencast_20240515_195205.webm
from bevy.
Additional behavior of bug: After despawning the entity, resizing or fullscreening the window causes whatever state is invalid to be updated making the gizmo no longer be drawn.
Video: Screencast_20240515_195748.webm
from bevy.
I just tested it with the #10973 commit and it works correctly. So it's something else. I'll run a git bisect
from bevy.
Modifying the code to this:
use bevy::prelude::*;
#[derive(Component)]
struct Point(Vec2);
fn setup(mut cmds: Commands) {
cmds.spawn(Camera2dBundle::default());
cmds.spawn(Point(Vec2::new(0.0, 150.0)));
cmds.spawn(Point(Vec2::new(100.0, 150.0)));
cmds.spawn(Point(Vec2::new(200.0, 150.0)));
cmds.spawn(Point(Vec2::new(300.0, 150.0)));
}
fn draw(mut gizmos: Gizmos, tree: Query<&Point>) {
for Point(pos) in tree.iter() {
gizmos.circle_2d(*pos, 40., Color::WHITE);
}
}
fn despawn(
mut cmds: Commands,
points: Query<Entity, With<Point>>,
mouse_buttons: Res<ButtonInput<MouseButton>>,
) {
if mouse_buttons.just_pressed(MouseButton::Left) {
for entity in points.iter().take(1) {
cmds.entity(entity).despawn();
println!("despawned");
}
}
}
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Startup, setup)
.add_systems(Update, (draw, despawn).chain())
.run();
}
Reveals that this happens when you go from exactly 1 gizmo being drawn -> 0 gizmos being drawn.
Edit: Wasn't quite correct. Removing the .take(1)
shows that it's actually when you go from any N
gizmos being drawn -> exactly 0 gizmos being drawn where 0 < N
.
Video: Screencast_20240515_203309.webm
from bevy.
Seems like #12982 is causing the issue. I'm investigating, I'm really not sure how that PR could affect gizmos
from bevy.
Related Issues (20)
- `DirX::new` should be more explicit about normalization and have a code example HOT 1
- Failed loading libxkbcommon.so.0 HOT 5
- Multiple cameras results in multiple writes to swap chain HOT 1
- Trait fn returning `impl Fn()` cannot be used as a system when called from generic type HOT 4
- Main branch fails to compile on Rust beta.
- Add a builder API to `LoadContext` HOT 1
- Auto exposure breaks when object is too dark HOT 2
- Very Large Material 2d Mesh diagonal artifact issue HOT 2
- Bevy has too many rectangle / box types HOT 4
- Move `bevy_math`'s implementations of `Reflect` into `bevy_math` HOT 1
- Allow access to Arc<CustomAttributes>. HOT 2
- Document that zero-length reflection paths are allowed. HOT 5
- `EMPTY` rect has suboptimal values HOT 3
- High performance sorted queries HOT 13
- Add `World::resource_scope_by_id` HOT 2
- Image loading docs are not clear enough about required feature flags HOT 4
- Squircle / Superellipse for UI / Gizmos / Mesh HOT 6
- Parent device is lost HOT 1
- Add additional names to GLTF entities for easier querying
- Bevy_ui outlines should respect BorderRadius.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bevy.