vec4.ixx File
4D vector type and utilities. More...
Included Headers
#include <cassert>
#include <memory>
#include <helios.math.types:vec3>
#include <helios.math.concepts>
Namespaces Index
| namespace | helios |
| namespace | math |
|
Mathematical operations and types. More... | |
Classes Index
| struct | vec4<T> |
|
Represents a 4-dimensional vector of the generic type <T>. More... | |
Description
4D vector type and utilities.
File Listing
The file content with the documentation metadata removed is:
18export namespace helios::math {
21 struct vec4;
46 constexpr vec4() noexcept : v{static_cast<T>(0), static_cast<T>(0), static_cast<T>(0), static_cast<T>(0)} {}
81 explicit constexpr vec4(const vec3<T>& vec) noexcept : v{vec[0], vec[1], vec[2], static_cast<T>(1)} {}
94 return helios::math::vec4<T>{v[0], v[1], v[2], w};
105 constexpr const T& operator[](const size_t i) const noexcept {
119 constexpr T& operator[](const size_t i) noexcept {
147 return vec3<T>{v[0], v[1], v[2]};
151 inline vec2<T> vec4<T>::toVec2() const noexcept {
152 return vec2<T>{v[0], v[1]};
171 using vec4f = vec4<float>;
176 using vec4d = vec4<double>;
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.