Changes
Added
- Feature
parallel
for parallel work with data
(594e767). rayon
dependency forparallel
features
(594e767)
(1019ba6).ColliderType
enumeration
(618b5f7).- Functions
generate_colliders
,generate_collider
for code maintainability
(618b5f7)
(56f3a2f).
Changed
- Upgrade dependencies:
edges
0.4
(e4c501f). - The
rapier2d
,parallel
features are enabled andavian2d
are disabled by default
(f000104). - Dependencies
bevy
replaced bybevy_math
(d2079cb)
(42c750e). Edges
structure now in public external crateedges
(618b5f7).
Removed
thiserror
from dependencies
(2f1f35b).- Functions are removed for code maintainability
(618b5f7):single_polyline_collider_translated
single_polyline_collider_raw
single_convex_polyline_collider_translated
single_convex_polyline_collider_raw
- etc.
Migration guide
To migrate to this version, you should update your Cargo.toml
file accordingly.
Here’s how you can specify your dependency:
For using bevy_rapier2d
:
[dependencies.bevy_collider_gen]
# replace "*" with the most recent version of bevy_collider_gen
version = "*"
For using avian2d
:
[dependencies.bevy_collider_gen]
# replace "*" with the most recent version of bevy_collider_gen
version = "*"
features = ["avian2d", "parallel"]
default-features = false
About removed functions
In the latest version of the bevy_collider_gen
library,
the collider generation functions have been streamlined
and refactored for better usability and clarity.
Below is a guide to help you transition from the old functions to the new ones.
Function Overview
New Function Name | Description |
---|---|
generate_collider |
Generates a single collider from the provided image based on the specified type. |
generate_colliders |
Generates multiple colliders from the provided image based on the specified type. |
Example Migration
Old Code
let translated_collider = single_polyline_collider_translated(image);
let raw_collider = single_polyline_collider_raw(image);
New Code
let translated_collider = generate_collider(image, ColliderType::Polyline, true);
let raw_collider = generate_collider(image, ColliderType::Polyline, false);
Example for Multiple Colliders
Old Code
let translated_colliders = multi_polyline_collider_translated(image);
let raw_colliders = multi_polyline_collider_raw(image);
New Code
let translated_colliders = generate_colliders(image, ColliderType::Polyline, true);
let raw_colliders = generate_colliders(image, ColliderType::Polyline, false);