Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
spat::PositionH< Valtype > Struct Template Reference

Implements a 4D - position in homogenous coordinates. More...

#include <C:/Trend/Development/Trax3/Code/spat/PositionH.h>

Public Types

typedef Valtype value_type

Public Member Functions

Valtype * ptr () noexcept
 Pointer accessor for direct copying.
const Valtype * ptr () const noexcept
 Pointer accessor for direct copying.
void Init () noexcept
 Sets the values to (0,0,0,1).
bool Homogenize () noexcept
 Transforms the position so that w == 1.
bool Equals (const PositionH &p, Valtype epsilon=Valtype{0}) const noexcept
 Comparison within some range. The area within two positions regarded as equal is a sphere with radius epsilon.
Construction
Parameters
x
y
z
w
p
v
 PositionH ()=default
 Does not initialize the members.
 PositionH (Valtype x, Valtype y, Valtype z, Valtype w) noexcept
 Does not initialize the members.
template<typename Valtype2>
constexpr PositionH (const Position< Valtype2 > &p) noexcept
 Does not initialize the members.
template<typename Valtype2>
 PositionH (const Vector< Valtype2 > &v) noexcept
 Does not initialize the members.
template<typename Valtype2>
 PositionH (const Valtype2 *pVal) noexcept
 Does not initialize the members.
Subscripting.
Returns
Reference to value.
const Valtype & operator[] (size_t index) const
Valtype & operator[] (size_t index)

Public Attributes

Valtype x
 x coordinate
Valtype y
 y coordinate
Valtype z
 z coordinate
Valtype w
 w coordinate, homogenous coordinate

Detailed Description

template<typename Valtype>
struct spat::PositionH< Valtype >

Implements a 4D - position in homogenous coordinates.

Specifies the coordinates of a point in 3D space. For Vectors, like e.g. surface normals, use the Vector type.

Member Function Documentation

◆ Equals()

template<typename Valtype>
bool spat::PositionH< Valtype >::Equals ( const PositionH< Valtype > & p,
Valtype epsilon = Valtype{0} ) const
inlinenoexcept

Comparison within some range. The area within two positions regarded as equal is a sphere with radius epsilon.

Parameters
pPositionH to compare with.
epsilonDistance <= wich two positions are regarded as equal.

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