์์ :)
https://github.com/eazuooz/WindowAPI/commit/8640c1b0193a760d7d45bfcfe3628f087b3aceea
Math · eazuooz/WindowAPI@8640c1b
Show file tree Showing 6 changed files with 121 additions and 62 deletions.
github.com
์ฌ๋ฌ๊ฐ์ง๋ก ๊ฒ์ ์ํ์ ํ์ํ ํจ์๋ค์ ์ถ๊ฐํ์๋ค.
๊ฒ์ ์ํ์ ํ์ํ ์ ๋ณด๋ค์ ๋ ธํธ์ ๋ค์๊ณผ ๊ฐ์ด ์ ๋ฆฌ ํด ๋์๋ค.
namespace ya::math
{
inline Vector2 Rotate(Vector2 vector, float degree)
{
float radian = (degree / 180.f) * PI;
vector.Normalize();
float x = cosf(radian) * vector.x - sinf(radian) * vector.y;
float y = sinf(radian) * vector.x + cosf(radian) * vector.y;
return Vector2(x, y);
}
inline float Dot(Vector2& v1, Vector2& v2)
{
return v1.x * v2.x + v1.y * v2.y;
}
inline float Cross(Vector2 v1, Vector2 v2)
{
return v1.x * v2.y - v1.y * v2.x;
}
}
'๐ Development Study > ๐ป Win32API' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Clone Object(๋ณต์ฌ ์์ฑ์) (0) | 2022.10.26 |
---|---|
Rigidbody (0) | 2022.10.20 |
Animator (1) | 2022.10.13 |
Object Delete (0) | 2022.10.12 |
Alphablend, Camera Effect (0) | 2022.10.05 |
๋๊ธ