Vivid
Loading...
Searching...
No Matches
Vivid::Maths::Vec2 Struct Reference

Contains a 2D vector. More...

#include <Vec.h>

Public Member Functions

 Vec2 (float x, float y)
 
Vec2 operator* (float scalar)
 
Vec2 operator* (double scalar)
 
Vec2 operator+ (Vec2 other)
 
Vec2 operator- (Vec2 other)
 
Vec2 Perpendicular ()
 
Vec2 Normalize ()
 

Public Attributes

float x
 
float y
 

Detailed Description

Contains a 2D vector.

Vec2 is a struct that contains a 2D vector. It contains x and y values. This can be used for many purposes like texture coordinates, 2D coordinates etc. And supports many operations like addition, multiplication, etc.

Definition at line 107 of file Vec.h.

Constructor & Destructor Documentation

◆ Vec2() [1/2]

Vivid::Maths::Vec2::Vec2 ( )
inline

Definition at line 111 of file Vec.h.

◆ Vec2() [2/2]

Vivid::Maths::Vec2::Vec2 ( float  x,
float  y 
)
inline

Definition at line 117 of file Vec.h.

Member Function Documentation

◆ Normalize()

Vec2 Vivid::Maths::Vec2::Normalize ( )
inline

Definition at line 133 of file Vec.h.

◆ operator*() [1/2]

Vec2 Vivid::Maths::Vec2::operator* ( double  scalar)
inline

Definition at line 125 of file Vec.h.

◆ operator*() [2/2]

Vec2 Vivid::Maths::Vec2::operator* ( float  scalar)
inline

Definition at line 123 of file Vec.h.

◆ operator+()

Vec2 Vivid::Maths::Vec2::operator+ ( Vec2  other)
inline

Definition at line 127 of file Vec.h.

◆ operator-()

Vec2 Vivid::Maths::Vec2::operator- ( Vec2  other)
inline

Definition at line 129 of file Vec.h.

◆ Perpendicular()

Vec2 Vivid::Maths::Vec2::Perpendicular ( )
inline

Definition at line 131 of file Vec.h.

Member Data Documentation

◆ x

float Vivid::Maths::Vec2::x

Definition at line 109 of file Vec.h.

◆ y

float Vivid::Maths::Vec2::y

Definition at line 109 of file Vec.h.


The documentation for this struct was generated from the following file: