Wildvine Engine
Referencia Doxygen del codigo propio de Wildvine Engine.
Cargando...
Buscando...
Nada coincide
Referencia de la clase EU::Vector2

A 2D vector class. Más...

#include <Vector2.h>

Métodos públicos

const float * data () const
 Returns a pointer to the quaternion's data.
 
float magnitude () const
 Calculates the magnitude (length) of the vector.
 
Vector2 normalize () const
 Normalizes the vector.
 
Vector2 operator* (float scalar) const
 Multiplies this vector by a scalar.
 
Vector2 operator+ (const Vector2 &other) const
 Adds another vector to this vector.
 
Vector2 operator- (const Vector2 &other) const
 Subtracts another vector from this vector.
 
 Vector2 ()
 Default constructor.
 
 Vector2 (float x, float y)
 Parameterized constructor.
 

Atributos públicos

float x
 The x-coordinate of the vector.
 
float y
 The y-coordinate of the vector.
 

Descripción detallada

This class represents a vector in 2-dimensional space and provides basic vector operations such as addition, subtraction, scalar multiplication, and normalization.

Definición en la línea 44 del archivo Vector2.h.

Documentación de constructores y destructores

◆ Vector2() [1/2]

EU::Vector2::Vector2 ( )
inline

Initializes the vector to (0, 0).

Definición en la línea 55 del archivo Vector2.h.

Referenciado por normalize(), operator*(), operator+() y operator-().

◆ Vector2() [2/2]

EU::Vector2::Vector2 ( float  x,
float  y 
)
inline

Initializes the vector to the given x and y values.

Parámetros
xThe x-coordinate.
yThe y-coordinate.

Definición en la línea 65 del archivo Vector2.h.

Documentación de funciones miembro

◆ data()

const float * EU::Vector2::data ( ) const
inline
Devuelve
Pointer to the first element (x, y, z).

Definición en la línea 129 del archivo Vector2.h.

Hace referencia a x.

◆ magnitude()

float EU::Vector2::magnitude ( ) const
inline
Devuelve
The magnitude of the vector.

Definición en la línea 106 del archivo Vector2.h.

Hace referencia a EU::sqrt(), x y y.

Referenciado por normalize().

◆ normalize()

Vector2 EU::Vector2::normalize ( ) const
inline
Devuelve
The normalized vector.

Definición en la línea 116 del archivo Vector2.h.

Hace referencia a magnitude(), Vector2(), x y y.

◆ operator*()

Vector2 EU::Vector2::operator* ( float  scalar) const
inline
Parámetros
scalarThe scalar to multiply by.
Devuelve
The result of the multiplication.

Definición en la línea 96 del archivo Vector2.h.

Hace referencia a Vector2(), x y y.

◆ operator+()

Vector2 EU::Vector2::operator+ ( const Vector2 other) const
inline
Parámetros
otherThe vector to add.
Devuelve
The result of the addition.

Definición en la línea 74 del archivo Vector2.h.

Hace referencia a Vector2(), x y y.

◆ operator-()

Vector2 EU::Vector2::operator- ( const Vector2 other) const
inline
Parámetros
otherThe vector to subtract.
Devuelve
The result of the subtraction.

Definición en la línea 85 del archivo Vector2.h.

Hace referencia a Vector2(), x y y.

Documentación de datos miembro

◆ x

float EU::Vector2::x

◆ y

float EU::Vector2::y

La documentación de esta clase está generada del siguiente archivo: