Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Math::Clamp(Vec2 v,Vec2 min,Vec2 max) #1228

Open
comefrombottom opened this issue May 10, 2024 · 1 comment
Open

Math::Clamp(Vec2 v,Vec2 min,Vec2 max) #1228

comefrombottom opened this issue May 10, 2024 · 1 comment
Labels

Comments

@comefrombottom
Copy link
Member

追加する機能の内容 | Describe the solution you'd like
Vec2 Math::Clamp(const Vec2& v, const Vec2& min, const Vec2& max)
{
return { Clamp(v.x, min.x, max.x), Clamp(v.y, min.y, max.y) };
}
的なことが出来る関数オーバーロードを追加
Vec3,Point,Float2…などにも
その機能の追加によって解決する問題 | Is your feature request related to a problem? Please describe.
Math::Min(Vec2,Vec2)などがすでにある為、一貫性を持たせる。
備考 | Additional context
Vec2::clamp(RectF)がすでにあり、合わせてMath::Clamp(Vec2,RectF)があってもいいかも?(とりあえず今回は無視)

@Reputeless
Copy link
Member

ご提案ありがとうございます。現在開発中の v0.8 にて実装済みです。
https://github.com/Siv3D/siv8/blob/main/Siv3D/include/Siv3D/detail/Math_impl.ipp#L1678-L1787
v0.6.1x へのバックポートも検討します。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants