Samplers.h
Go to the documentation of this file.
1 /*************************************************************************
2 > File Name: Samplers.h
3 > Project Name: CubbyFlow
4 > Author: Chan-Ho Chris Ohk
5 > Purpose: Sampler functions for CubbyFlow.
6 > Created Time: 2017/06/21
7 > Copyright (c) 2018, Chan-Ho Chris Ohk
8 *************************************************************************/
9 #ifndef CUBBYFLOW_SAMPLERS_H
10 #define CUBBYFLOW_SAMPLERS_H
11 
12 #include <Core/Vector/Vector2.h>
13 #include <Core/Vector/Vector3.h>
14 
15 namespace CubbyFlow
16 {
32  template <typename T>
33  inline Vector3<T> UniformSampleCone(T u1, T u2, const Vector3<T>& axis, T angle);
34 
49  template <typename T>
50  inline Vector3<T> UniformSampleHemisphere(T u1, T u2, const Vector3<T>& normal);
51 
66  template <typename T>
67  inline Vector3<T> CosineWeightedSampleHemisphere(T u1, T u2, const Vector3<T>& normal);
68 
82  template <typename T>
83  inline Vector3<T> UniformSampleSphere(T u1, T u2);
84 
97  template <typename T>
98  inline Vector2<T> UniformSampleDisk(T u1, T u2);
99 }
100 
102 
103 #endif
Vector3< T > UniformSampleSphere(T u1, T u2)
Returns randomly a point on a sphere.
Definition: Samplers-Impl.h:80
Vector3< T > CosineWeightedSampleHemisphere(T u1, T u2, const Vector3< T > &normal)
Returns weighted sampled point on a hemisphere.
Definition: Samplers-Impl.h:66
Definition: pybind11Utils.h:24
Vector2< T > UniformSampleDisk(T u1, T u2)
Returns randomly a point on a disk.
Definition: Samplers-Impl.h:92
Vector3< T > UniformSampleCone(T u1, T u2, const Vector3< T > &axis, T angle)
Returns randomly sampled direction within a cone.
Definition: Samplers-Impl.h:39
Vector3< T > UniformSampleHemisphere(T u1, T u2, const Vector3< T > &normal)
Returns randomly sampled point within a unit hemisphere.
Definition: Samplers-Impl.h:53