struct

Vec2

Module
Math
Header
#include "Math/Vec2.h"
Namespace
Mowo

Properties

TypeNameDescription
float x,y

Constructors

SignatureNameDescription
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

ReturnsNameDescription
Vec2operator+
Vec2operator-
Vec2operator*
Vec2operator/
Vec2operator-
Vec2&operator+=
Vec2&operator-=
Vec2&operator*=
Vec2&operator/=
booloperator==
booloperator!=
floatLength
floatLengthSquared
Vec2Normalized
voidNormalize
floatDot
floatCrossCross product returns scalar (z-component of 3D cross)
Vec2Zero
Vec2One
Vec2Up
Vec2Down
Vec2Left
Vec2Right

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) const

operator-

C++
Vec2 operator-(const Vec2& other) const

operator*

C++
Vec2 operator*(float scalar) const

operator/

C++
Vec2 operator/(float scalar) const

operator-

C++
Vec2 operator-() const

operator+=

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) const

operator!=

C++
bool operator!=(const Vec2& other) const

Length

C++
float Length() const

LengthSquared

C++
float LengthSquared() const

Normalized

C++
Vec2 Normalized() const

Normalize

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()
C++
static Vec2 Right()
Generated from Math/Vec2.h via math.json · Nov 4, 2026Version 1.0.0