Add approx feature to bevy_math (#11176)

# Objective

`bevy_math` re-exports Glam, but doesn't have a feature for enabling
`approx` for it. Many projects (including some of Bevy's own crates)
need `approx`, and it'd be nice if you didn't have to manually add Glam
to specify the feature for it.

## Solution

Add an `approx` feature to `bevy_math`.
This commit is contained in:
Joona Aalto 2024-01-02 20:10:44 +02:00 committed by GitHub
parent 2c5439b25e
commit 536a7bd810
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -14,6 +14,8 @@ serde = { version = "1", features = ["derive"], optional = true }
[features]
serialize = ["dep:serde", "glam/serde"]
# Enable approx for glam types to approximate floating point equality comparisons and assertions
approx = ["glam/approx"]
# Enable interoperation of glam types with mint-compatible libraries
mint = ["glam/mint"]
# Enable assertions to check the validity of parameters passed to glam

View file

@ -24,8 +24,8 @@ thiserror = "1.0"
[dev-dependencies]
bevy_tasks = { path = "../bevy_tasks", version = "0.12.0" }
bevy_math = { path = "../bevy_math", version = "0.12.0", features = ["approx"] }
approx = "0.5.1"
glam = { version = "0.24", features = ["approx"] }
[features]
serialize = ["dep:serde", "bevy_math/serialize"]