47 static float I3[3][3] = {{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}};
57 for (link = cloth->
springs; link; link = link->
next) {
59 switch (spring->
type) {
84 for (
unsigned int j = 0; j < 3; j++) {
85 r_weights[j] =
verts[vt->
tri[j]].pressure_factor;
88 if (r_weights[j] == 0.0f) {
98 const float gradient_vector[3],
99 float *r_vertex_pressure)
103 unsigned int mvert_num = cloth->
mvert_num;
106 for (
unsigned int i = 0; i < mvert_num; i++) {
108 r_vertex_pressure[i] =
dot_v3v3(pt, gradient_vector);
118 float weights[3] = {1.0f, 1.0f, 1.0f};
146 float weights[3] = {1.0f, 1.0f, 1.0f};
159 v[vt->
tri[0]].xrest,
v[vt->
tri[1]].xrest,
v[vt->
tri[2]].xrest);
174 float weights[3] = {1.0f, 1.0f, 1.0f};
175 float total_force = 0;
176 float total_area = 0;
184 total_force += (vertex_pressure[vt->
tri[0]] + vertex_pressure[vt->
tri[1]] +
185 vertex_pressure[vt->
tri[2]]) *
191 return total_force / total_area;
198 const float ZERO[3] = {0.0f, 0.0f, 0.0f};
200 unsigned int i, nondiag;
230 unsigned int mvert_num = cloth->
mvert_num, i;
234 for (i = 0; i < mvert_num; i++) {
235 if (cloth_hairdata) {
266 const float ZERO[3] = {0.0f, 0.0f, 0.0f};
270 for (
v = 0;
v < mvert_num;
v++) {
276 verts[
v].impulse_count = 0;
286 float (*initial_cos)[3],
290 Cloth *cloth = clmd->clothObject;
292 "cos cloth_calc_helper_forces");
294 "cos cloth_calc_helper_forces");
301 for (i = 0; i < cloth->
mvert_num; i++, cv++) {
308 masses[i] = cv->
mass;
313 for (i = 0; i <
steps; i++) {
317 float len,
c,
l, vec[3];
338 l =
c / ((1.0f / masses[
v1]) + (1.0f / masses[
v2]));
352 for (i = 0; i < cloth->
mvert_num; i++, cv++) {
381 #ifdef CLOTH_FORCE_SPRING_BEND
398 #ifdef CLOTH_FORCE_SPRING_STRUCTURAL
399 float k_tension, scaling_tension;
403 scaling_tension = parms->
tension +
405 k_tension = scaling_tension / (parms->
avg_spring_len + FLT_EPSILON);
424 float k_compression, scaling_compression;
427 k_compression = scaling_compression / (parms->
avg_spring_len + FLT_EPSILON);
448 k_tension = scaling_tension / (parms->
avg_spring_len + FLT_EPSILON);
452 float k_compression = scaling_compression / (parms->
avg_spring_len + FLT_EPSILON);
457 if (k_tension == 0.0f) {
459 k_tension_damp = 0.0f;
462 if (k_compression == 0.0f) {
464 k_compression_damp = 0.0f;
482 #ifdef CLOTH_FORCE_SPRING_SHEAR
504 #ifdef CLOTH_FORCE_SPRING_BEND
505 float kb, cb, scaling;
519 #ifdef CLOTH_FORCE_SPRING_BEND
520 float kb, cb, scaling;
540 float x_kl[3], x_mn[3],
v[3], d[3];
547 clmd->debug_data, x_kl, x_mn, 0.8, 0.8, 0.8,
"target", 7981, s->
kl);
551 clmd->debug_data, x_kl, d, 0.8, 0.8, 0.2,
"target", 7982, s->
kl);
565 unsigned int mvert_num = cloth->
mvert_num;
569 for (i = 0; i < mvert_num; i++) {
585 float gravity[3] = {0.0f, 0.0f, 0.0f};
587 unsigned int mvert_num = cloth->
mvert_num;
590 #ifdef CLOTH_FORCE_GRAVITY
600 for (i = 0; i < cloth->
mvert_num; i++, vert++) {
605 float goal_x[3], goal_v[3];
623 #ifdef CLOTH_FORCE_DRAG
629 float pressure_difference = 0.0f;
630 float volume_factor = 1.0f;
641 if (init_vol > 1E-6f) {
646 volume_factor = init_vol / vol;
647 pressure_difference = volume_factor - 1;
661 float *hydrostatic_pressure =
nullptr;
663 if (
fabs(fluid_density) > 1e-6f) {
664 float hydrostatic_vector[3];
670 if (fluid_density > 0) {
674 fluid_density *= volume_factor;
677 mul_v3_fl(hydrostatic_vector, fluid_density);
680 hydrostatic_pressure = (
float *)
MEM_mallocN(
sizeof(
float) * mvert_num,
681 "hydrostatic pressure gradient");
689 if (hydrostatic_pressure ||
fabs(pressure_difference) > 1E-6f) {
690 float weights[3] = {1.0f, 1.0f, 1.0f};
701 hydrostatic_pressure,
707 if (hydrostatic_pressure) {
715 bool has_wind =
false, has_force =
false;
720 float(*forcevec)[3] = is_not_hair ? winvec + mvert_num : winvec;
736 has_wind = has_wind || !
is_zero_v3(winvec[i]);
737 has_force = has_force || !
is_zero_v3(forcevec[i]);
761 hair_ij = &hairdata[spring->
ij];
762 hair_kl = &hairdata[spring->
kl];
775 for (i = 0; i < cloth->
mvert_num; i++, vert++) {
803 const float cell_offset[3],
837 const float cell_scale,
838 const float cell_offset[3],
843 LinkNode *next_spring_link =
nullptr;
847 float x1[3],
v1[3],
x2[3],
v2[3], x3[3], v3[3], x4[3], v4[3];
848 float dir1[3], dir2[3], dir3[3];
868 while (spring_link) {
886 next_spring_link = spring_link->
next;
913 spring1 ? dir1 :
nullptr,
915 spring3 ? dir3 :
nullptr);
918 return next_spring_link;
929 for (i = 0, vert = cloth->
verts; i < mvert_num; i++, vert++) {
932 cloth_get_vertex_motion_state(
data, vert,
x,
v);
937 float cellsize, gmin[3], cell_scale, cell_offset[3];
943 cell_scale = cellsize > 0.0f ? 1.0f / cellsize : 0.0f;
969 const float fluid_factor = 0.95f;
976 float gmin[3], gmax[3];
988 if (smoothfac > 0.0f || density_strength > 0.0f) {
997 for (i = 0, vert = cloth->
verts; i < mvert_num; i++, vert++) {
998 float x[3],
v[3], nv[3];
1021 const int size = 64;
1023 float offset[3],
a[3], b[3];
1025 const float shift = 0.0f;
1038 for (j = 0; j <
size; j++) {
1039 for (i = 0; i <
size; i++) {
1040 float x[3],
v[3], gvel[3], gvel_smooth[3], gdensity;
1061 clmd->debug_data,
x, dvel, 0.4, 1, 0.7,
"grid velocity", i, j, 3114);
1063 if (gdensity > 0.0f) {
1064 float col0[3] = {0.0, 0.0, 0.0};
1065 float col1[3] = {0.0, 1.0, 0.0};
1077 clmd->debug_data,
x, 0.01f,
col[0],
col[1],
col[2],
"grid velocity", i, j, 3115);
1102 float pressfac = parms->pressure;
1103 float minpress = parms->pressure_threshold;
1104 float gmin[3], gmax[3];
1110 if (smoothfac > 0.0f || pressfac > 0.0f) {
1112 clmd->
sim_parms->voxel_res, gmin, gmax);
1114 vert = cloth->
verts;
1115 for (i = 0; i < mvert_num; i++, vert++) {
1118 if (vert->solver_index < 0) {
1129 vert = cloth->
verts;
1130 for (i = 0; i < mvert_num; i++, vert++) {
1131 float x[3],
v[3], f[3], dfdx[3][3], dfdv[3][3];
1133 if (vert->solver_index < 0) {
1140 vertex_grid,
x,
v, smoothfac, pressfac, minpress, f, dfdx, dfdv);
1155 float total[3] = {0.0f, 0.0f, 0.0f};
1157 for (i = 0; i < mvert_num; i++) {
1167 mul_v3_fl(total, 1.0f / dt / mvert_num);
1196 for (i = 0; i < mvert_num; i++) {
1208 for (i = 0; i < mvert_num; i++) {
1268 const bool is_hair = (clmd->
hairdata !=
nullptr);
1274 unsigned int mvert_num = cloth->
mvert_num;
1286 "cloth solver result");
1291 for (i = 0; i < mvert_num; i++) {
1304 if (!use_acceleration) {
1331 if (use_acceleration) {
1339 for (i = 0; i < mvert_num; i++) {
1358 for (i = 0; i < mvert_num; i++) {
typedef float(TangentPoint)[2]
@ CLOTH_SPRING_TYPE_SEWING
@ CLOTH_SPRING_TYPE_SHEAR
@ CLOTH_SPRING_TYPE_BENDING_HAIR
@ CLOTH_SPRING_TYPE_STRUCTURAL
@ CLOTH_SPRING_TYPE_BENDING
@ CLOTH_SPRING_TYPE_INTERNAL
int cloth_bvh_collision(struct Depsgraph *depsgraph, struct Object *ob, struct ClothModifierData *clmd, float step, float dt)
@ CLOTH_SPRING_FLAG_DEACTIVATE
@ CLOTH_SPRING_FLAG_NEEDED
#define BKE_sim_debug_data_add_dot(p, r, g, b, category,...)
void BKE_sim_debug_data_clear_category(const char *category)
#define BKE_sim_debug_data_add_vector(p, d, r, g, b, category,...)
#define BKE_sim_debug_data_add_line(p1, p2, r, g, b, category,...)
void BKE_effectors_apply(struct ListBase *effectors, struct ListBase *colliders, struct EffectorWeights *weights, struct EffectedPoint *point, float *force, float *wind_force, float *impulse)
#define BKE_sim_debug_data_add_circle(p, radius, r, g, b, category,...)
void pd_point_from_loc(struct Scene *scene, float *loc, float *vel, int index, struct EffectedPoint *point)
MINLINE float max_ff(float a, float b)
MINLINE int min_ii(int a, int b)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
float volume_tri_tetrahedron_signed_v3_6x(const float v1[3], const float v2[3], const float v3[3])
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], const float t)
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f)
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE float len_squared_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE bool is_zero_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void zero_v3_int(int r[3])
MINLINE void negate_v3(float r[3])
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void mul_v3_v3fl(float r[3], const float a[3], float f)
MINLINE void add_v3_v3(float r[3], const float a[3])
#define UNUSED_FUNCTION(x)
#define INIT_MINMAX(min, max)
#define DO_MINMAX(vec, min, max)
struct Depsgraph Depsgraph
struct Scene * DEG_get_evaluated_scene(const struct Depsgraph *graph)
@ CLOTH_COLLSETTINGS_FLAG_ENABLED
@ CLOTH_COLLSETTINGS_FLAG_SELF
@ CLOTH_SIMSETTINGS_FLAG_PRESSURE_VOL
@ CLOTH_SIMSETTINGS_FLAG_PRESSURE
@ CLOTH_SIMSETTINGS_FLAG_RESIST_SPRING_COMPRESS
Object is a sort of wrapper for general info.
#define PHYS_GLOBAL_GRAVITY
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble x2
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
Read Guarded memory(de)allocation.
void SIM_cloth_solver_free(ClothModifierData *clmd)
BLI_INLINE void cloth_get_grid_location(Implicit_Data *data, float cell_scale, const float cell_offset[3], int index, float x[3], float v[3])
static void cloth_continuum_step(ClothModifierData *clmd, float dt)
static bool cloth_get_pressure_weights(ClothModifierData *clmd, const MVertTri *vt, float *r_weights)
static void cloth_continuum_fill_grid(HairGrid *grid, Cloth *cloth)
static void cloth_clear_result(ClothModifierData *clmd)
static float cloth_calc_average_pressure(ClothModifierData *clmd, const float *vertex_pressure)
int SIM_cloth_solver_init(Object *UNUSED(ob), ClothModifierData *clmd)
static int UNUSED_FUNCTION() cloth_calc_helper_forces(Object *UNUSED(ob), ClothModifierData *clmd, float(*initial_cos)[3], float UNUSED(step), float dt)
static float cloth_calc_rest_volume(ClothModifierData *clmd)
static void cloth_calc_pressure_gradient(ClothModifierData *clmd, const float gradient_vector[3], float *r_vertex_pressure)
static int cloth_count_nondiag_blocks(Cloth *cloth)
static void hair_get_boundbox(ClothModifierData *clmd, float gmin[3], float gmax[3])
static LinkNode * cloth_continuum_add_hair_segments(HairGrid *grid, const float cell_scale, const float cell_offset[3], Cloth *cloth, LinkNode *spring_link)
static void cloth_calc_average_acceleration(ClothModifierData *clmd, float dt)
static void cloth_calc_force(Scene *scene, ClothModifierData *clmd, float UNUSED(frame), ListBase *effectors, float time)
static void cloth_record_result(ClothModifierData *clmd, ImplicitSolverResult *result, float dt)
BLI_INLINE LinkNode * hair_spring_next(LinkNode *spring_link)
BLI_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s)
void SIM_cloth_solver_set_volume(ClothModifierData *clmd)
static void cloth_setup_constraints(ClothModifierData *clmd)
static float cloth_calc_volume(ClothModifierData *clmd)
static void cloth_solve_collisions(Depsgraph *depsgraph, Object *ob, ClothModifierData *clmd, float step, float dt)
void SIM_cloth_solver_set_positions(ClothModifierData *clmd)
int SIM_cloth_solve(Depsgraph *depsgraph, Object *ob, float frame, ClothModifierData *clmd, ListBase *effectors)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
const Depsgraph * depsgraph
void SIM_hair_volume_grid_velocity(HairGrid *grid, const float x[3], const float v[3], float fluid_factor, float r_v[3])
void 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 SIM_hair_volume_grid_geometry(HairGrid *grid, float *cellsize, int res[3], float gmin[3], float gmax[3])
void SIM_hair_volume_free_vertex_grid(HairGrid *grid)
bool SIM_hair_volume_solve_divergence(HairGrid *grid, float, float target_density, float target_strength)
void SIM_hair_volume_add_vertex(HairGrid *grid, const float x[3], const float v[3])
void SIM_hair_volume_normalize_vertex_grid(HairGrid *grid)
void SIM_hair_volume_add_segment(HairGrid *grid, const float UNUSED(x1[3]), const float UNUSED(v1[3]), const float x2[3], const float v2[3], const float x3[3], const float v3[3], const float UNUSED(x4[3]), const float UNUSED(v4[3]), const float UNUSED(dir1[3]), const float UNUSED(dir2[3]), const float UNUSED(dir3[3]))
HairGrid * SIM_hair_volume_create_vertex_grid(float cellsize, const float gmin[3], const float gmax[3])
void 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 SIM_mass_spring_force_vertex_wind(struct Implicit_Data *data, int v, float radius, const float(*winvec)[3])
float SIM_tri_tetra_volume_signed_6x(struct Implicit_Data *data, int v1, int v2, int v3)
void SIM_mass_spring_get_motion_state(struct Implicit_Data *data, int index, float x[3], float v[3])
void SIM_mass_spring_add_constraint_ndof0(struct Implicit_Data *data, int index, const float dV[3])
void SIM_mass_spring_force_edge_wind(struct Implicit_Data *data, int v1, int v2, float radius1, float radius2, const float(*winvec)[3])
void SIM_mass_spring_set_new_velocity(struct Implicit_Data *data, int index, const float v[3])
bool SIM_mass_spring_force_spring_goal(struct Implicit_Data *data, int i, const float goal_x[3], const float goal_v[3], float stiffness, float damping)
float SIM_tri_area(struct Implicit_Data *data, int v1, int v2, int v3)
void SIM_mass_spring_set_vertex_mass(struct Implicit_Data *data, int index, float mass)
void SIM_mass_spring_force_face_extern(struct Implicit_Data *data, int v1, int v2, int v3, const float(*forcevec)[3])
void SIM_mass_spring_get_velocity(struct Implicit_Data *data, int index, float v[3])
void SIM_mass_spring_set_motion_state(struct Implicit_Data *data, int index, const float x[3], const float v[3])
bool SIM_mass_spring_force_spring_linear(struct Implicit_Data *data, int i, int j, float restlen, float stiffness_tension, float damping_tension, float stiffness_compression, float damping_compression, bool resist_compress, bool new_compress, float clamp_force)
void SIM_mass_spring_get_new_position(struct Implicit_Data *data, int index, float x[3])
bool SIM_mass_spring_force_spring_bending(struct Implicit_Data *data, int i, int j, float restlen, float kb, float cb)
void SIM_mass_spring_apply_result(struct Implicit_Data *data)
void SIM_mass_spring_set_position(struct Implicit_Data *data, int index, const float x[3])
bool SIM_mass_spring_force_spring_bending_hair(struct Implicit_Data *data, int i, int j, int k, const float target[3], float stiffness, float damping)
void SIM_mass_spring_force_pressure(struct Implicit_Data *data, int v1, int v2, int v3, float common_pressure, const float *vertex_pressure, const float weights[3])
void SIM_mass_spring_force_face_wind(struct Implicit_Data *data, int v1, int v2, int v3, const float(*winvec)[3])
void SIM_mass_spring_get_position(struct Implicit_Data *data, int index, float x[3])
bool SIM_mass_spring_solve_velocities(struct Implicit_Data *data, float dt, struct ImplicitSolverResult *result)
void SIM_mass_spring_force_drag(struct Implicit_Data *data, float drag)
void SIM_mass_spring_clear_constraints(struct Implicit_Data *data)
bool SIM_mass_spring_solve_positions(struct Implicit_Data *data, float dt)
void SIM_mass_spring_get_new_velocity(struct Implicit_Data *data, int index, float v[3])
void SIM_mass_spring_set_velocity(struct Implicit_Data *data, int index, const float v[3])
bool SIM_mass_spring_force_spring_angular(struct Implicit_Data *data, int i, int j, int *i_a, int *i_b, int len_a, int len_b, float restang, float stiffness, float damping)
void SIM_mass_spring_force_extern(struct Implicit_Data *data, int i, const float f[3], float dfdx[3][3], float dfdv[3][3])
void SIM_mass_spring_force_gravity(struct Implicit_Data *data, int index, float mass, const float g[3])
void SIM_mass_spring_set_rest_transform(struct Implicit_Data *data, int index, float tfm[3][3])
void SIM_mass_spring_clear_forces(struct Implicit_Data *data)
Implicit_Data * SIM_mass_spring_solver_create(int numverts, int numsprings)
void SIM_mass_spring_solver_free(Implicit_Data *id)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
static void area(int d1, int d2, int e1, int e2, float weights[2])
struct ClothSolverResult * solver_result
struct ClothHairData * hairdata
struct Cloth * clothObject
struct ClothSimSettings * sim_parms
struct ClothCollSettings * coll_parms
struct EffectorWeights * effector_weights
float uniform_pressure_force
float max_internal_tension
float max_internal_compression
float internal_compression
struct LinkNode * springs
float initial_mesh_volume
float average_acceleration[3]
struct Implicit_Data * implicit
struct ClothVertex * verts
unsigned int primitive_num
struct PhysicsSettings physics_settings
ccl_device_inline float2 fabs(const float2 &a)