struct
Vec2
- Module
- Math
- Header
#include "Math/Vec2.h"- Namespace
Mowo
Properties
| Type | Name | Description |
|---|---|---|
float x, | y |
Constructors
| Signature | Name | Description |
|---|---|---|
Vec2() : x(0), y(0) | Vec2 | |
Vec2(float x, float y) : x(x), y(y) | Vec2 | |
explicit Vec2(float scalar) : x(scalar), y(scalar) | Vec2 |
Public functions
| Returns | Name | Description |
|---|---|---|
Vec2 | operator+ | |
Vec2 | operator- | |
Vec2 | operator* | |
Vec2 | operator/ | |
Vec2 | operator- | |
Vec2& | operator+= | |
Vec2& | operator-= | |
Vec2& | operator*= | |
Vec2& | operator/= | |
bool | operator== | |
bool | operator!= | |
float | Length | |
float | LengthSquared | |
Vec2 | Normalized | |
void | Normalize | |
float | Dot | |
float | Cross | Cross product returns scalar (z-component of 3D cross) |
Vec2 | Zero | |
Vec2 | One | |
Vec2 | Up | |
Vec2 | Down | |
Vec2 | Left | |
Vec2 | Right |
Function details
Vec2
C++
Vec2() : x(0), y(0)Vec2
C++
Vec2(float x, float y) : x(x), y(y)Vec2
C++
explicit Vec2(float scalar) : x(scalar), y(scalar)operator+
C++
Vec2 operator+(const Vec2& other) constoperator-
C++
Vec2 operator-(const Vec2& other) constoperator*
C++
Vec2 operator*(float scalar) constoperator/
C++
Vec2 operator/(float scalar) constoperator-
C++
Vec2 operator-() constoperator+=
C++
Vec2& operator+=(const Vec2& other)operator-=
C++
Vec2& operator-=(const Vec2& other)operator*=
C++
Vec2& operator*=(float scalar)operator/=
C++
Vec2& operator/=(float scalar)operator==
C++
bool operator==(const Vec2& other) constoperator!=
C++
bool operator!=(const Vec2& other) constLength
C++
float Length() constLengthSquared
C++
float LengthSquared() constNormalized
C++
Vec2 Normalized() constNormalize
C++
void Normalize()Dot
C++
static float Dot(const Vec2& a, const Vec2& b)Cross
C++
static float Cross(const Vec2& a, const Vec2& b)Cross product returns scalar (z-component of 3D cross)
Zero
C++
static Vec2 Zero()One
C++
static Vec2 One()Up
C++
static Vec2 Up()Down
C++
static Vec2 Down()Left
C++
static Vec2 Left()Right
C++
static Vec2 Right()Generated from Math/Vec2.h via math.json · Nov 4, 2026Version 1.0.0