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: about 1 year 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 (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-28T10:07:30.000Z (over 1 year ago)
- Last Synced: 2025-01-14T15:44:41.336Z (about 1 year 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).
[](https://choosealicense.com/licenses/mit/)
## 🔍 Usage
```cpp
#include
typedef 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::mat3
vec2f 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.