31 static float I3[3][3] = {{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}};
41 for (link = cloth->
springs; link; link = link->
next) {
43 switch (spring->
type) {
68 for (
unsigned int j = 0; j < 3; j++) {
69 r_weights[j] =
verts[vt->
tri[j]].pressure_factor;
72 if (r_weights[j] == 0.0f) {
82 const float gradient_vector[3],
83 float *r_vertex_pressure)
87 unsigned int mvert_num = cloth->
mvert_num;
90 for (
unsigned int i = 0; i < mvert_num; i++) {
92 r_vertex_pressure[i] =
dot_v3v3(pt, gradient_vector);
102 float weights[3] = {1.0f, 1.0f, 1.0f};
130 float weights[3] = {1.0f, 1.0f, 1.0f};
143 v[vt->
tri[0]].xrest,
v[vt->
tri[1]].xrest,
v[vt->
tri[2]].xrest);
158 float weights[3] = {1.0f, 1.0f, 1.0f};
159 float total_force = 0;
160 float total_area = 0;
168 total_force += (vertex_pressure[vt->
tri[0]] + vertex_pressure[vt->
tri[1]] +
169 vertex_pressure[vt->
tri[2]]) *
175 return total_force / total_area;
182 const float ZERO[3] = {0.0f, 0.0f, 0.0f};
184 unsigned int i, nondiag;
219 unsigned int mvert_num = cloth->
mvert_num, i;
223 for (i = 0; i < mvert_num; i++) {
224 if (cloth_hairdata) {
255 const float ZERO[3] = {0.0f, 0.0f, 0.0f};
259 for (
v = 0;
v < mvert_num;
v++) {
265 verts[
v].impulse_count = 0;
276 float (*initial_cos)[3],
280 Cloth *cloth = clmd->clothObject;
282 "cos cloth_calc_helper_forces");
284 "cos cloth_calc_helper_forces");
291 for (i = 0; i < cloth->
mvert_num; i++, cv++) {
298 masses[i] = cv->
mass;
303 for (i = 0; i <
steps; i++) {
307 float len,
c,
l, vec[3];
328 l =
c / ((1.0f / masses[
v1]) + (1.0f / masses[
v2]));
342 for (i = 0; i < cloth->
mvert_num; i++, cv++) {
371 #ifdef CLOTH_FORCE_SPRING_BEND
388 #ifdef CLOTH_FORCE_SPRING_STRUCTURAL
389 float k_tension, scaling_tension;
393 scaling_tension = parms->
tension +
395 k_tension = scaling_tension / (parms->
avg_spring_len + FLT_EPSILON);
414 float k_compression, scaling_compression;
417 k_compression = scaling_compression / (parms->
avg_spring_len + FLT_EPSILON);
438 k_tension = scaling_tension / (parms->
avg_spring_len + FLT_EPSILON);
442 float k_compression = scaling_compression / (parms->
avg_spring_len + FLT_EPSILON);
447 if (k_tension == 0.0f) {
449 k_tension_damp = 0.0f;
452 if (k_compression == 0.0f) {
454 k_compression_damp = 0.0f;
472 #ifdef CLOTH_FORCE_SPRING_SHEAR
494 #ifdef CLOTH_FORCE_SPRING_BEND
495 float kb, cb, scaling;
509 #ifdef CLOTH_FORCE_SPRING_BEND
510 float kb, cb, scaling;
530 float x_kl[3], x_mn[3],
v[3], d[3];
537 clmd->debug_data, x_kl, x_mn, 0.8, 0.8, 0.8,
"target", 7981, s->
kl);
541 clmd->debug_data, x_kl, d, 0.8, 0.8, 0.2,
"target", 7982, s->
kl);
555 unsigned int mvert_num = cloth->
mvert_num;
559 for (i = 0; i < mvert_num; i++) {
575 float gravity[3] = {0.0f, 0.0f, 0.0f};
577 unsigned int mvert_num = cloth->
mvert_num;
580 #ifdef CLOTH_FORCE_GRAVITY
590 for (i = 0; i < cloth->
mvert_num; i++, vert++) {
595 float goal_x[3], goal_v[3];
613 #ifdef CLOTH_FORCE_DRAG
619 float pressure_difference = 0.0f;
620 float volume_factor = 1.0f;
631 if (init_vol > 1E-6f) {
636 volume_factor = init_vol / vol;
637 pressure_difference = volume_factor - 1;
651 float *hydrostatic_pressure =
nullptr;
653 if (
fabs(fluid_density) > 1e-6f) {
654 float hydrostatic_vector[3];
660 if (fluid_density > 0) {
664 fluid_density *= volume_factor;
667 mul_v3_fl(hydrostatic_vector, fluid_density);
670 hydrostatic_pressure = (
float *)
MEM_mallocN(
sizeof(
float) * mvert_num,
671 "hydrostatic pressure gradient");
679 if (hydrostatic_pressure ||
fabs(pressure_difference) > 1E-6f) {
680 float weights[3] = {1.0f, 1.0f, 1.0f};
691 hydrostatic_pressure,
697 if (hydrostatic_pressure) {
705 bool has_wind =
false, has_force =
false;
710 float(*forcevec)[3] = is_not_hair ? winvec + mvert_num : winvec;
726 has_wind = has_wind || !
is_zero_v3(winvec[i]);
727 has_force = has_force || !
is_zero_v3(forcevec[i]);
751 hair_ij = &hairdata[spring->
ij];
752 hair_kl = &hairdata[spring->
kl];
765 for (i = 0; i < cloth->
mvert_num; i++, vert++) {
793 const float cell_offset[3],
827 const float cell_scale,
828 const float cell_offset[3],
833 LinkNode *next_spring_link =
nullptr;
837 float x1[3],
v1[3],
x2[3],
v2[3], x3[3], v3[3], x4[3], v4[3];
838 float dir1[3], dir2[3], dir3[3];
858 while (spring_link) {
876 next_spring_link = spring_link->
next;
903 spring1 ? dir1 :
nullptr,
905 spring3 ? dir3 :
nullptr);
908 return next_spring_link;
919 for (i = 0, vert = cloth->
verts; i < mvert_num; i++, vert++) {
922 cloth_get_vertex_motion_state(
data, vert,
x,
v);
927 float cellsize, gmin[3], cell_scale, cell_offset[3];
933 cell_scale = cellsize > 0.0f ? 1.0f / cellsize : 0.0f;
959 const float fluid_factor = 0.95f;
966 float gmin[3], gmax[3];
978 if (smoothfac > 0.0f || density_strength > 0.0f) {
987 for (i = 0, vert = cloth->
verts; i < mvert_num; i++, vert++) {
988 float x[3],
v[3], nv[3];
1011 const int size = 64;
1015 const float shift = 0.0f;
1028 for (j = 0; j <
size; j++) {
1029 for (i = 0; i <
size; i++) {
1030 float x[3],
v[3], gvel[3], gvel_smooth[3], gdensity;
1040 clmd->debug_data,
x, gdensity, 0.7, 0.3, 1,
1041 "grid density", i, j, 3111);
1048 clmd->debug_data,
x, gvel, 0.4, 0, 1,
1049 "grid velocity", i, j, 3112);
1051 clmd->debug_data,
x, gvel_smooth, 0.6, 1, 1,
1052 "grid velocity", i, j, 3113);
1055 clmd->debug_data,
x, dvel, 0.4, 1, 0.7,
"grid velocity", i, j, 3114);
1057 if (gdensity > 0.0f) {
1058 float col0[3] = {0.0, 0.0, 0.0};
1059 float col1[3] = {0.0, 1.0, 0.0};
1067 "grid velocity", i, j, 3115);
1070 "grid velocity", i, j, 3115);
1073 clmd->debug_data,
x, 0.01f,
col[0],
col[1],
col[2],
"grid velocity", i, j, 3115);
1098 float pressfac = parms->pressure;
1099 float minpress = parms->pressure_threshold;
1100 float gmin[3], gmax[3];
1106 if (smoothfac > 0.0f || pressfac > 0.0f) {
1108 clmd->
sim_parms->voxel_res, gmin, gmax);
1110 vert = cloth->
verts;
1111 for (i = 0; i < mvert_num; i++, vert++) {
1114 if (vert->solver_index < 0) {
1125 vert = cloth->
verts;
1126 for (i = 0; i < mvert_num; i++, vert++) {
1127 float x[3],
v[3], f[3], dfdx[3][3], dfdv[3][3];
1129 if (vert->solver_index < 0) {
1136 vertex_grid,
x,
v, smoothfac, pressfac, minpress, f, dfdx, dfdv);
1151 float total[3] = {0.0f, 0.0f, 0.0f};
1153 for (i = 0; i < mvert_num; i++) {
1163 mul_v3_fl(total, 1.0f / dt / mvert_num);
1192 for (i = 0; i < mvert_num; i++) {
1204 for (i = 0; i < mvert_num; i++) {
1264 const bool is_hair = (clmd->
hairdata !=
nullptr);
1270 unsigned int mvert_num = cloth->
mvert_num;
1281 clmd->
solver_result = MEM_cnew<ClothSolverResult>(
"cloth solver result");
1286 for (i = 0; i < mvert_num; i++) {
1299 if (!use_acceleration) {
1326 if (use_acceleration) {
1334 for (i = 0; i < mvert_num; i++) {
1353 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])
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
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
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)
void SIM_mass_spring_set_implicit_vertex_mass(Implicit_Data *data, int index, float mass)
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)
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
ccl_device_inline float2 fabs(const float2 &a)
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])
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
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