Commit graph

2871 commits

Author SHA1 Message Date
ira
6a85eb3d7e
Immediate Mode Line/Gizmo Drawing (#6529)
# Objective
Add a convenient immediate mode drawing API for visual debugging.

Fixes #5619
Alternative to #1625
Partial alternative to #5734

Based off https://github.com/Toqozz/bevy_debug_lines with some changes:
 * Simultaneous support for 2D and 3D.
 * Methods for basic shapes; circles, spheres, rectangles, boxes, etc.
 * 2D methods.
 * Removed durations. Seemed niche, and can be handled by users.

<details>
<summary>Performance</summary>

Stress tested using Bevy's recommended optimization settings for the dev
profile with the
following command.
```bash
cargo run --example many_debug_lines \
    --config "profile.dev.package.\"*\".opt-level=3" \
    --config "profile.dev.opt-level=1"
```
I dipped to 65-70 FPS at 300,000 lines
CPU: 3700x
RAM Speed: 3200 Mhz
GPU: 2070 super - probably not very relevant, mostly cpu/memory bound

</details>

<details>
<summary>Fancy bloom screenshot</summary>


![Screenshot_20230207_155033](https://user-images.githubusercontent.com/29694403/217291980-f1e0500e-7a14-4131-8c96-eaaaf52596ae.png)

</details>

## Changelog
 * Added `GizmoPlugin`
 * Added `Gizmos` system parameter for drawing lines and wireshapes.

### TODO
- [ ] Update changelog
- [x] Update performance numbers
- [x] Add credit to PR description

### Future work
- Cache rendering primitives instead of constructing them out of line
segments each frame.
- Support for drawing solid meshes
- Interactions. (See
[bevy_mod_gizmos](https://github.com/LiamGallagher737/bevy_mod_gizmos))
- Fancier line drawing. (See
[bevy_polyline](https://github.com/ForesightMiningSoftwareCorporation/bevy_polyline))
- Support for `RenderLayers`
- Display gizmos for a certain duration. Currently everything displays
for one frame (ie. immediate mode)
- Changing settings per drawn item like drawing on top or drawing to
different `RenderLayers`

Co-Authored By: @lassade <felipe.jorge.pereira@gmail.com>
Co-Authored By: @The5-1 <agaku@hotmail.de> 
Co-Authored By: @Toqozz <toqoz@hotmail.com>
Co-Authored By: @nicopap <nico@nicopap.ch>

---------

Co-authored-by: Robert Swain <robert.swain@gmail.com>
Co-authored-by: IceSentry <c.giguere42@gmail.com>
Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2023-03-20 20:57:54 +00:00
Mike
d58ed67fa4
add position to scene errors (#8065)
# Objective

- Fixes https://github.com/bevyengine/bevy/issues/6760
- adds line and position on line info to scene errors

```text
Before:
2023-03-12T22:38:59.103220Z  WARN bevy_asset::asset_server: encountered an error while loading an asset: Expected closing `)`
After:
2023-03-12T22:38:59.103220Z  WARN bevy_asset::asset_server: encountered an error while loading an asset: Expected closing `)` at scenes/test/scene.scn.ron:10:4
```

## Solution

- use span_error to get position info. This is what the ron crate does
internally to get the position info.
562963f887/src/options.rs (L158)

## Changelog

- added line numbers to scene errors

---------

Co-authored-by: Paul Hansen <mail@paul.rs>
2023-03-20 19:29:54 +00:00
Shfty
7b7294b8a7
Allow SPIR-V shaders to process when shader defs are present (#7772) 2023-03-19 09:26:26 +00:00
Daniel Chia
20101647c1
Left-handed y-up cubemap coordinates (#8122)
Co-authored-by: Robert Swain <robert.swain@gmail.com>
Co-authored-by: robtfm <50659922+robtfm@users.noreply.github.com>
2023-03-18 23:06:53 +00:00
Devin Gunay
f255872c1e
Derive Copy and Clone for Collision (#8121) 2023-03-18 04:55:31 +00:00
Carter Anderson
aefe1f0739
Schedule-First: the new and improved add_systems (#8079)
Co-authored-by: Mike <mike.hsu@gmail.com>
2023-03-18 01:45:34 +00:00
Bruce Reif (Buswolley)
bca4b36d4d
change not implemation to custom system struct (#8105)
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2023-03-17 21:37:16 +00:00
ickshonpe
52b91ac15b
Skip the UV calculations for untextured UI nodes (#7809) 2023-03-17 08:49:40 +00:00
Christian Hughes
609b099e7c
Add World::try_run_schedule (#8028)
Co-authored-by: James Liu <contact@jamessliu.com>
2023-03-17 01:22:54 +00:00
Edgar Geier
67afd21702
Fix Plugin::build detection (#8103) 2023-03-17 00:16:20 +00:00
Mat Hostetter
f3d6c2d90b
Remove redundant bounds check in Entities::get (#8108) 2023-03-16 22:49:36 +00:00
Turki Jamaan
4a62afb97b
Doc and test get_many(_mut) ordering (#8045) 2023-03-16 12:55:44 +00:00
Asier Illarramendi
cb100ba78f
Improve UI stack docs and other small tweaks (#8094) 2023-03-16 12:54:52 +00:00
François
b6b549e3ff
Fix look_to resulting in NaN rotations (#7817)
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Liam Gallagher <ljpgallagher@xtra.co.nz>
2023-03-15 20:45:56 +00:00
BlondeBurrito
602f3baf3f
fix: register Cascade in the TypeRegistry (#8088) 2023-03-15 00:11:55 +00:00
sark
520e413c21
unused_variables warning when building with filesystem_watcher feature disabled (#7938) 2023-03-14 08:58:55 +00:00
ickshonpe
e77eb003ec
Perform text scaling calculations per text, not per glyph (#7819) 2023-03-14 00:01:27 +00:00
Chris Russell
a63881905a
Pass query change ticks to QueryParIter instead of always using change ticks from World. (#8029)
Co-authored-by: Chris Russell <8494645+chescock@users.noreply.github.com>
Co-authored-by: James Liu <contact@jamessliu.com>
2023-03-13 22:06:16 +00:00
Bruce Reif (Buswolley)
7c4a0eb768
add Clone to common conditions (#8060) 2023-03-13 19:38:04 +00:00
Anti-Alias
884b9b62af
Added Globals struct to prepass shader (#8070) 2023-03-13 18:55:47 +00:00
James Liu
dcc0edf8a7
Make BundleInfo's fields not pub(crate) (#8068) 2023-03-13 16:18:49 +00:00
JoJoJet
ed97c621b8
Move docs for !Sync resources onto the correct trait (#8066) 2023-03-13 16:16:14 +00:00
Liam Gallagher
0918b30e29
Tests for Run Conditions (#8035) 2023-03-13 15:39:25 +00:00
François
71b1b35757
do not set hit test unconditionally on window creation (#7996) 2023-03-13 15:31:13 +00:00
SneakyBerry
6bfc09f53e
Construct Box<dyn Reflect> from world for ReflectComponent (#7407)
Co-authored-by: SneakyBerry <kennedwyhokilled@gmail.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2023-03-13 15:26:47 +00:00
ickshonpe
87dda354dd
Remove Val::Undefined (#7485) 2023-03-13 15:17:00 +00:00
François
d8b7fed4fe
don't panic on unknown ambiguity (#7950) 2023-03-12 15:24:52 +00:00
Gilbert Röhrbein
7d5f89cca1
Color::Lcha constructors (#8041)
Co-authored-by: James Liu <contact@jamessliu.com>
2023-03-11 18:50:16 +00:00
Gilbert Röhrbein
9e9ae5b830
Fix Color::as_rgba_linear for Color::Lcha (#8040)
Co-authored-by: James Liu <contact@jamessliu.com>
2023-03-11 12:12:31 +00:00
JoJoJet
fd1af7c8b8
Replace multiple calls to add_system with add_systems (#8001) 2023-03-10 18:15:22 +00:00
ickshonpe
729458815c
Fix the Text2d text anchor's incorrect horizontal alignment (#8019) 2023-03-10 14:57:41 +00:00
Christian Hughes
8aa217cc8b
Add OnTransition schedule that is ran between OnExit and OnEnter (#7936) 2023-03-10 09:06:23 +00:00
James Liu
7d9cb1c4ab
Remove ChangeTrackers (#7902) 2023-03-09 20:02:56 +00:00
Konstantin Kostiuk
3ec764ea24
Initialize empty schedules when calling .in_schedule if they do not already exist (#7911) 2023-03-09 17:24:24 +00:00
JoJoJet
2e7b915ba4
Increase type safety and clarity for change detection (#7905) 2023-03-09 17:17:02 +00:00
Rob Parrett
b7ac5d5121
Update trybuild tests for Rust 1.68 (#8002) 2023-03-09 15:46:06 +00:00
ickshonpe
f554700108
Add methods for calculating the size and postion of UI nodes (#7930)
Co-authored-by: François <mockersf@gmail.com>
2023-03-09 14:12:54 +00:00
Ikko Eltociear Ashimine
e22572d9a3
Fix typo in utility.rs (#7997) 2023-03-09 09:20:45 +00:00
James Liu
37df316219
Document bevy_ecs::storage (#7770)
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Rob Parrett <robparrett@gmail.com>
Co-authored-by: Carter Weinberg <weinbergcarter@gmail.com>
Co-authored-by: MinerSebas <66798382+MinerSebas@users.noreply.github.com>
Co-authored-by: Cameron <51241057+maniwani@users.noreply.github.com>
2023-03-09 07:22:48 +00:00
JoJoJet
21ddc60372
Add a public constructor for Mut<T> (#7931) 2023-03-09 05:40:58 +00:00
JoJoJet
545965075f
Make WorldQuery meta types unnameable (#7964) 2023-03-09 05:40:06 +00:00
张林伟
84711e38b1
Set cursor hittest during window creation (#7966) 2023-03-09 05:39:49 +00:00
Aceeri
3cfcc66bdc
Move cursor position to internal state (#7988) 2023-03-09 05:39:01 +00:00
Rob Parrett
2908bb5e8a
Use derive for default impl of DynamicVariant (#7986) 2023-03-08 22:27:54 +00:00
Ame
d3df04cb4c
Small fix: Change ">" to "Greater than" (#7983) 2023-03-08 21:12:44 +00:00
Ame
6240ba8fa2
Small Fix: Add an escape character to avoid blockquote (#7980) 2023-03-08 19:28:23 +00:00
Nico Burns
872a609a3a
Upgrade Taffy requirement to v0.3.5 (#7959) 2023-03-07 22:10:35 +00:00
Rob Parrett
54dec6079f
Fix min and max size using size value (#7948) 2023-03-07 20:59:02 +00:00
Nico Burns
31d02d45ec
Upgrade Taffy to 0.3.4 (#7953) 2023-03-07 20:01:45 +00:00
github-actions[bot]
6898351348
chore: Release (#7920)
Co-authored-by: Bevy Auto Releaser <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-06 05:13:36 +00:00