Raftel Engine
 
Loading...
Searching...
No Matches
Raftel::Vec2 Struct Reference

Represents a 2D vector with basic arithmetic operations. More...

#include <transform.hpp>

Public Member Functions

Vec2 operator+ (const Vec2 &other) const
 Adds two Vec2 vectors.
 
Vec2 operator* (float scalar) const
 Multiplies the vector by a scalar value.
 

Public Attributes

float x
 
float y
 The x and y components of the vector.
 

Detailed Description

Represents a 2D vector with basic arithmetic operations.

The Vec2 structure holds two floating-point values, x and y, and supports basic operations such as vector addition and scalar multiplication.

Definition at line 28 of file transform.hpp.

Member Function Documentation

◆ operator*()

Vec2 Raftel::Vec2::operator* ( float scalar) const
inline

Multiplies the vector by a scalar value.

This operator multiplies each component (x and y) of the vector by a scalar value.

Parameters
scalarThe scalar value to multiply the vector by.
Returns
A new Vec2 vector after multiplication.

Definition at line 50 of file transform.hpp.

◆ operator+()

Vec2 Raftel::Vec2::operator+ ( const Vec2 & other) const
inline

Adds two Vec2 vectors.

This operator adds the x and y components of two Vec2 vectors and returns a new vector.

Parameters
otherThe other vector to add.
Returns
A new Vec2 vector representing the sum of the two vectors.

Definition at line 40 of file transform.hpp.

Member Data Documentation

◆ x

float Raftel::Vec2::x

Definition at line 30 of file transform.hpp.

◆ y

float Raftel::Vec2::y

The x and y components of the vector.

Definition at line 30 of file transform.hpp.


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