bevy/errors
Joona Aalto 0166db33f7
Deprecate shapes in bevy_render::mesh::shape (#11773)
# Objective

#11431 and #11688 implemented meshing support for Bevy's new geometric
primitives. The next step is to deprecate the shapes in
`bevy_render::mesh::shape` and to later remove them completely for 0.14.

## Solution

Deprecate the shapes and reduce code duplication by utilizing the
primitive meshing API for the old shapes where possible.

Note that some shapes have behavior that can't be exactly reproduced
with the new primitives yet:

- `Box` is more of an AABB with min/max extents
- `Plane` supports a subdivision count
- `Quad` has a `flipped` property

These types have not been changed to utilize the new primitives yet.

---

## Changelog

- Deprecated all shapes in `bevy_render::mesh::shape`
- Changed all examples to use new primitives for meshing

## Migration Guide

Bevy has previously used rendering-specific types like `UVSphere` and
`Quad` for primitive mesh shapes. These have now been deprecated to use
the geometric primitives newly introduced in version 0.13.

Some examples:

```rust
let before = meshes.add(shape::Box::new(5.0, 0.15, 5.0));
let after = meshes.add(Cuboid::new(5.0, 0.15, 5.0));

let before = meshes.add(shape::Quad::default());
let after = meshes.add(Rectangle::default());

let before = meshes.add(shape::Plane::from_size(5.0));
// The surface normal can now also be specified when using `new`
let after = meshes.add(Plane3d::default().mesh().size(5.0, 5.0));

let before = meshes.add(
    Mesh::try_from(shape::Icosphere {
        radius: 0.5,
        subdivisions: 5,
    })
    .unwrap(),
);
let after = meshes.add(Sphere::new(0.5).mesh().ico(5).unwrap());
```
2024-02-08 18:01:34 +00:00
..
src Add warning when a hierarchy component is missing (#5590) 2022-09-19 16:12:11 +00:00
B0001.md Fix a few typos in error docs (#11709) 2024-02-05 04:39:45 +00:00
B0002.md Fix a few typos in error docs (#11709) 2024-02-05 04:39:45 +00:00
B0003.md fix B0003 example and update logs (#11162) 2024-01-10 21:40:24 +00:00
B0004.md Deprecate shapes in bevy_render::mesh::shape (#11773) 2024-02-08 18:01:34 +00:00
B0005.md Add some more docs for bevy_text. (#9873) 2023-10-27 18:53:57 +00:00
Cargo.toml Add readme to errors crate and clean up cargo files (#3125) 2021-11-13 23:06:48 +00:00
README.md Add readme to errors crate and clean up cargo files (#3125) 2021-11-13 23:06:48 +00:00

Bevy Error Codes

This crate lists and tests explanations and examples of Bevy's error codes.

For the latest Bevy release, you can find a rendered version of the error code descriptions at bevyengine.org/learn/errors.