Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gasinfinity/rnm
Small, simple C++26 math library for game development.
https://github.com/gasinfinity/rnm
cpp cpp26 graphics-programming math
Last synced: 1 day ago
JSON representation
Small, simple C++26 math library for game development.
- Host: GitHub
- URL: https://github.com/gasinfinity/rnm
- Owner: GasInfinity
- License: mit
- Created: 2024-11-18T22:39:08.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-28T10:07:30.000Z (about 2 months ago)
- Last Synced: 2024-11-28T11:21:15.436Z (about 2 months ago)
- Topics: cpp, cpp26, graphics-programming, math
- Language: C++
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## 📏 Rena::Mathematics (rnm)
Small, simple C++26 math library for game development and such. Use it by adding the headers in your project and including `rnm/rnm.hpp` (or each header individually).
[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)
## 🔍 Usage```cpp
#includetypedef rnm::vec vec2f; // a.k.a: rnm::vec2
typedef rnm::vec vec3f; // a.k.a: rnm::vec2
typedef rnm::mat mat3f; // a.k.a: rnm::mat3vec2f xy = {100.f, 20.f};
mat3f translation = rnm::translate(xy);vec2f translated = (translation * vec3f(xy, 1.f)).xy;
std::print("{:.2f}", translated / 4.f); // Prints: "(50.00, 10.00)"
```## ❓ FAQ
#### Why don't you use SIMD?
SIMD is overrated for this, you won't get any kind of performance improvement by using it naively. You must think about the data you'll be handling and [put it in optimal ways for SIMD](https://www.reedbeta.com/blog/on-vector-math-libraries/#how-to-simd-and-how-not-to).
## 📜 License
[MIT](https://choosealicense.com/licenses/mit/)
## 📝 TODO
- [ ] Document the entire library.
- [ ] Add support for C++20 modules.