Skip to content

0.3.0 - 2024-11-20

Latest
Compare
Choose a tag to compare
@salam99823 salam99823 released this 12 Dec 17:34
· 9 commits to main since this release

Changes

Added

  • Feature parallel for parallel work with data
    (594e767).
  • rayon dependency for parallel features
    (594e767)
    (1019ba6).
  • ColliderType enumeration
    (618b5f7).
  • Functions generate_colliders, generate_collider for code maintainability
    (618b5f7)
    (56f3a2f).

Changed

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);