Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
TOrthonormalBasis3.h
Go to the documentation of this file.
1#pragma once
2
3#include "Math/math_fwd.h"
4#include "Math/TVector3.h"
5
6namespace ph::math
7{
8
11template<typename T>
13{
14public:
15 static TOrthonormalBasis3 makeFromUnitY(const TVector3<T>& unitYAxis);
16
20
25 const TVector3<T>& xAxis,
26 const TVector3<T>& yAxis,
27 const TVector3<T>& zAxis);
28
29 TVector3<T> worldToLocal(const TVector3<T>& worldVec) const;
30 TVector3<T> localToWorld(const TVector3<T>& localVec) const;
31
37 T cosPhi(const TVector3<T>& unitVec) const;
38 T sinPhi(const TVector3<T>& unitVec) const;
39 T tanPhi(const TVector3<T>& unitVec) const;
41
42 T cos2Phi(const TVector3<T>& unitVec) const;
43 T sin2Phi(const TVector3<T>& unitVec) const;
44 T tan2Phi(const TVector3<T>& unitVec) const;
45
51 T cosTheta(const TVector3<T>& unitVec) const;
52 T sinTheta(const TVector3<T>& unitVec) const;
53 T tanTheta(const TVector3<T>& unitVec) const;
55
56 T cos2Theta(const TVector3<T>& unitVec) const;
57 T sin2Theta(const TVector3<T>& unitVec) const;
58 T tan2Theta(const TVector3<T>& unitVec) const;
59 T absCosTheta(const TVector3<T>& unitVec) const;
60 T absSinTheta(const TVector3<T>& unitVec) const;
61
66
70
72 const TVector3<T>& xAxis,
73 const TVector3<T>& yAxis,
74 const TVector3<T>& zAxis);
75
76 TVector3<T> getXAxis() const;
77 TVector3<T> getYAxis() const;
78 TVector3<T> getZAxis() const;
79
80private:
81 TVector3<T> m_xAxis;
82 TVector3<T> m_yAxis;
83 TVector3<T> m_zAxis;
84};
85
86}// end namespace ph::math
87
Represents a set of orthonormal basis vectors in 3-D space.
Definition TOrthonormalBasis3.h:13
T absCosTheta(const TVector3< T > &unitVec) const
Definition TOrthonormalBasis3.ipp:161
TVector3< T > worldToLocal(const TVector3< T > &worldVec) const
Definition TOrthonormalBasis3.ipp:78
TVector3< T > getYAxis() const
Definition TOrthonormalBasis3.ipp:272
TVector3< T > getZAxis() const
Definition TOrthonormalBasis3.ipp:278
TOrthonormalBasis3 & set(const TVector3< T > &xAxis, const TVector3< T > &yAxis, const TVector3< T > &zAxis)
Definition TOrthonormalBasis3.ipp:253
static TOrthonormalBasis3 makeFromUnitY(const TVector3< T > &unitYAxis)
Definition TOrthonormalBasis3.ipp:16
TOrthonormalBasis3 & renormalize()
Definition TOrthonormalBasis3.ipp:195
TVector3< T > getXAxis() const
Definition TOrthonormalBasis3.ipp:266
T tanTheta(const TVector3< T > &unitVec) const
Definition TOrthonormalBasis3.ipp:153
T tanPhi(const TVector3< T > &unitVec) const
Definition TOrthonormalBasis3.ipp:110
TOrthonormalBasis3 & setXAxis(const TVector3< T > &axis)
Definition TOrthonormalBasis3.ipp:229
T sin2Theta(const TVector3< T > &unitVec) const
Definition TOrthonormalBasis3.ipp:179
T tan2Theta(const TVector3< T > &unitVec) const
Definition TOrthonormalBasis3.ipp:185
T sinTheta(const TVector3< T > &unitVec) const
Definition TOrthonormalBasis3.ipp:147
T absSinTheta(const TVector3< T > &unitVec) const
Definition TOrthonormalBasis3.ipp:167
T sinPhi(const TVector3< T > &unitVec) const
Definition TOrthonormalBasis3.ipp:102
TOrthonormalBasis3 & setZAxis(const TVector3< T > &axis)
Definition TOrthonormalBasis3.ipp:245
TOrthonormalBasis3 & renormalizeZAxis()
Definition TOrthonormalBasis3.ipp:221
TOrthonormalBasis3 & renormalizeXAxis()
Definition TOrthonormalBasis3.ipp:205
T cosTheta(const TVector3< T > &unitVec) const
Calculates trigonometries for the angle in spherical coordinates.
Definition TOrthonormalBasis3.ipp:141
T sin2Phi(const TVector3< T > &unitVec) const
Definition TOrthonormalBasis3.ipp:125
T cos2Phi(const TVector3< T > &unitVec) const
Definition TOrthonormalBasis3.ipp:119
TOrthonormalBasis3 & renormalizeYAxis()
Definition TOrthonormalBasis3.ipp:213
T tan2Phi(const TVector3< T > &unitVec) const
Definition TOrthonormalBasis3.ipp:131
T cos2Theta(const TVector3< T > &unitVec) const
Definition TOrthonormalBasis3.ipp:173
T cosPhi(const TVector3< T > &unitVec) const
Calculates trigonometries for the angle in spherical coordinates.
Definition TOrthonormalBasis3.ipp:94
TOrthonormalBasis3 & setYAxis(const TVector3< T > &axis)
Definition TOrthonormalBasis3.ipp:237
TOrthonormalBasis3()
Creates basis with unit x, y and z axes.
Definition TOrthonormalBasis3.ipp:56
TVector3< T > localToWorld(const TVector3< T > &localVec) const
Definition TOrthonormalBasis3.ipp:86
Represents a 3-D vector.
Definition TVector3.h:17
Math functions and utilities.
Definition TransformInfo.h:10