#include <muu/sat_tester.h>
template <typename Scalar, size_t Dimensions>
sat_tester struct
A helper utility for performing Separating-Axis Theorem tests.
Template parameters | |
---|---|
Scalar | The vector scalar component type. |
Dimensions | The number of dimensions. |
Public types
- using scalar_type = Scalar
- The sat_
tester's scalar type. -
using vector_type = vector<scalar_
type, Dimensions> - The sat_
tester's vector type.
Public static variables
- static size_t dimensions constexpr
- The number of dimensions represented by this sat_
tester's vector_type.
Constructors, destructors, conversion operators
- sat_tester() constexpr noexcept
- Default constructor.
-
sat_tester(scalar_
type min_max) explicit constexpr noexcept - Initializes the SAT test projection range bounds to a specific value.
-
template <typename... T>sat_tester(const vector_
type& axis, const vector_ type& point, const T&... points) constexpr noexcept - Initializes the SAT test projection range directly from one or more points.
-
template <size_t Dimension, typename... T>sat_tester(index_
tag<Dimension>, const vector_ type& point, const T&... points) constexpr noexcept - Initializes the SAT test projection range directly from one or more points.
-
template <size_t N>sat_tester(const vector_
type& axis, const vector_ type(&points)[N]) constexpr noexcept - Initializes the SAT test projection range directly from an array of points.
-
sat_tester(index_
tag<Dimension>, const vector_ type(&points)[N]) constexpr noexcept - Initializes the SAT test projection range directly from an array of points.
Public functions
-
template <typename... T>auto add(const vector_
type& axis, const vector_ type& point, const T&... points) -> sat_ tester& constexpr noexcept - Adds one or more points to the SAT test projection range.
-
template <size_t Dimension, typename... T>auto add(index_
tag<Dimension>, const vector_ type& point, const T&... points) -> sat_ tester& constexpr noexcept - Adds one or more points to the SAT test projection range.
-
template <size_t N>auto add(const vector_
type& axis, const vector_ type(&points)[N]) -> sat_ tester& constexpr noexcept - Adds an array of points to the SAT test projection range.
-
auto add(const vector_
type& axis, const vector_ type* begin, const vector_ type* end) -> sat_ tester& constexpr noexcept - Adds a range of points to the SAT test projection range.
-
template <size_t Dimension>auto add(index_
tag<Dimension>, const vector_ type* begin, const vector_ type* end) -> sat_ tester& constexpr noexcept - Adds a range of points to the SAT test projection range.
-
auto operator()(scalar_
type val) -> bool constexpr noexcept - Returns true if the SAT test projection range seen so far contains the given value.
-
auto operator()(scalar_
type min_val, scalar_ type max_val) -> bool constexpr noexcept - Returns true if the SAT test projection range seen so far overlaps the given range.
-
auto operator()(const sat_
tester& other) -> bool constexpr noexcept - Returns true if the SAT test projection range seen so far overlaps that of another sat_
tester. -
auto reset() -> sat_
tester& constexpr noexcept - Resets the SAT tester to the default-constructed state.
Public variables
-
scalar_
type min - The minimum projection seen so far.
-
scalar_
type max - The maximum projection seen so far.