GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::Offset< 3 > Struct Reference

#include <GREM/core/extents.hpp>

Public Member Functions

constexpr operator vec3 () const noexcept
 Convert this offset to a floating-point 3D vector.
constexpr operator dvec3 () const noexcept
 Convert this offset to a double-precision floating-point 3D vector.
constexpr operator ivec3 () const noexcept
 Convert this offset to an integer 3D vector.
constexpr operator u32vec3 () const noexcept
 Convert this offset to an unsigned integer 3D vector.
constexpr bool operator== (const Offset< 3 > &other) const =default
 Compare this offset to another for equality.

Static Public Member Functions

static constexpr Offset< 3 > from (i32vec3 v) noexcept
 Create an offset from a vector of integers.
static Offset< 3 > round (vec3 v)
 Create an offset from a vector of floating-point numbers, rounded to their nearest integer values before conversion.
static Offset< 3 > floor (vec3 v)
 Create an offset from a vector of floating-point numbers, rounded down to their floor integer values before conversion.
static Offset< 3 > ceil (vec3 v)
 Create an offset from a vector of floating-point numbers, rounded up to their ceiling integer values before conversion.
static Offset< 3 > trunc (vec3 v)
 Create an offset from a vector of floating-point numbers, rounded to their truncated integer values before conversion.

Public Attributes

int32_t x
 Horizontal offset.
int32_t y
 Vertical offset.
int32_t z
 Depth offset.

Member Function Documentation

◆ from()

constexpr Offset< 3 > grem::Offset< 3 >::from ( i32vec3 v)
inlinestaticnodiscardconstexprnoexcept

Create an offset from a vector of integers.

Parameters
vvector to convert.
Returns
the corresponding offset.

◆ round()

Offset< 3 > grem::Offset< 3 >::round ( vec3 v)
inlinestaticnodiscard

Create an offset from a vector of floating-point numbers, rounded to their nearest integer values before conversion.

Parameters
vvector to convert.
Returns
the rounded offset.

◆ floor()

Offset< 3 > grem::Offset< 3 >::floor ( vec3 v)
inlinestaticnodiscard

Create an offset from a vector of floating-point numbers, rounded down to their floor integer values before conversion.

Parameters
vvector to convert.
Returns
the floor-rounded offset.

◆ ceil()

Offset< 3 > grem::Offset< 3 >::ceil ( vec3 v)
inlinestaticnodiscard

Create an offset from a vector of floating-point numbers, rounded up to their ceiling integer values before conversion.

Parameters
vvector to convert.
Returns
the ceiling-rounded offset.

◆ trunc()

Offset< 3 > grem::Offset< 3 >::trunc ( vec3 v)
inlinestaticnodiscard

Create an offset from a vector of floating-point numbers, rounded to their truncated integer values before conversion.

Parameters
vvector to convert.
Returns
the truncated offset.

◆ operator vec3()

grem::Offset< 3 >::operator vec3 ( ) const
inlineconstexprnoexcept

Convert this offset to a floating-point 3D vector.

Returns
a 3D vector representing the offset.

◆ operator dvec3()

grem::Offset< 3 >::operator dvec3 ( ) const
inlineconstexprnoexcept

Convert this offset to a double-precision floating-point 3D vector.

Returns
a 3D vector representing the offset.

◆ operator ivec3()

grem::Offset< 3 >::operator ivec3 ( ) const
inlineconstexprnoexcept

Convert this offset to an integer 3D vector.

Returns
a 3D vector representing the offset.

◆ operator u32vec3()

grem::Offset< 3 >::operator u32vec3 ( ) const
inlineconstexprnoexcept

Convert this offset to an unsigned integer 3D vector.

Returns
a 3D vector representing the offset.

◆ operator==()

bool grem::Offset< 3 >::operator== ( const Offset< 3 > & other) const
nodiscardconstexprdefault

Compare this offset to another for equality.

Parameters
otherthe offset to compare this one to.
Returns
true if the offsets are equal, false otherwise.

Member Data Documentation

◆ x

int32_t grem::Offset< 3 >::x

Horizontal offset.

◆ y

int32_t grem::Offset< 3 >::y

Vertical offset.

◆ z

int32_t grem::Offset< 3 >::z

Depth offset.


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