Vector
Vectorμ λν μ 보λ₯Ό λ€λ£¨λ κ°μ²΄μμ.
μ°μ°μ
Vector = Vector + Vector |
λ λ²‘ν° κ°μ λν΄μ κ·Έ κ°μ 리ν΄ν΄μ€μ.
Vector = Vector - Vector |
μμ 벑ν°μμ λ€μ 벑ν°λ₯Ό λΊ κ°μ 리ν΄ν΄μ€μ.
Vector = Vector * Vector |
λ λ²‘ν° κ°μ κ³±ν΄μ κ·Έ κ°μ 리ν΄ν΄μ€μ.
Vector = Vector * number |
벑ν°μ number κ°μ κ³±ν΄μ κ·Έ κ°μ 리ν΄ν΄μ€μ.
Vector = -Vector |
벑ν°μ κ°μ λΆμ μΌλ‘ λ§λ€μ΄μ κ·Έ κ°μ 리ν΄ν΄μ€μ.
Vector = Vector + number |
벑ν°μ κ°κ³Ό numberκ°μ λν΄μ κ·Έ κ°μ 리ν΄ν΄μ€μ.
Vector = Vector - number |
벑ν°μ κ°μμ numberκ°μ λΊ κ°μ 리ν΄ν΄μ€μ.
Vector = Vector / number |
벑ν°μ κ°μμ numberμ λλ κ°μ 리ν΄ν΄μ€μ. (0μΌλ‘λ λλ μ μμ΄μ.)
μμ±
Size |
벑ν°μ ν¬κΈ°μμ.
-- μν --
SqrSize |
-- μν --
X |
X μ’νμμ.
Y |
Y μ’νμμ.
Z |
Z μ’νμμ.
-- μν --
μμ±μ
Vector new(number X, number Y, number Z) |
Vectorλ₯Ό X, Y, Z μ’νκ°μ μ΄μ©ν΄μ μμ±ν΄μ€μ. (μμ±ν Xμ’ν κ°, μμ±ν Yμ’ν κ°, μμ±ν Zμ’ν κ°)
Vector new(number Value) |
Vectorλ₯Ό Valueκ°μ μ΄μ©ν΄μ μμ±ν΄μ€μ. (μμ±ν Value κ°)
Vector new() |
Vectorμ X, Y, Z μ’νλ₯Ό 0μΌλ‘ν΄μ μμ±ν΄μ€μ.
-- μν --
ν¨μ
void Normalize() |
λ¨μλ₯Ό 1λ‘ μ κ·ν μμΌμ£Όλ ν¨μμμ.
-- μν --
number CosineAngle2D(Vector Other) |
λ 벑ν°μ XY νλ©΄μ μ¬μκ°μ cos κ°μ 리ν΄ν΄μ€μ. (μ¬μκ°μ ꡬν 벑ν°)
-- μν --
string ToString(Vector Other) |
"R:κ° , G:κ° , B:κ°, A:κ°" ννλ‘ string μ 리ν΄ν΄μ.
-- μν --
number Dot(Vector Other) |
other vector μμ λ΄μ κ°μ 리ν΄ν΄μ.
-- μν --
vector Cross(Vector Other) |
othervector μμ μΈμ κ°μ 리ν΄ν΄μ.
-- μν --
number Distance(Vector Other) |
othervector μμ 거리κ°μ 리ν΄ν΄μ.
-- μν --
number SqrDistance(Vector Other) |
othervector μμ 거리 μ κ³±κ°μ 리ν΄ν΄μ.
-- μν --
number Angle(Vector Other) |
othervector μμ μ¬μ΄κ°μ 리ν΄ν΄μ.
-- μν --
vector Reflect(Vector Normal) |
normal μ λΆλͺνλ λ°μ¬κ°μ 리ν΄ν΄μ.
-- μν --
vector Clone() |
κ°μ 벑ν°λ₯Ό μλ‘ μμ±ν΄μ 리ν΄ν΄μ.
-- μν --
void SizeLimit(number max) |
벑ν°μ ν¬κΈ°λ₯Ό maxλ‘ μ νν΄μ. ((X^2 + Y^2 + Z^2)^(1 / 2)) = Max
-- μν --
vector RotateAxisX(number angle) |
XμΆμ κ³ μ μΌλ‘ ν΄μ λ²‘ν° νμ ν λ€μ 리ν΄ν΄μ.
-- μν --
vector RotateAxisY(number angle) |
YμΆμ κ³ μ μΌλ‘ ν΄μ λ²‘ν° νμ ν λ€μ 리ν΄ν΄μ.
-- μν --
vector RotateAxisZ(number angle) |
ZμΆμ κ³ μ μΌλ‘ ν΄μ λ²‘ν° νμ ν λ€μ 리ν΄ν΄μ.
-- μν --
number SignedAngle2D(Vector othervector) |
othervector μμ μ¬μ΄κ°μ 리ν΄ν΄μ. (μμ ν¬ν¨)
-- μν --
vector zero() |
zero 벑ν°λ₯Ό 리ν΄ν΄μ. (0,0,0)
-- μν --
vector one() |
one 벑ν°λ₯Ό 리ν΄ν΄μ. (1,1,1)
-- μν --
vector forward() |
forward 벑ν°λ₯Ό 리ν΄ν΄μ. (1,0,0)
-- μν --
vector right() |
right 벑ν°λ₯Ό 리ν΄ν΄μ. (0,1,0)
-- μν --
vector up() |
up 벑ν°λ₯Ό 리ν΄ν΄μ. (0,0,1)
-- μν --
Last updated