12 #include <Utility/String/NRE_String.hpp> 13 #include <Utility/Interfaces/Stringable/NRE_Stringable.hpp> 14 #include <type_traits> 16 #include "../../NRE_Math.hpp" 17 #include "../../NRE_Unit.hpp" 19 #include "../../Curve/Bezier/4D/NRE_BezierCurve4D.hpp" 32 template<
class>
class Vector2D;
33 template<
class>
class Vector3D;
45 class Matrix4x4 :
public Utility::Stringable<Matrix4x4<T>> {
74 template <
class A,
class B,
class C,
class D,
75 class E,
class F,
class G,
class H,
76 class I,
class J,
class K,
class L,
77 class M,
class N,
class O,
class P>
78 constexpr
Matrix4x4(A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m, N n, O o, P p);
92 template <
class K,
class L,
class N,
class M>
258 template <
class K,
typename = UseIfArithmetic<K>>
261 tmp[0][0] = static_cast <T> (u);
269 template <
class K,
typename = UseIfArithmetic<K>>
272 tmp[1][1] = static_cast <T> (u);
280 template <
class K,
typename = UseIfArithmetic<K>>
283 tmp[2][2] = static_cast <T> (u);
301 template <
class K,
class L,
typename = UseIfArithmetic<K>>
305 T f = static_cast <T> (
tan(fov / 2.0));
306 data[0][0] = static_cast <T> (1.0) / (static_cast <T> (ratio) * f);
307 data[1][1] = static_cast <T> (1.0) / f;
308 data[2][2] = static_cast <T> (-(z.
getY() + z.
getX()) / (z.
getY() - z.
getX()));
309 data[2][3] = static_cast <T> (-(static_cast <L> (2.0) * z.
getY() * z.
getX()) / (z.
getY() - z.
getX()));
322 template <
class K,
class L,
class N>
330 template <
class K,
class L>
339 template <
class K,
class L,
class N>
344 constexpr
const T*
value()
const;
522 static constexpr
Matrix4x4 IDENTITY =
Matrix4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
527 #include "NRE_Matrix4x4.tpp" A cartesian 2D vector.
Definition: NRE_Matrix3x3.hpp:32
constexpr Vector4D< T > getC1() const
constexpr Vector4D< T > const & getL3() const
constexpr Matrix4x4 & scale(Vector3D< K > const &u)
constexpr Matrix4x4 & lookAt(Vector3D< K > const &eye, Vector3D< L > const ¢er, Vector3D< N > const &up)
A 4D homogeneous segment.
Definition: NRE_Matrix4x4.hpp:35
static constexpr Matrix4x4 IDENTITY
Definition: NRE_Matrix4x4.hpp:522
constexpr void setL1(Vector4D< K > const &l1)
constexpr Vector4D< T > & operator[](std::size_t index)
constexpr Vector4D< T > const & getL4() const
constexpr Vector4D< T > getC3() const
constexpr Vector4D< T > getC4() const
4x4 generic matrix
Definition: NRE_Matrix3x3.hpp:35
3x3 generic matrix
Definition: NRE_Matrix3x3.hpp:42
constexpr Matrix4x4< std::common_type_t< T, K > > operator-(Matrix4x4< K > const &m) const
constexpr const T * value() const
constexpr void setL2(Vector4D< K > const &l2)
constexpr Matrix4x4()=default
constexpr long double getDeterminant() const
Utility::String toString() const
constexpr Matrix4x4 & ortho2D(Vector2D< K > const &h, Vector2D< L > const &v)
constexpr Matrix4x4 & stretchX(K u)
Definition: NRE_Matrix4x4.hpp:259
constexpr UAcceleration G
Definition: NRE_Unit.hpp:321
constexpr Matrix4x4 & ortho(Vector2D< K > const &h, Vector2D< L > const &v, Vector2D< N > const &z)
constexpr Matrix4x4< std::common_type_t< T, K > > operator*(K k) const
constexpr Matrix4x4 & operator+=(Matrix4x4< K > const &m)
constexpr void setC3(Vector4D< K > const &c3)
A cartesian 3D vector, 2D homogeneous.
Definition: NRE_Matrix3x3.hpp:33
constexpr void setC1(Vector4D< K > const &c1)
constexpr Vector4D< T > getC2() const
constexpr Matrix4x4 & operator/=(K k)
A cartesian plane with a point and a vector.
Definition: NRE_Matrix4x4.hpp:36
constexpr void setC4(Vector4D< K > const &c4)
constexpr Matrix4x4< std::common_type_t< T, K > > operator/(K k) const
constexpr Matrix4x4< std::common_type_t< T, K > > operator+(Matrix4x4< K > const &m) const
constexpr Matrix4x4 & translate(Vector3D< K > const &u)
constexpr Matrix4x4 & operator-=(Matrix4x4< K > const &m)
constexpr Matrix4x4 & transpose()
constexpr Matrix4x4 & operator*=(K k)
constexpr void setL4(Vector4D< K > const &l4)
The NearlyRealEngine's global namespace.
constexpr Vector4D< T > const & getL2() const
A cartesian 4D vector, 3D homogeneous.
Definition: NRE_Matrix4x4.hpp:34
constexpr bool operator==(Matrix4x4< K > const &m) const
double tan(Angle const &u)
Definition: NRE_Unit.hpp:591
constexpr Matrix4x4 & stretchZ(K u)
Definition: NRE_Matrix4x4.hpp:281
constexpr Vector4D< T > const & getL1() const
constexpr Matrix4x4 & rotate(Angle angle, Vector3D< K > const &axis)
constexpr Matrix4x4 & perspective(Angle fov, K ratio, Vector2D< L > const &z)
Definition: NRE_Matrix4x4.hpp:302
constexpr void setL3(Vector4D< K > const &l3)
constexpr Matrix4x4 & setIdentity()
constexpr Matrix4x4 & operator=(Matrix4x4 const &m)=default
A quaternion represented by a 3D rotation axis and an angle.
Definition: NRE_Matrix4x4.hpp:38
Represent a 3D homogeneous Bezier curves with a set of control points.
Definition: NRE_BezierCurve4D.hpp:32
constexpr void setC2(Vector4D< K > const &c2)
constexpr Matrix4x4 & stretchY(K u)
Definition: NRE_Matrix4x4.hpp:270
constexpr bool operator!=(Matrix4x4< K > const &m) const
constexpr Matrix4x4 & inverse()