|
template<scalar Other = value_type>
requires (Size > 1u) |
| constexpr | basic_vector (Other value=Other{0}) noexcept |
| | Constructs a vector with all components initialized to a value. More...
|
| |
template<scalar Other = value_type>
requires (Size > 1u) |
| constexpr | basic_vector (const basic_vector< Size, Other > &other) noexcept |
| | Constructs a vector from another vector with convertible scalar type. More...
|
| |
|
constexpr | basic_vector (const basic_vector &other) noexcept=default |
| |
|
constexpr | basic_vector (basic_vector &&other) noexcept=default |
| |
|
auto | operator= (const basic_vector &other) noexcept -> basic_vector &=default |
| |
|
auto | operator= (basic_vector &&other) noexcept -> basic_vector &=default |
| |
| constexpr auto | data () noexcept -> value_type * |
| | Returns a pointer to the underlying contiguous storage. More...
|
| |
| constexpr auto | data () const noexcept -> const value_type * |
| | Returns a pointer to the underlying contiguous storage (const). More...
|
| |
| constexpr auto | operator[] (size_type index) noexcept -> reference |
| | Accesses a component by index. More...
|
| |
| constexpr auto | operator[] (size_type index) const noexcept -> const_reference |
| | Accesses a component by index (const). More...
|
| |
template<scalar Other>
requires (Size > 1u) |
| constexpr auto | operator+= (const basic_vector< Size, Other > &other) noexcept -> basic_vector & |
| | Adds another vector to this vector. More...
|
| |
template<scalar Other>
requires (Size > 1u) |
| constexpr auto | operator-= (const basic_vector< Size, Other > &other) noexcept -> basic_vector & |
| | Subtracts another vector from this vector. More...
|
| |
template<scalar Other>
requires (Size > 1u) |
| constexpr auto | operator*= (Other scalar) noexcept -> basic_vector & |
| | Multiplies this vector by a scalar. More...
|
| |
template<scalar Other>
requires (Size > 1u) |
| constexpr auto | operator*= (const basic_vector< Size, Other > &other) noexcept -> basic_vector & |
| | Multiplies this vector component-wise by another vector. More...
|
| |
template<scalar Other>
requires (Size > 1u) |
| constexpr auto | operator/= (Other scalar) noexcept -> basic_vector & |
| | Divides this vector by a scalar. More...
|
| |
| constexpr auto | length_squared () const noexcept -> length_type |
| | Returns the squared length of the vector. More...
|
| |
| constexpr auto | length () const noexcept -> length_type |
| | Returns the length of the vector. More...
|
| |
| constexpr auto | normalize () noexcept -> basic_vector & |
| | Normalizes the vector in-place. More...
|
| |
|
| static constexpr auto | min (const basic_vector &vector) noexcept -> value_type |
| | Returns the minimum component of a vector. More...
|
| |
template<scalar Lhs = value_type, scalar Rhs = value_type>
requires (Size > 1u) |
| static constexpr auto | min (const basic_vector< Size, Lhs > &lhs, const basic_vector< Size, Rhs > &rhs) noexcept -> basic_vector |
| | Returns the component-wise minimum of two vectors. More...
|
| |
| static constexpr auto | max (const basic_vector &vector) noexcept -> value_type |
| | Returns the maximum component of a vector. More...
|
| |
template<scalar Lhs = value_type, scalar Rhs = value_type>
requires (Size > 1u) |
| static constexpr auto | max (const basic_vector< Size, Lhs > &lhs, const basic_vector< Size, Rhs > &rhs) noexcept -> basic_vector |
| | Returns the component-wise maximum of two vectors. More...
|
| |
template<scalar Lhs = value_type>
requires (Size > 1u) |
| static constexpr auto | abs (const basic_vector< Size, Lhs > &vector) noexcept -> basic_vector |
| | Returns the component-wise absolute value of a vector. More...
|
| |
template<size_type Axis, scalar Other = value_type>
requires (Axis < Size) |
| static constexpr auto | splat (const basic_vector< Size, Other > &vector) noexcept -> basic_vector< Size, Other > |
| | Splat a single component across all axes. More...
|
| |
| static constexpr auto | lerp (const basic_vector &x, const basic_vector &y, const value_type a) noexcept -> basic_vector |
| | Linearly interpolates between two vectors. More...
|
| |
template<std::size_t Size, scalar Type>
requires (Size > 1u)
class sbx::math::basic_vector< Size, Type >
Fixed-size vector type.
- Template Parameters
-
| Size | Component count. |
| Type | Scalar component type. |