Struct barycentric_t

Nested Relationships

Nested Types

Struct Documentation

struct barycentric_t

Represents a barycentric coordinate in a triangle.

Public Functions

constexpr barycentric_t() noexcept = default
inline explicit constexpr barycentric_t(vec2_t bary) noexcept
constexpr barycentric_t(const barycentric_t&) noexcept = default
constexpr barycentric_t &operator=(const barycentric_t&) noexcept = default
inline constexpr operator bool() const noexcept
inline constexpr bool operator!() const noexcept
inline constexpr vec3_t coords() const noexcept
template<typename T>
inline auto operator()(const T &a, const T &b, const T &c) const noexcept

Computes the interpolated triangle value.

Parameters:
  • a – triangle’s attribute 1

  • b – triangle’s attribute 2

  • c – triangle’s attribute 3

inline triangle_point_t operator()(const mesh::triangle_t &tri) const noexcept

Computes the interpolated position, (normalized) normal and uv of a triangle.

Parameters:

tri – triangle

Public Members

vec2_t bary = {-1, -1}
struct triangle_point_t

Convenience structure for interpolating triangle vertex data using the barycentric coordinate.

Public Members

pqvec3_t p
dir3_t n
vec2_t uv
vec2_t bary