diff options
author | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2023-08-16 13:52:51 +0200 |
---|---|---|
committer | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2023-08-16 13:52:51 +0200 |
commit | 52eb77efd406da8b16af30d4002cbd9dc01969fe (patch) | |
tree | 7e021fbfa51b8fa8247360670b4ffb4f467baeaa /include/godot_cpp/variant/vector3i.hpp | |
parent | 74b352e979eef2135aa6fee4e08771be1cf5bd71 (diff) | |
download | redot-cpp-52eb77efd406da8b16af30d4002cbd9dc01969fe.tar.gz |
Add remaining component-wise `min/max` functions to `Vector*`
Diffstat (limited to 'include/godot_cpp/variant/vector3i.hpp')
-rw-r--r-- | include/godot_cpp/variant/vector3i.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/godot_cpp/variant/vector3i.hpp b/include/godot_cpp/variant/vector3i.hpp index c8f1fe5..c13bd08 100644 --- a/include/godot_cpp/variant/vector3i.hpp +++ b/include/godot_cpp/variant/vector3i.hpp @@ -71,6 +71,14 @@ struct _NO_DISCARD_ Vector3i { Vector3i::Axis min_axis_index() const; Vector3i::Axis max_axis_index() const; + Vector3i min(const Vector3i &p_vector3i) const { + return Vector3i(MIN(x, p_vector3i.x), MIN(y, p_vector3i.y), MIN(z, p_vector3i.z)); + } + + Vector3i max(const Vector3i &p_vector3i) const { + return Vector3i(MAX(x, p_vector3i.x), MAX(y, p_vector3i.y), MAX(z, p_vector3i.z)); + } + _FORCE_INLINE_ int64_t length_squared() const; _FORCE_INLINE_ double length() const; |