Skip to content

Releases: shnewto/bevy_collider_gen

0.3.0 - 2024-11-20

12 Dec 17:34
Compare
Choose a tag to compare

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

0.2.0

04 Mar 04:07
Compare
Choose a tag to compare

Removes edge module from this crate in favor of the logic in the edges crate

migration guide

imports

replace this

use bevy_collider_gen::edge;

with this

use bevy_collider_gen::Edges;

getting edges from images

replace functions that took an image like this

let edges = multi_image_edge_translated(sprite_image);

with this

let edges = Edge::from(sprite_image).multi_image_edge_translated();

march_edges

replace this

bevy_collider_gen::edge::march_edges(...)

with this

bevy_collider_gen::Edges::march_edges(...)

0.1.0

02 Mar 01:24
4525620
Compare
Choose a tag to compare

0.1.0

the rebirth of bevy_rapier_collider_gen as simply bevy_collider_gen because we now support bevy_xpbd_2d as well!

migration guide

replace this

use bevy_rapier_collider_gen::*;

with this

use bevy_rapier_collider_gen::xpbd_2d::*;

or this

use bevy_rapier_collider_gen::rapier2d::*;