Overload  1.1
Game engine with editor
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
OvMaths::FVector2 Struct Reference

#include <FVector2.h>

Public Member Functions

 FVector2 (float p_x=0.0f, float p_y=0.0f)
 
 FVector2 (const FVector2 &p_toCopy)
 
 FVector2 (FVector2 &&p_toMove) noexcept=default
 
FVector2 operator- () const
 
FVector2 operator= (const FVector2 &p_other)
 
FVector2 operator+ (const FVector2 &p_other) const
 
FVector2operator+= (const FVector2 &p_other)
 
FVector2 operator- (const FVector2 &p_other) const
 
FVector2operator-= (const FVector2 &p_other)
 
FVector2 operator* (float p_scalar) const
 
FVector2operator*= (float p_scalar)
 
FVector2 operator/ (float p_scalar) const
 
FVector2operator/= (float p_scalar)
 
bool operator== (const FVector2 &p_other)
 
bool operator!= (const FVector2 &p_other)
 

Static Public Member Functions

static FVector2 Add (const FVector2 &p_left, const FVector2 &p_right)
 
static FVector2 Substract (const FVector2 &p_left, const FVector2 &p_right)
 
static FVector2 Multiply (const FVector2 &p_target, float p_scalar)
 
static FVector2 Divide (const FVector2 &p_left, float p_scalar)
 
static float Length (const FVector2 &p_target)
 
static float Dot (const FVector2 &p_left, const FVector2 &p_right)
 
static FVector2 Normalize (const FVector2 &p_target)
 
static FVector2 Lerp (const FVector2 &p_start, const FVector2 &p_end, float p_alpha)
 
static float AngleBetween (const FVector2 &p_from, const FVector2 &p_to)
 

Public Attributes

float x
 
float y
 

Static Public Attributes

static const FVector2 One
 
static const FVector2 Zero
 

Detailed Description

Mathematic representation of a 2D vector of floats

Constructor & Destructor Documentation

◆ FVector2() [1/3]

OvMaths::FVector2::FVector2 ( float  p_x = 0.0f,
float  p_y = 0.0f 
)

Default constructor

Parameters
p_x
p_y

◆ FVector2() [2/3]

OvMaths::FVector2::FVector2 ( const FVector2 p_toCopy)

Copy constructor

Parameters
p_toCopy

◆ FVector2() [3/3]

OvMaths::FVector2::FVector2 ( FVector2 &&  p_toMove)
defaultnoexcept

Move constructor

Parameters
p_toMove

Member Function Documentation

◆ Add()

OvMaths::FVector2 OvMaths::FVector2::Add ( const FVector2 p_left,
const FVector2 p_right 
)
static

Calculate the sum of two vectors

Parameters
p_left(First vector)
p_right(Second vector)

◆ AngleBetween()

float OvMaths::FVector2::AngleBetween ( const FVector2 p_from,
const FVector2 p_to 
)
static

Calculate the angle between two vectors

Parameters
p_from
p_to

◆ Divide()

OvMaths::FVector2 OvMaths::FVector2::Divide ( const FVector2 p_left,
float  p_scalar 
)
static

Divide scalar to vector left

Parameters
p_left
p_scalar

◆ Dot()

float OvMaths::FVector2::Dot ( const FVector2 p_left,
const FVector2 p_right 
)
static

Return the dot product of two vectors

Parameters
p_left
p_right

◆ Length()

float OvMaths::FVector2::Length ( const FVector2 p_target)
static

Return the length of a vector

Parameters
p_target

◆ Lerp()

OvMaths::FVector2 OvMaths::FVector2::Lerp ( const FVector2 p_start,
const FVector2 p_end,
float  p_alpha 
)
static

Calculate the interpolation between two vectors

Parameters
p_start
p_end
p_alpha

◆ Multiply()

OvMaths::FVector2 OvMaths::FVector2::Multiply ( const FVector2 p_target,
float  p_scalar 
)
static

Calculate the multiplication of a vector with a scalar

Parameters
p_target
p_scalar

◆ Normalize()

OvMaths::FVector2 OvMaths::FVector2::Normalize ( const FVector2 p_target)
static

Return the normalize of the given vector

Parameters
p_target

◆ operator!=()

bool OvMaths::FVector2::operator!= ( const FVector2 p_other)

Return true if the two vectors are different

Parameters
p_other

◆ operator*()

OvMaths::FVector2 OvMaths::FVector2::operator* ( float  p_scalar) const

Calcualte the multiplication of a vector with a scalar

Parameters
p_scalar

◆ operator*=()

OvMaths::FVector2 & OvMaths::FVector2::operator*= ( float  p_scalar)

Multiply the vector by a scalar

Parameters
p_scalar

◆ operator+()

OvMaths::FVector2 OvMaths::FVector2::operator+ ( const FVector2 p_other) const

Calculate the sum of two vectors

Parameters
p_other

◆ operator+=()

OvMaths::FVector2 & OvMaths::FVector2::operator+= ( const FVector2 p_other)

Add the right vector to the left one

Parameters
p_other

◆ operator-() [1/2]

OvMaths::FVector2 OvMaths::FVector2::operator- ( ) const

Negation

◆ operator-() [2/2]

OvMaths::FVector2 OvMaths::FVector2::operator- ( const FVector2 p_other) const

Calculate the substraction of two vectors

Parameters
p_other

◆ operator-=()

OvMaths::FVector2 & OvMaths::FVector2::operator-= ( const FVector2 p_other)

Remove the right vector from the left one

Parameters
p_other

◆ operator/()

OvMaths::FVector2 OvMaths::FVector2::operator/ ( float  p_scalar) const

Return the division of scalar and actual vector

Parameters
p_scalar

◆ operator/=()

OvMaths::FVector2 & OvMaths::FVector2::operator/= ( float  p_scalar)

Divide scalar to the actual vector

Parameters
p_scalar

◆ operator=()

OvMaths::FVector2 OvMaths::FVector2::operator= ( const FVector2 p_other)

Copy assignment

Parameters
p_other

◆ operator==()

bool OvMaths::FVector2::operator== ( const FVector2 p_other)

Return true if the two vectors are equals

Parameters
p_other

◆ Substract()

OvMaths::FVector2 OvMaths::FVector2::Substract ( const FVector2 p_left,
const FVector2 p_right 
)
static

Calculate the substraction of two vectors

Parameters
p_left(First vector)
p_right(Second vector)

Member Data Documentation

◆ One

const OvMaths::FVector2 OvMaths::FVector2::One
static

@project: Overload

Author
: Overload Tech. @restrictions: This software may not be resold, redistributed or otherwise conveyed to a third party.

◆ x

float OvMaths::FVector2::x

◆ y

float OvMaths::FVector2::y

◆ Zero

const OvMaths::FVector2 OvMaths::FVector2::Zero
static

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