Elaztek Developer Hub
Blamite Game Engine - Strings  00390.07.02.23.1947.blamite
A library containing general purpose utilities and classes for use in multiple projects.
BlamVector2 Struct Reference

Structure representing a 2D vector. More...

#include <vector.h>

Public Member Functions

 BlamVector2 ()
 
 BlamVector2 (float _x, float _y)
 
std::string ToString ()
 Converts the vector to a string, with each value separated by commas. More...
 
BlamVector2 operator+ (const BlamVector2 &vector)
 Combines the values of two 2D vectors. More...
 
BlamVector2 operator+ (const float &_float)
 Adds a float value to the X and Y values of the vector. More...
 
BlamVector2 operator* (const BlamVector2 &vector)
 Multiplies the values of two 2D vectors. More...
 
BlamVector2 operator* (const float &_float)
 Multiplies the X and Y values of the vector by a float value. More...
 

Public Attributes

float x = 0.0f
 The X-coordinate of the 2D vector, representing horizontal position. More...
 
float y = 0.0f
 The Y-coordinate of the 2D vector, representing vertical position. More...
 

Detailed Description

Structure representing a 2D vector.

Constructor & Destructor Documentation

◆ BlamVector2() [1/2]

BlamVector2::BlamVector2 ( )
inline

◆ BlamVector2() [2/2]

BlamVector2::BlamVector2 ( float  _x,
float  _y 
)

Member Function Documentation

◆ operator*() [1/2]

BlamVector2 BlamVector2::operator* ( const BlamVector2 vector)

Multiplies the values of two 2D vectors.

Parameters
vector- The vector to multiply the current vector by.
Returns
A new vector with the X and Y values from both vectors multiplied.

◆ operator*() [2/2]

BlamVector2 BlamVector2::operator* ( const float &  _float)

Multiplies the X and Y values of the vector by a float value.

Parameters
_float- The float value to multiply the vector values by.
Returns
A new vector, with both values multiplied by the float value.

◆ operator+() [1/2]

BlamVector2 BlamVector2::operator+ ( const BlamVector2 vector)

Combines the values of two 2D vectors.

Parameters
vector- The vector to combine with the current vector.
Returns
A new vector with the X and Y values from both vectors combined.

◆ operator+() [2/2]

BlamVector2 BlamVector2::operator+ ( const float &  _float)

Adds a float value to the X and Y values of the vector.

Parameters
_float- The float value to add to the vector.
Returns
A new vector, with both values increased by the float value.

◆ ToString()

std::string BlamVector2::ToString ( )

Converts the vector to a string, with each value separated by commas.

Returns
A string representing the vector in x,y format.
+ Here is the call graph for this function:

Member Data Documentation

◆ x

float BlamVector2::x = 0.0f

The X-coordinate of the 2D vector, representing horizontal position.

◆ y

float BlamVector2::y = 0.0f

The Y-coordinate of the 2D vector, representing vertical position.


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