You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Allow clamping vectors and colors
This commit is contained in:
@@ -48,6 +48,13 @@ int Vector3i::max_axis() const {
|
||||
return x < y ? (y < z ? 2 : 1) : (x < z ? 2 : 0);
|
||||
}
|
||||
|
||||
Vector3i Vector3i::clamp(const Vector3i &p_min, const Vector3i &p_max) const {
|
||||
return Vector3i(
|
||||
CLAMP(x, p_min.x, p_max.x),
|
||||
CLAMP(y, p_min.y, p_max.y),
|
||||
CLAMP(z, p_min.z, p_max.z));
|
||||
}
|
||||
|
||||
Vector3i::operator String() const {
|
||||
return (itos(x) + ", " + itos(y) + ", " + itos(z));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user