HighMap library (C++)
Loading...
Searching...
No Matches
hmap::UvRect Struct Reference

Axis-aligned rectangle in normalized [0, 1]^2 domain/UV space. More...

#include <uv_rect.hpp>

Public Member Functions

constexpr UvRect ()=default
constexpr UvRect (float u0, float u1, float v0, float v1)
constexpr UvRect (const glm::vec4 &v)
constexpr glm::vec4 to_vec4 () const
constexpr BBox2D to_bbox2d () const
constexpr glm::vec2 size () const
constexpr bool contains (float u, float v) const
constexpr glm::vec2 lerp (float rx, float ry) const
constexpr glm::vec2 normalize (float u, float v) const

Static Public Member Functions

static constexpr UvRect unit ()
static constexpr UvRect from_vec4 (const glm::vec4 &v)
static constexpr UvRect from_bbox2d (const BBox2D &bbox)

Public Attributes

float u_min = 0.f
float u_max = 1.f
float v_min = 0.f
float v_max = 1.f

Detailed Description

Axis-aligned rectangle in normalized [0, 1]^2 domain/UV space.

Represents the parametric sub-region of a tile or Array within the unit terrain domain. (Halo cells may extend slightly outside [0, 1].)

Constructor & Destructor Documentation

◆ UvRect() [1/3]

hmap::UvRect::UvRect ( )
constexprdefault

◆ UvRect() [2/3]

hmap::UvRect::UvRect ( float u0,
float u1,
float v0,
float v1 )
inlineconstexpr

◆ UvRect() [3/3]

hmap::UvRect::UvRect ( const glm::vec4 & v)
inlineconstexpr

Member Function Documentation

◆ unit()

constexpr UvRect hmap::UvRect::unit ( )
inlinestaticconstexpr

◆ from_vec4()

constexpr UvRect hmap::UvRect::from_vec4 ( const glm::vec4 & v)
inlinestaticconstexpr

◆ to_vec4()

glm::vec4 hmap::UvRect::to_vec4 ( ) const
inlineconstexpr

◆ to_bbox2d()

BBox2D hmap::UvRect::to_bbox2d ( ) const
inlineconstexpr

◆ from_bbox2d()

constexpr UvRect hmap::UvRect::from_bbox2d ( const BBox2D & bbox)
inlinestaticconstexpr

◆ size()

glm::vec2 hmap::UvRect::size ( ) const
inlineconstexpr

◆ contains()

bool hmap::UvRect::contains ( float u,
float v ) const
inlineconstexpr

◆ lerp()

glm::vec2 hmap::UvRect::lerp ( float rx,
float ry ) const
inlineconstexpr

◆ normalize()

glm::vec2 hmap::UvRect::normalize ( float u,
float v ) const
inlineconstexpr

Member Data Documentation

◆ u_min

float hmap::UvRect::u_min = 0.f

◆ u_max

float hmap::UvRect::u_max = 1.f

◆ v_min

float hmap::UvRect::v_min = 0.f

◆ v_max

float hmap::UvRect::v_max = 1.f

The documentation for this struct was generated from the following file: