Cargo Features

[dependencies]
bevy_math = { version = "0.18.0-rc.1", default-features = false, features = ["std", "alloc", "serialize", "approx", "mint", "libm", "glam_assert", "debug_glam_assert", "rand", "curve", "bevy_reflect", "nostd-libm"] }
default = curve, rand, std

These default features are set whenever bevy_math is added without default-features = false somewhere in the dependency tree.

std default = alloc

Enables use_std of itertools and std of optional rand, optional rand_distr, and optional serde

rand:

Supply rngs for examples and tests

and std of derive_more, glam, optional approx, and optional bevy_reflect

bevy_reflect:

Platform Compatibility

Allows access to the std crate. Enabling this feature will prevent compilation on no_std targets, but provides access to certain additional features on supported platforms.

alloc bevy_reflect? std

Enables use_alloc of itertools, alloc of optional rand, optional rand_distr, and optional serde

Affects cubic_splines::CubicBezier, cubic_splines::CubicHermite, cubic_splines::CubicCardinalSpline, cubic_splines::CubicBSpline, cubic_splines::CubicNurbs, cubic_splines::LinearSpline, cubic_splines::CubicGenerator, cubic_splines::CyclicCubicGenerator, cubic_splines::CubicCurve, cubic_splines::RationalGenerator, cubic_splines::RationalCurve, cores::EvenCore, cores::UnevenCore, cores::ChunkedUnevenCore, curve::sample_curves, curve::CurveResampleExt, dim2::Polyline2d, dim2::Polygon, dim2::ConvexPolygon, dim2::ConvexPolygonError

serialize

Enables serde, serde of glam

approx

Enable approx for glam types to approximate floating point equality comparisons and assertions

Enables approx, approx of glam

mint

Enable interoperation of glam types with mint-compatible libraries

Enables mint of glam

libm

Enable libm mathematical functions for glam types to ensure consistent outputs across platforms at the cost of losing hardware-level optimization using intrinsics

Enables libm, libm of glam

glam_assert

Enable assertions to check the validity of parameters passed to glam

Enables glam-assert of glam

debug_glam_assert

Enable assertions in debug builds to check the validity of parameters passed to glam

Enables debug-glam-assert of glam

rand default

Enable the rand dependency for shape_sampling

Enables rand and rand_distr, rand of glam

Affects bevy_math::sampling

curve default

Include code related to the Curve trait

Affects bevy_math::curve

bevy_reflect = alloc

Enable bevy_reflect (requires alloc)

Enables bevy_reflect

nostd-libm

Enable libm mathematical functions as a fallback for no_std environments.
Can be overridden with std feature.

Enables libm, nostd-libm of glam