41 #include <cugar/basic/numbers.h> 42 #include <cugar/linalg/vector.h> 43 #include <cugar/linalg/matrix.h> 55 CUGAR_API CUGAR_HOST_DEVICE
float oct_basis(
const int32 i,
const Vector3f& d);
65 CUGAR_API CUGAR_HOST_DEVICE
float oct_smooth_basis(
const int32 i,
const Vector3f& omega);
74 static const int32 COEFFS = 8;
96 for (int32 i = 0; i < 8; ++i)
97 coeffs[i] = k * sqrtf(M_PIf/2.0f);
105 for (int32 i = 0; i < 8; ++i)
112 template <
typename Vector_type>
116 for (int32 i = 0; i < 8; ++i)
134 static const int32 COEFFS = 8;
156 for (int32 i = 0; i < 8; ++i)
157 coeffs[i] = k * s_K[i];
165 for (int32 i = 0; i < 8; ++i)
172 template <
typename Vector_type>
176 for (int32 i = 0; i < 8; ++i)
185 static float G(
const int32 i,
const int32 j) {
return s_G[i][j]; }
190 CUGAR_API
static void solve(
float* coeffs);
193 struct Initializer { Initializer(); };
199 static Initializer s_I;
210 static int32 s_oct_faces[8][3] = {
224 const float norm = sqrtf(2.0f/M_PIf);
228 ((1 - 2*(((i+1)>>1)&1))*omega[0] > 0.0f ? 1.0f : 0.0f)*
229 ((1 - 2*((i>>1)&1) )*omega[1] > 0.0f ? 1.0f : 0.0f)*
230 ((1 - 2*(i>>2) )*omega[2] > 0.0f ? 1.0f : 0.0f) * norm;
260 -0.66666666666666666666f * (((i+1)>>1) & 1) + 0.33333333333333333333f,
261 -0.66666666666666666666f * ((i>>1) & 1) + 0.33333333333333333333f,
262 -0.66666666666666666666f * (i>>2) + 0.33333333333333333333f );
264 const float N = 2.0f;
265 const float norm = 2.170803763674771f;
267 const float d = max( dot( omega, c ), 0.0f );
268 return fast_pow( d, N ) * norm;
static float integral(const float *coeffs)
Definition: oct.h:102
static void solve(float *coeffs)
Definition: oct.h:124
static float integral(const float *coeffs)
Definition: oct.h:162
static void constant(float k, float *coeffs)
Definition: oct.h:154
static CUGAR_HOST_DEVICE float eval(const int32 i, const Vector3f &d)
Definition: oct.h:140
CUGAR_HOST static CUGAR_DEVICE float eval(const int32 i, const Vector3f &d)
Definition: oct.h:80
CUGAR_API CUGAR_HOST_DEVICE float oct_smooth_basis(const int32 i, const Vector3f &omega)
Definition: oct.h:257
static CUGAR_API void clamped_cosine(const Vector3f &normal, const float w, float *coeffs)
Definition: oct.cpp:84
static float integral(const Vector_type &coeffs)
Definition: oct.h:173
CUGAR_API CUGAR_HOST_DEVICE float oct_basis(const int32 i, const Vector3f &d)
Definition: oct.h:222
static float integral(const Vector_type &coeffs)
Definition: oct.h:113
Define a vector_view POD type and plain_view() for std::vector.
Definition: diff.h:38
static void constant(float k, float *coeffs)
Definition: oct.h:94
static float G(const int32 i, const int32 j)
Definition: oct.h:185