Blender V5.3
hair_volume.cc File Reference
#include "MEM_guardedalloc.h"
#include "BLI_math_matrix_c.hh"
#include "BLI_math_vector_c.hh"
#include "eigen_utils.h"
#include "implicit.h"

Go to the source code of this file.

Classes

struct  blender::HairGridVert
struct  blender::HairGrid

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define HAIR_GRID_INDEX_AXIS(vec, res, gmin, scale, axis)
#define MARGIN_i0   (i < 1)
#define MARGIN_j0   (j < 1)
#define MARGIN_k0   (k < 1)
#define MARGIN_i1   (i >= resA[0] - 1)
#define MARGIN_j1   (j >= resA[1] - 1)
#define MARGIN_k1   (k >= resA[2] - 1)
#define NEIGHBOR_MARGIN_i0   (i < 2)
#define NEIGHBOR_MARGIN_j0   (j < 2)
#define NEIGHBOR_MARGIN_k0   (k < 2)
#define NEIGHBOR_MARGIN_i1   (i >= resA[0] - 2)
#define NEIGHBOR_MARGIN_j1   (j >= resA[1] - 2)
#define NEIGHBOR_MARGIN_k1   (k >= resA[2] - 2)

Functions

BLI_INLINE int blender::floor_int (float value)
BLI_INLINE float blender::floor_mod (float value)
BLI_INLINE int blender::hair_grid_size (const int res[3])
BLI_INLINE int blender::hair_grid_offset (const float vec[3], const int res[3], const float gmin[3], float scale)
BLI_INLINE int blender::hair_grid_interp_weights (const int res[3], const float gmin[3], float scale, const float vec[3], float uvw[3])
BLI_INLINE void blender::hair_grid_interpolate (const HairGridVert *grid, const int res[3], const float gmin[3], float scale, const float vec[3], float *density, float velocity[3], float vel_smooth[3], float density_gradient[3], float velocity_gradient[3][3])
void blender::SIM_hair_volume_vertex_grid_forces (HairGrid *grid, const float x[3], const float v[3], float smoothfac, float pressurefac, float minpressure, float f[3], float dfdx[3][3], float dfdv[3][3])
void blender::SIM_hair_volume_grid_interpolate (HairGrid *grid, const float x[3], float *density, float velocity[3], float velocity_smooth[3], float density_gradient[3], float velocity_gradient[3][3])
void blender::SIM_hair_volume_grid_velocity (HairGrid *grid, const float x[3], const float v[3], float fluid_factor, float r_v[3])
void blender::SIM_hair_volume_grid_clear (HairGrid *grid)
BLI_INLINE bool blender::hair_grid_point_valid (const float vec[3], const float gmin[3], const float gmax[3])
BLI_INLINE float blender::dist_tent_v3f3 (const float a[3], float x, float y, float z)
BLI_INLINE float blender::weights_sum (const float weights[8])
BLI_INLINE int blender::hair_grid_weights (const int res[3], const float gmin[3], float scale, const float vec[3], float weights[8])
BLI_INLINE void blender::grid_to_world (HairGrid *grid, float vecw[3], const float vec[3])
void blender::SIM_hair_volume_add_vertex (HairGrid *grid, const float x[3], const float v[3])
BLI_INLINE void blender::hair_volume_eval_grid_vertex_sample (HairGridVert *vert, const float loc[3], float radius, float dist_scale, const float x[3], const float v[3])
void blender::SIM_hair_volume_add_segment (HairGrid *grid, const float[3], const float[3], const float x2[3], const float v2[3], const float x3[3], const float v3[3], const float[3], const float[3], const float[3], const float[3], const float[3])
void blender::SIM_hair_volume_normalize_vertex_grid (HairGrid *grid)
BLI_INLINE float blender::hair_volume_density_divergence (float density, float target_density, float strength)
bool blender::SIM_hair_volume_solve_divergence (HairGrid *grid, float, float target_density, float target_strength)
HairGrid * blender::SIM_hair_volume_create_vertex_grid (float cellsize, const float gmin[3], const float gmax[3])
void blender::SIM_hair_volume_free_vertex_grid (HairGrid *grid)
void blender::SIM_hair_volume_grid_geometry (HairGrid *grid, float *cellsize, int res[3], float gmin[3], float gmax[3])

Variables

static float blender::I [3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}
static const float blender::density_threshold = 0.001f

Macro Definition Documentation

◆ HAIR_GRID_INDEX_AXIS

#define HAIR_GRID_INDEX_AXIS ( vec,
res,
gmin,
scale,
axis )
Value:
min_ii(max_ii(int((vec[axis] - gmin[axis]) * scale), 0), res[axis] - 2)
float3x3 scale(float3x3 mat, float2 scale)

Definition at line 69 of file hair_volume.cc.

Referenced by blender::hair_grid_interp_weights(), blender::hair_grid_offset(), and blender::hair_grid_weights().

◆ MARGIN_i0

#define MARGIN_i0   (i < 1)

◆ MARGIN_i1

#define MARGIN_i1   (i >= resA[0] - 1)

◆ MARGIN_j0

#define MARGIN_j0   (j < 1)

◆ MARGIN_j1

#define MARGIN_j1   (j >= resA[1] - 1)

◆ MARGIN_k0

#define MARGIN_k0   (k < 1)

◆ MARGIN_k1

#define MARGIN_k1   (k >= resA[2] - 1)

◆ NEIGHBOR_MARGIN_i0

#define NEIGHBOR_MARGIN_i0   (i < 2)

◆ NEIGHBOR_MARGIN_i1

#define NEIGHBOR_MARGIN_i1   (i >= resA[0] - 2)

◆ NEIGHBOR_MARGIN_j0

#define NEIGHBOR_MARGIN_j0   (j < 2)

◆ NEIGHBOR_MARGIN_j1

#define NEIGHBOR_MARGIN_j1   (j >= resA[1] - 2)

◆ NEIGHBOR_MARGIN_k0

#define NEIGHBOR_MARGIN_k0   (k < 2)

◆ NEIGHBOR_MARGIN_k1

#define NEIGHBOR_MARGIN_k1   (k >= resA[2] - 2)