|
| | Vec2 ()=default |
| |
| | Vec2 (float x, float y) |
| | Creates a vector from components.
|
| |
| float | getX () const |
| | Component accessors.
|
| |
| float | getY () const |
| |
| void | setX (float x) |
| |
| void | setY (float y) |
| |
| void | set (float x, float y) |
| | Sets both components.
|
| |
| float | length () const |
| | Magnitude (and squared magnitude).
|
| |
| float | lengthSquared () const |
| |
| void | normalize () |
| | Normalizes in place / returns a normalized copy.
|
| |
| Vec2 * | normalized () const |
| |
| float | dot (const Vec2 *other) const |
| | Dot/cross product, distance, angle (radians).
|
| |
| float | cross (const Vec2 *other) const |
| |
| float | distanceTo (const Vec2 *other) const |
| |
| float | angle () const |
| |
| Vec2 * | add (const Vec2 *other) const |
| | Arithmetic helpers returning new (caller-owned) vectors.
|
| |
| Vec2 * | sub (const Vec2 *other) const |
| |
| Vec2 * | scale (float s) const |
| |
| Vec2 * | lerpTo (const Vec2 *other, float t) const |
| | Linear interpolation to other at t in [0,1].
|
| |
| Vec2 * | clone () const |
| | Copies this vector.
|
| |
2D float vector (script-facing math module value).
在文件 Vec2.h 第 8 行定义.