diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-02-05 18:28:18 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-02-05 18:28:18 +0100 |
commit | 631e8a0f47e5e5691585b51784550e80e82dc63b (patch) | |
tree | 0561f0190958cde97f4d3fb977207ee0aecfad71 /include | |
parent | fbbcac14eb9a785075355a385a2da4a68117b87f (diff) |
Add vec2::to_vec2i
Diffstat (limited to 'include')
-rw-r--r-- | include/mglpp/system/vec.hpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/mglpp/system/vec.hpp b/include/mglpp/system/vec.hpp index 23ef935..d424f42 100644 --- a/include/mglpp/system/vec.hpp +++ b/include/mglpp/system/vec.hpp @@ -61,6 +61,10 @@ namespace mgl { return { static_cast<float>(x), static_cast<float>(y) }; } + vec2<int> to_vec2i() const { + return { static_cast<int>(x), static_cast<int>(y) }; + } + vec2<T> floor() const { return { static_cast<T>(static_cast<int>(x)), static_cast<T>(static_cast<int>(y)) }; } |