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

Implements a 3D - position in cartesian coordinates. More...

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

Inheritance diagram for spat::Position< Valtype >:

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.
PositionInit () noexcept
 Initialisation to origin.
PositionTransport (const Vector< Valtype > &v) noexcept
 Moves the position by v.
template<typename Valtype2>
PositionRotate (const VectorBundle< Valtype, Valtype2 > &axis) noexcept
 Rotates a position by axis (length of axis.T make angle in radints).
template<typename Valtype2>
PositionRotate (const VectorBundle< Valtype, Valtype2 > &axis, Valtype2 angle) noexcept
 Rotates a position by axis and angle in radiants.
constexpr bool Equals (const Position &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.
PositionRound (int toDigit) noexcept
 Rounds the positions values to a certain digit after the point.
template<typename Valtype2>
Position< Valtype > & operator= (const Valtype2 *pVal) noexcept
template<typename Valtype2>
Position< Valtype > & Rotate (const VectorBundle< Valtype, Valtype2 > &axis) noexcept
template<typename Valtype2>
Position< Valtype > & Rotate (const VectorBundle< Valtype, Valtype2 > &axis, Valtype2 angle) noexcept
Construction
Parameters
xcartesian x coordinate.
ycartesian y coordinate.
zcartesian z coordinate.
vVector for explicit conversion.
p2dinitializes x, y. z gets set to zero.
pValArray of three values.
spSpherical coordinates will get transformed to cartesian.
constexpr Position () noexcept=default
 Does not initialize the members.
constexpr Position (Valtype x, Valtype y, Valtype z) noexcept
 Does not initialize the members.
 Position (const Vector< Valtype > &v)=delete
 Conversions between Vector and Position shouldn't be necessary and if needed anyhow explicitly specified.
template<typename Valtype2>
constexpr Position (const VectorBundle< Valtype, Valtype2 > &b) noexcept
 Does not initialize the members.
constexpr Position (const Position2D< Valtype > &p) noexcept
 Does not initialize the members.
template<typename Valtype2>
constexpr Position (const PositionH< Valtype2 > &pos) noexcept
 Does not initialize the members.
template<typename Valtype2>
 Position (const Valtype2 *pVal) noexcept
 Does not initialize the members.
Assignment
Parameters
p2dinitializes x, y. z gets set to zero.
pValArray of three values.
spSpherical coordinates will get transformed to cartesian.
Positionoperator= (const Position2D< Valtype > &p2d) noexcept
template<typename Valtype2>
Positionoperator= (const Valtype2 *pVal) noexcept
Subscripting.
Returns
Reference to value.
const Valtype & operator[] (size_t index) const
Valtype & operator[] (size_t index)

Public Attributes

Valtype x
 cartesian x coordinate.
Valtype y
 cartesian y coordinate.
Valtype z
 cartesian z coordinate.

Detailed Description

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

Implements a 3D - position in cartesian 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::Position< Valtype >::Equals ( const Position< Valtype > & p,
Valtype epsilon = Valtype{0} ) const
inlineconstexprnoexcept

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

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

◆ Rotate() [1/2]

template<typename Valtype>
template<typename Valtype2>
Position & spat::Position< Valtype >::Rotate ( const VectorBundle< Valtype, Valtype2 > & axis)
noexcept

Rotates a position by axis (length of axis.T make angle in radints).

Template Parameters
Valtype2template parameter of axis.T
Parameters
axisrotation axis

◆ Rotate() [2/2]

template<typename Valtype>
template<typename Valtype2>
Position & spat::Position< Valtype >::Rotate ( const VectorBundle< Valtype, Valtype2 > & axis,
Valtype2 angle )
noexcept

Rotates a position by axis and angle in radiants.

Template Parameters
Valtype2template parameter of axis.T and angle
Parameters
axisrotation axis
anglein radiants

The documentation for this struct was generated from the following files:
  • C:/Trend/Development/Trax3/Code/spat/Box.h
  • C:/Trend/Development/Trax3/Code/spat/Position.h