jcornaz / heron

[DISCONTINUED] An ergonomic physics API for bevy games
MIT License
293 stars 44 forks source link

Reduce friction caused by requiring an explicit `2d`/`3d` feature flag #249

Open jcornaz opened 2 years ago

jcornaz commented 2 years ago

To use heron, one must enable either the 2d or 3d feature flag: https://docs.rs/heron/3.0.0/heron/index.html#add-the-dependency-and-choose-to-work-with-either-2d-or-3d

This can be friction for new users, who can stumble into unclear error messages: https://discord.com/channels/691052431525675048/966502688751779931/966599689749270558

I think we can improve the situation.

Maybe something like:

#[cfg(not(any(feature = "2d", feature = "3d")))]
compile_error!("the feature \"2d\" or \"3d\" must be enabled to use heron");

So that a setup would become:

The rationale behind choosing 3d as the default instead of 2d is that 3d is a "superset" of the 2d capabilities in the sense that one could make a 2d game using the 3d version of heron, but the not the opposite.