guillaume 1.0.0
Guillaume is a component-based UI framework library built around a primitive rendering system. It's designed for building user interfaces across XR platforms and traditional platforms with custom rendering backends and input handling. The framework is lightweight, flexible, and easy to integrate into existing projects.
|
A generic N-dimensional vector class template. More...
#include <vector.hpp>
Public Member Functions | |
Vector () | |
Default constructor - initializes all components to zero. | |
Vector (std::initializer_list< Type > values) | |
Constructor from initializer list. | |
Type & | operator[] (size_t index) |
Non-const element access operator. | |
const Type & | operator[] (size_t index) const |
Const element access operator. | |
Vector | operator+ (const Vector &other) const |
Vector addition operator. | |
Vector | operator- (const Vector &other) const |
Vector subtraction operator. | |
Vector | operator* (Type scalar) const |
Scalar multiplication operator. | |
Type | dot (const Vector &other) const |
Compute dot product with another vector. | |
Type | magnitude () const |
Calculate the magnitude (length) of the vector. | |
Vector | normalize () const |
Create a normalized (unit) vector. | |
constexpr size_t | size () const |
Get the number of dimensions/components. | |
A generic N-dimensional vector class template.
This class provides a mathematical vector implementation with support for basic vector operations including addition, subtraction, scalar multiplication, dot product, magnitude calculation, and normalization.
Type | The numeric type of vector components (e.g., float, double, int) |
Dimension | The number of dimensions/components in the vector |
Definition at line 39 of file vector.hpp.
Default constructor - initializes all components to zero.
Definition at line 47 of file vector.hpp.
|
inline |
Constructor from initializer list.
Initializes vector components from the provided values. If fewer values are provided than the dimension, remaining components are zero-initialized. Extra values beyond the dimension are ignored.
values | Initializer list of component values |
Definition at line 58 of file vector.hpp.
|
inline |
Compute dot product with another vector.
other | The vector to compute the dot product with |
Definition at line 132 of file vector.hpp.
|
inline |
Calculate the magnitude (length) of the vector.
Definition at line 145 of file vector.hpp.
|
inline |
Create a normalized (unit) vector.
Returns a vector with the same direction but magnitude of 1. If the vector has zero magnitude, returns the original vector unchanged.
Definition at line 155 of file vector.hpp.
|
inline |
Scalar multiplication operator.
scalar | The scalar value to multiply each component by |
Definition at line 118 of file vector.hpp.
|
inline |
Vector addition operator.
other | The vector to add to this vector |
Definition at line 90 of file vector.hpp.
|
inline |
Vector subtraction operator.
other | The vector to subtract from this vector |
Definition at line 104 of file vector.hpp.
|
inline |
Non-const element access operator.
index | The index of the component to access |
Definition at line 73 of file vector.hpp.
|
inline |
Const element access operator.
index | The index of the component to access |
Definition at line 81 of file vector.hpp.
|
inlineconstexpr |
Get the number of dimensions/components.
Definition at line 165 of file vector.hpp.