3#include <Foundation/Math/Angle.h>
4#include <Foundation/Math/Random.h>
5#include <Foundation/Math/Vec3.h>
7template <
typename Type>
19 len = (px * px) + (py * py) + (pz * pz);
20 }
while (len > 1.0 || len <= 0.000001);
25template <
typename Type>
33template <
typename Type>
49template <
typename Type>
57template <
typename Type>
65template <
typename Type>
79 return qRotXtoDir * vec;
Float wrapper struct for a safe usage and conversions of angles.
Definition Angle.h:10
static constexpr plAngle MakeFromRadian(float fRadian)
Creates an instance of plAngle that was initialized from radian. (No need for any conversion)
Definition Angle_inl.h:38
Quaternions can be used to represent rotations in 3D space.
Definition Quat.h:19
static plQuatTemplate< float > MakeShortestRotation(const plVec3Template< float > &vDirFrom, const plVec3Template< float > &vDirTo)
Definition Quat_inl.h:363
A random number generator. Currently uses the WELL512 algorithm.
Definition Random.h:9
double DoubleMinMax(double fMinValue, double fMaxValue)
Returns a double value in range [fMinValue ; fMaxValue].
Definition Random.cpp:115
PL_ALWAYS_INLINE double DoubleZeroToOneInclusive()
Returns a value in range [0.0 ; 1.0], ie. including zero and one.
Definition Random.h:51
A 3-component vector class.
Definition Vec3.h:9
static PL_DECLARE_IF_FLOAT_TYPE plVec3Template< Type > MakeRandomDeviationZ(plRandom &inout_rng, const plAngle &maxDeviation)
Creates a random vector around the z axis with a maximum deviation angle of maxDeviation....
Definition AllClassesRandom_inl.h:58
static PL_DECLARE_IF_FLOAT_TYPE plVec3Template< Type > MakeRandomDeviationX(plRandom &inout_rng, const plAngle &maxDeviation)
Creates a random vector around the x axis with a maximum deviation angle of maxDeviation....
Definition AllClassesRandom_inl.h:34
PL_DECLARE_IF_FLOAT_TYPE void Normalize()
Normalizes this vector.
Definition Vec3_inl.h:95
static PL_DECLARE_IF_FLOAT_TYPE plVec3Template< Type > MakeRandomPointInSphere(plRandom &inout_rng)
Returns a random point inside a unit sphere (radius 1).
Definition AllClassesRandom_inl.h:8
static PL_DECLARE_IF_FLOAT_TYPE plVec3Template< Type > MakeRandomDirection(plRandom &inout_rng)
Creates a random direction vector. The vector is normalized.
Definition AllClassesRandom_inl.h:26
static PL_DECLARE_IF_FLOAT_TYPE plVec3Template< Type > MakeRandomDeviationY(plRandom &inout_rng, const plAngle &maxDeviation)
Creates a random vector around the y axis with a maximum deviation angle of maxDeviation....
Definition AllClassesRandom_inl.h:50
static PL_DECLARE_IF_FLOAT_TYPE plVec3Template< Type > MakeRandomDeviation(plRandom &inout_rng, const plAngle &maxDeviation, const plVec3Template< Type > &vNormal)
Creates a random vector around the given normal with a maximum deviation.
Definition AllClassesRandom_inl.h:66
constexpr TYPE Pi()
Returns the natural constant Pi.
PL_ALWAYS_INLINE float Sin(plAngle a)
***** Trigonometric Functions *****
Definition MathFloat_inl.h:62
PL_ALWAYS_INLINE double Sqrt(double f)
Returns the square root of f.
Definition MathDouble_inl.h:99
PL_ALWAYS_INLINE void Swap(T &ref_f1, T &ref_f2)
Swaps the values in the two variables f1 and f2.
Definition Math_inl.h:224
PL_ALWAYS_INLINE float Cos(plAngle a)
Takes an angle, returns its cosine.
Definition MathFloat_inl.h:67