|
MGL(Win32)
|
2Dベクトル [詳解]
#include <mgl_vector2.h>
公開メンバ関数 | |
| constexpr | Vector2 () noexcept |
| ゼロ初期化 | |
| constexpr | Vector2 (float inX, float inY) noexcept |
| 値を指定して初期化 | |
| constexpr Vector2 & | operator+= (const Vector2 &rhs) noexcept |
| 単項加算演算子 | |
| constexpr Vector2 & | operator-= (const Vector2 &rhs) noexcept |
| 単項減算演算子 | |
| constexpr Vector2 & | operator*= (float rhs) noexcept |
| 単項乗算演算子 | |
| constexpr Vector2 & | operator/= (float rhs) noexcept |
| 単項除算演算子 | |
| bool | IsZero () const noexcept |
| 値がほぼゼロかを調べる | |
| float | Length () const noexcept |
| 長さを求める | |
| float | Distance (const Vector2 &target) const noexcept |
| ターゲットまでの距離を求める | |
| float | Cross (const Vector2 &rhs) const noexcept |
| 外積を求める | |
| float | Dot (const Vector2 &rhs) const noexcept |
| 内積を求める | |
| float | GetAngle (const Vector2 &target) const noexcept |
| 2点間の角度を求める | |
| bool | Normalize () noexcept |
| ベクトルを正規化する | |
| void | Rotate (float radian) noexcept |
| ベクトルを回転 | |
静的公開メンバ関数 | |
| static float | Cross (const Vector2 &lhs, const Vector2 &rhs) noexcept |
| 外積を求める | |
| static float | Dot (const Vector2 &lhs, const Vector2 &rhs) noexcept |
| 内積を求める | |
公開変数類 | |
| float | x |
| X成分 | |
| float | y |
| Y成分 | |
2Dベクトル
|
inlineconstexprnoexcept |
値を指定して初期化
| [in] | inX | X成分 |
| [in] | inY | Y成分 |
|
inlinestaticnodiscardnoexcept |
外積を求める
| [in] | lhs | 左辺 |
| [in] | rhs | 右辺 |
|
inlinenodiscardnoexcept |
外積を求める
| [in] | rhs | 右辺 |
|
inlinenodiscardnoexcept |
ターゲットまでの距離を求める
| [in] | target | ターゲット |
|
inlinestaticnodiscardnoexcept |
内積を求める
| [in] | lhs | 左辺 |
| [in] | rhs | 右辺 |
|
inlinenodiscardnoexcept |
内積を求める
| [in] | rhs | 右辺 |
|
inlinenodiscardnoexcept |
2点間の角度を求める
| [in] | target | ターゲットの点 |
|
inlinenodiscardnoexcept |
値がほぼゼロかを調べる
| true | ほぼゼロ |
| false | ほぼゼロでない |
|
inlinenodiscardnoexcept |
長さを求める
|
inlinenoexcept |
ベクトルを正規化する
| true | 成功 |
| false | 失敗 |
|
inlinenoexcept |
ベクトルを回転
| [in] | radian | 回転角度 |