Jet  v1.3.3
samplers.h
Go to the documentation of this file.
1 // Copyright (c) 2018 Doyub Kim
2 //
3 // I am making my contributions/submissions to this project solely in my
4 // personal capacity and am not conveying any rights to any intellectual
5 // property of any third parties.
6 
7 #ifndef INCLUDE_JET_SAMPLERS_H_
8 #define INCLUDE_JET_SAMPLERS_H_
9 
10 #include <jet/vector2.h>
11 #include <jet/vector3.h>
12 
13 namespace jet {
14 
30 template <typename T>
32  T u1, T u2, const Vector3<T>& axis, T angle);
33 
48 template <typename T>
50  T u1, T u2, const Vector3<T>& normal);
51 
67 template <typename T>
69  T u1, T u2, const Vector3<T>& normal);
70 
86 template <typename T>
87 inline Vector3<T> uniformSampleSphere(T u1, T u2);
88 
101 template <typename T>
102 inline Vector2<T> uniformSampleDisk(T u1, T u2);
103 
104 } // namespace jet
105 
106 #include "detail/samplers-inl.h"
107 
108 #endif // INCLUDE_JET_SAMPLERS_H_
jet::cosineWeightedSampleHemisphere
Vector3< T > cosineWeightedSampleHemisphere(T u1, T u2, const Vector3< T > &normal)
Returns weighted sampled point on a hemisphere.
jet
Definition: advection_solver2.h:18
vector2.h
jet::uniformSampleSphere
Vector3< T > uniformSampleSphere(T u1, T u2)
Returns randomly a point on a sphere.
jet::Vector< T, 2 >
2-D vector class.
Definition: vector2.h:24
vector3.h
jet::Vector< T, 3 >
3-D vector class.
Definition: vector3.h:25
jet::uniformSampleHemisphere
Vector3< T > uniformSampleHemisphere(T u1, T u2, const Vector3< T > &normal)
Returns randomly sampled point within a unit hemisphere.
jet::uniformSampleCone
Vector3< T > uniformSampleCone(T u1, T u2, const Vector3< T > &axis, T angle)
Returns randomly sampled direction within a cone.
jet::uniformSampleDisk
Vector2< T > uniformSampleDisk(T u1, T u2)
Returns randomly a point on a disk.