docs/bevy/release-content/migration-guides/bevy_shape.md 1.1 K · 30 lines · raw · history

1 ---
2 title: "split out `bevy_shape` from `bevy_math`"
3 pull_requests: [25302]
4 ---
5
6 `bevy_shape` is a new crate centered around the geometric primitives provided
7 by bevy. These primtiives and related traits have been split out from
8 `bevy_math` and are now available from different import paths than they used to
9 be.
10
11 Notably:
12
13 - all the `bevy_math::primitives::*` are now exposed either on the top level
14 via `bevy_shape::*` or in the `bevy_shape::prelude::*`
15 - the following traits have also moved from `bevy_math` into `bevy_shape`
16 - `Primitive2d` & `Primitive3d`
17 - `Bounded2d` & `Bounded3d`
18 - `BoundingVolume` & `IntersectsVolume`
19 - `ToRing`
20 - `Inset`
21 - `ShapeSample`
22
23 If you use the `bevy::prelude::*`, there should be nothing you have to change
24 as all of this is still included in the general prelude. Otherwise you might
25 need to include a dependency on `bevy_shape` now and import your desired
26 structures from there.
27
28 Note that `Bounded2d`, `Bounded3d`, `BoundingVolume` & `IntersectsVolume` are
29 also included in the prelude now, which wasn't the case before. You can check,
30 if the imports of these in your code base are still necessary.