bevyengine / bevyengine/bevy

Const all the floating point arithmetic

Open
#16,124 2 comments 1 reaction 0 assignees View on GitHub
A-Color A-Math A-UI C-Usability D-Trivial S-Ready-For-Implementation X-Contentious
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## What problem does this solve or what need does it fill?

As seen in #16091, floating point arithmetic can now be used in constant functions! This is a valuable API improvement, as it allows users to define their own derived constants using our handy math operations.

## What solution would you like?

We should constify our APIs, one crate at a time. The critical ones are:

- [ ] bevy_math
- [ ] bevy_color
- [ ] bevy_ui

This should be kept to relatively simple functions and methods: *only* things that we can commit to being const indefinitely.

## What alternative(s) have you considered?

Do let me know if I've missed a crate that needs this treatment!

## Additional context

`glam` is open to making much of their API const which will unblock a ton of improvements in Bevy itself, although it's harder than one might expect there, due to SIMD support.

Contributor guide

Open the contributing guide

Research direction

Start by reading #16091 and reviewing the floating-point APIs in one of the listed crates: bevy_math, bevy_color, or bevy_ui. Identify relatively simple functions that can be committed to as const indefinitely; the work is complete when the selected crate's suitable APIs are constified.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.