vec4.ixx File
4D vector type and utilities. More...
Included Headers
#include <cassert>
#include <memory>
#include <cstddef>
#include <helios.math.types:vec3>
#include <helios.math.concepts>
Namespaces Index
| namespace | helios |
| namespace | math |
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:
19export namespace helios::math {
47 constexpr vec4() noexcept : v{static_cast<T>(0), static_cast<T>(0), static_cast<T>(0), static_cast<T>(0)} {}
82 explicit constexpr vec4(const vec3<T>& vec) noexcept : v{vec[0], vec[1], vec[2], static_cast<T>(1)} {}
95 return helios::math::vec4<T>{v[0], v[1], v[2], w};
106 constexpr const T& operator[](const size_t i) const noexcept {
120 constexpr T& operator[](const size_t i) noexcept {
146 template<helios::math::concepts::IsNumeric T>
148 return vec3<T>{v[0], v[1], v[2]};
152 inline vec2<T> vec4<T>::toVec2() const noexcept {
153 return vec2<T>{v[0], v[1]};
168 return vec4<T>{v[0] * n, v[1] * n, v[2] * n, v[3] * n};
186 using vec4f = vec4<float>;
191 using vec4d = vec4<double>;
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.