20#ifndef _SOURCE_TYPES_TFVECTOR4_H_
21#define _SOURCE_TYPES_TFVECTOR4_H_
24#include <Magnum/Math/Vector4.h>
30 template<
class T>
using Vector4Base = Magnum::Math::Vector4<T>;
33 class TVector4 :
public Vector4Base<T> {
41 template<class U = T, typename std::enable_if<std::is_floating_point<U>::value,
bool>::type =
true>
43 return Magnum::Math::planeEquation(normal, point);
52 template<class U = T, typename std::enable_if<std::is_floating_point<U>::value,
bool>::type =
true>
54 return Magnum::Math::planeEquation(p0, p1, p2);
57 constexpr TVector4() noexcept: Vector4Base<T>() {}
59 constexpr explicit TVector4(T value)
noexcept: Vector4Base<T>(value) {}
61 constexpr TVector4(T
x, T
y, T
z, T
w)
noexcept: Vector4Base<T>(
x,
y,
z,
w) {}
63 constexpr TVector4(
const TVector3<T>&
xyz, T
w)
noexcept: Vector4Base<T>(
xyz[0],
xyz[1],
xyz[2],
w) {}
65 template<
class U>
constexpr explicit TVector4(
const TVector4<U>& other)
noexcept: Vector4Base<T>(other) {}
68 T&
x() {
return Vector4Base<T>::x(); }
71 T&
y() {
return Vector4Base<T>::y(); }
74 T&
z() {
return Vector4Base<T>::z(); }
77 T&
w() {
return Vector4Base<T>::w(); }
80 constexpr T
x()
const {
return Vector4Base<T>::x(); }
83 constexpr T
y()
const {
return Vector4Base<T>::y(); }
86 constexpr T
z()
const {
return Vector4Base<T>::z(); }
89 constexpr T
w()
const {
return Vector4Base<T>::w(); }
92 T&
r() {
return Vector4Base<T>::r(); }
95 T&
g() {
return Vector4Base<T>::g(); }
98 T&
b() {
return Vector4Base<T>::b(); }
101 T&
a() {
return Vector4Base<T>::a(); }
104 constexpr T
r()
const {
return Vector4Base<T>::r(); }
107 constexpr T
g()
const {
return Vector4Base<T>::g(); }
110 constexpr T
b()
const {
return Vector4Base<T>::b(); }
113 constexpr T
a()
const {
return Vector4Base<T>::a(); }
120 return {Vector4Base<T>::_data[0], Vector4Base<T>::_data[1], Vector4Base<T>::_data[2]};
128 return {Vector4Base<T>::_data[0], Vector4Base<T>::_data[1], Vector4Base<T>::_data[2]};
136 return {Vector4Base<T>::_data[0], Vector4Base<T>::_data[1]};
140 template<class U = T, typename std::enable_if<std::is_floating_point<U>::value,
bool>::type =
true>
142 return Magnum::Math::Distance::pointPlane(point, *
this);
146 template<class U = T, typename std::enable_if<std::is_floating_point<U>::value,
bool>::type =
true>
148 return Magnum::Math::Distance::pointPlaneScaled(point, *
this);
151 template<class U = T, typename std::enable_if<std::is_floating_point<U>::value,
bool>::type =
true>
156 MAGNUM_BASE_VECTOR_CAST_METHODS(4, TVector4, Vector4Base)
158 REVISED_MAGNUM_VECTOR_SUBCLASS_IMPLEMENTATION(4, TVector4, Vector4Base)
161 SWIGPYTHON_MAGNUM_VECTOR_SUBCLASS_IMPLEMENTATION(4, TVector4)
Definition tfVector2.h:35
static TVector2< T > & from(T *data)
Definition tfVector2.h:88
Definition tfVector3.h:35
std::enable_if< std::is_floating_point< U >::value, TVector3< T > >::type normalized() const
Definition tfVector3.h:150
static TVector3< T > & from(T *data)
Definition tfVector3.h:150
Definition tfVector4.h:33
constexpr const TVector2< T > xy() const
Definition tfVector4.h:135
constexpr T y() const
Definition tfVector4.h:83
T & a()
Definition tfVector4.h:101
TVector2< T > & xy()
Definition tfVector4.h:132
constexpr T z() const
Definition tfVector4.h:86
TVector3< T > & xyz()
Definition tfVector4.h:116
T & b()
Definition tfVector4.h:98
T & x()
Definition tfVector4.h:68
T distanceScaled(const TVector3< T > &point) const
Definition tfVector4.h:147
constexpr const TVector3< T > xyz() const
Definition tfVector4.h:119
constexpr T a() const
Definition tfVector4.h:113
T & w()
Definition tfVector4.h:77
constexpr T x() const
Definition tfVector4.h:80
T & r()
Definition tfVector4.h:92
static TVector4< T > planeEquation(const TVector3< T > &p0, const TVector3< T > &p1, const TVector3< T > &p2)
Initialize a plane equation.
Definition tfVector4.h:53
constexpr T w() const
Definition tfVector4.h:89
constexpr T g() const
Definition tfVector4.h:107
T & g()
Definition tfVector4.h:95
constexpr T r() const
Definition tfVector4.h:104
T & z()
Definition tfVector4.h:74
T distance(const TVector3< T > &point) const
Definition tfVector4.h:141
T & y()
Definition tfVector4.h:71
TVector3< T > & rgb()
Definition tfVector4.h:124
static TVector4< T > planeEquation(const TVector3< T > &normal, const TVector3< T > &point)
Initialize a plane equation.
Definition tfVector4.h:42
constexpr const TVector3< T > rgb() const
Definition tfVector4.h:127
constexpr T b() const
Definition tfVector4.h:110
Native Tissue Forge type definitions.
Definition tfMatrix.h:33