-
Notifications
You must be signed in to change notification settings - Fork 428
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
[1.0] TextureTransformBind の Scale/Offset 変換 #1234
[1.0] TextureTransformBind の Scale/Offset 変換 #1234
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
変換コードの一元化、LTGTM
/// <returns></returns> | ||
public static (Vector2, Vector2) VerticalFlipScaleOffset(Vector2 s, Vector2 o) | ||
{ | ||
return (new Vector2(s.x, s.y), new Vector2(o.x, 1.0f - o.y - s.y)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
/// <param name="s"></param> | ||
/// <param name="o"></param> | ||
/// <returns></returns> | ||
public static (Vector2, Vector2) VerticalFlipScaleOffset(Vector2 s, Vector2 o) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(どちらでもよい)タプルに名前を付けておいた方が、メンテ性はあるかも。
public static (Vector2 scale, Vector2 offset) VerticalFlipScaleOffset(Vector2 scale, Vector2 offset)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
たしかに。わりと OffsetScale と言っていることがある。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
計算を適用する順序としては uv * scale + offset
なので ScaleOffset の方が間違いが少ないという気持ちはある
微妙なところ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
ついでに実験してみた。