CLASS v1.8.0

Vec2

kn::Vec2

Declared in kraken/math/Math.hpp

Reference

C++ API

x

variable
double x = 0.0

No description in the source header.

y

variable
double y = 0.0

No description in the source header.

Vec2

function3 overloads
Vec2()=default
template <typename T>
Vec2(T value)
template <typename T>
Vec2(T x, T y)

No description in the source header.

~Vec2

function
~Vec2()=default

No description in the source header.

copy

function
Vec2 copy() const

No description in the source header.

isZero

function
bool isZero(double tolerance=1e-8) const

No description in the source header.

getLength

function
double getLength() const

No description in the source header.

double getLengthSquared() const

No description in the source header.

getAngle

function
double getAngle() const

No description in the source header.

rotate

function
void rotate(double rad)

No description in the source header.

rotated

function
Vec2 rotated(double rad) const

No description in the source header.

toPolar

function
PolarCoordinate toPolar() const

No description in the source header.

void scaleToLength(double scalar)

No description in the source header.

Vec2 scaledToLength(double scalar) const

No description in the source header.

project

function
Vec2 project(const Vec2 &other) const

No description in the source header.

reject

function
Vec2 reject(const Vec2 &other) const

No description in the source header.

reflect

function
Vec2 reflect(const Vec2 &other) const

No description in the source header.

normalize

function
void normalize()

No description in the source header.

normalized

function
Vec2 normalized() const

No description in the source header.

distanceTo

function
double distanceTo(const Vec2 &other) const

No description in the source header.

double distanceSquaredTo(const Vec2 &other) const

No description in the source header.

moveToward

function
void moveToward(const Vec2 &target, double maxStep)

No description in the source header.

movedToward

function
Vec2 movedToward(const Vec2 &target, double maxStep) const

No description in the source header.

floor

function
void floor()

No description in the source header.

floored

function
Vec2 floored() const

No description in the source header.

ceil

function
void ceil()

No description in the source header.

ceiled

function
Vec2 ceiled() const

No description in the source header.

round

function
void round()

No description in the source header.

rounded

function
Vec2 rounded() const

No description in the source header.

slide

function
void slide(const Vec2 &normal)

No description in the source header.

slid

function
Vec2 slid(const Vec2 &normal) const

No description in the source header.

operator-

function2 overloads
Vec2 operator-() const
Vec2 operator-(const Vec2 &other) const

No description in the source header.

operator+

function
Vec2 operator+(const Vec2 &other) const

No description in the source header.

operator*

function2 overloads
Vec2 operator*(const Vec2 &other) const
Vec2 operator*(double scalar) const

No description in the source header.

operator/

function2 overloads
Vec2 operator/(const Vec2 &other) const
Vec2 operator/(double scalar) const

No description in the source header.

operator+=

function
Vec2 & operator+=(const Vec2 &other)

No description in the source header.

operator-=

function
Vec2 & operator-=(const Vec2 &other)

No description in the source header.

operator*=

function2 overloads
Vec2 & operator*=(const Vec2 &other)
Vec2 & operator*=(double scalar)

No description in the source header.

operator/=

function2 overloads
Vec2 & operator/=(const Vec2 &other)
Vec2 & operator/=(double scalar)

No description in the source header.

operator==

function
bool operator==(const Vec2 &other) const

No description in the source header.

operator!=

function
bool operator!=(const Vec2 &other) const

No description in the source header.

operator bool() const

No description in the source header.

operator SDL_Point() const

No description in the source header.

operator SDL_FPoint() const

No description in the source header.

operator b2Vec2() const

No description in the source header.

std::ostream & operator<<(std::ostream &os, const Vec2 &v)

No description in the source header.

Find your next step

Start typing to search the manual.