Samplers.hpp
Go to the documentation of this file.
1 // This code is based on Jet framework.
2 // Copyright (c) 2018 Doyub Kim
3 // CubbyFlow is voxel-based fluid simulation engine for computer games.
4 // Copyright (c) 2020 CubbyFlow Team
5 // Core Part: Chris Ohk, Junwoo Hwang, Jihong Sin, Seungwoo Yoo
6 // AI Part: Dongheon Cho, Minseo Kim
7 // We are making my contributions/submissions to this project solely in our
8 // personal capacity and are not conveying any rights to any intellectual
9 // property of any third parties.
10 
11 #ifndef CUBBYFLOW_SAMPLERS_HPP
12 #define CUBBYFLOW_SAMPLERS_HPP
13 
14 #include <Core/Matrix/Matrix.hpp>
15 
16 namespace CubbyFlow
17 {
33 template <typename T>
34 Vector3<T> UniformSampleCone(T u1, T u2, const Vector3<T>& axis, T angle);
35 
50 template <typename T>
51 Vector3<T> UniformSampleHemisphere(T u1, T u2, const Vector3<T>& normal);
52 
67 template <typename T>
68 Vector3<T> CosineWeightedSampleHemisphere(T u1, T u2, const Vector3<T>& normal);
69 
83 template <typename T>
84 Vector3<T> UniformSampleSphere(T u1, T u2);
85 
98 template <typename T>
99 Vector2<T> UniformSampleDisk(T u1, T u2);
100 } // namespace CubbyFlow
101 
103 
104 #endif
Vector3< T > UniformSampleSphere(T u1, T u2)
Returns randomly a point on a sphere.
Definition: Samplers-Impl.hpp:81
Vector3< T > CosineWeightedSampleHemisphere(T u1, T u2, const Vector3< T > &normal)
Returns weighted sampled point on a hemisphere.
Definition: Samplers-Impl.hpp:67
Definition: pybind11Utils.hpp:20
Vector2< T > UniformSampleDisk(T u1, T u2)
Returns randomly a point on a disk.
Definition: Samplers-Impl.hpp:93
Vector3< T > UniformSampleCone(T u1, T u2, const Vector3< T > &axis, T angle)
Returns randomly sampled direction within a cone.
Definition: Samplers-Impl.hpp:40
Vector3< T > UniformSampleHemisphere(T u1, T u2, const Vector3< T > &normal)
Returns randomly sampled point within a unit hemisphere.
Definition: Samplers-Impl.hpp:54