83 if (!cloth->primitive_num) {
92 for (
int i = 0; i < cloth->primitive_num; i++) {
105 for (
int i = 0; i < cloth->primitive_num; i++) {
131 bvhtree = cloth->bvhselftree;
134 bvhtree = cloth->bvhtree;
145 if (
verts && vert_tris) {
146 for (i = 0; i < cloth->primitive_num; i++) {
147 float co[3][3], co_moving[3][3];
184 for (i = 0; i < cloth->primitive_num; i++) {
260 bool vert_mass_changed =
false;
264 const Span<float3> positions = result->vert_positions();
277 if (vert_mass_changed) {
324 float (*vertexCos)[3])
329 int framenr, startframe, endframe;
347 cache->
flag &= ~PTCACHE_REDO_NEEDED;
351 if (framenr < startframe) {
355 if (framenr > endframe) {
364 if (framenr == startframe) {
368 cache->
flag &= ~PTCACHE_REDO_NEEDED;
381 cache_result =
BKE_ptcache_read(&pid,
float(framenr) + scene->r.subframe, can_simulate);
435 Cloth *cloth =
nullptr;
448 cloth->mvert_num = 0;
451 if (cloth->springs !=
nullptr) {
460 search = search->
next;
464 cloth->springs =
nullptr;
467 cloth->springs =
nullptr;
468 cloth->numsprings = 0;
471 if (cloth->bvhtree) {
475 if (cloth->bvhselftree && cloth->bvhselftree != cloth->bvhtree) {
480 if (cloth->vert_tris) {
496 Cloth *cloth =
nullptr;
498 printf(
"cloth_free_modifier_extern\n");
509 printf(
"cloth_free_modifier_extern in\n");
516 cloth->mvert_num = 0;
519 if (cloth->springs !=
nullptr) {
528 search = search->
next;
532 cloth->springs =
nullptr;
535 cloth->springs =
nullptr;
536 cloth->numsprings = 0;
539 if (cloth->bvhtree) {
543 if (cloth->bvhselftree && cloth->bvhselftree != cloth->bvhtree) {
548 if (cloth->vert_tris) {
580 for (i = 0; i < cloth->mvert_num; i++) {
582 mul_m4_v3(ob->world_to_object().ptr(), vertexCos[i]);
604 if (!clmd || !mesh) {
608 int mvert_num = mesh->verts_num;
615 for (
int i = 0; i < mvert_num; i++,
verts++) {
626 verts->shrink_factor = 0.0f;
634 for (
int j = 0; j < dvert->
totweight; j++) {
701 float k1 = base + shrink_factor_delta *
verts[i1].shrink_factor;
702 float k2 = base + shrink_factor_delta *
verts[i2].shrink_factor;
706 return sqrtf(k1 * k2);
715 const float(*shapekey_rest)[3] =
nullptr;
716 const float tnull[3] = {0, 0, 0};
722 printf(
"cloth_free_modifier cloth_from_object\n");
750 shapekey_rest =
static_cast<const float(*)[3]
>(
759 for (i = 0; i < mesh->verts_num; i++,
verts++) {
776 verts->impulse_count = 0;
785 verts->shrink_factor = 0.0f;
794 verts->impulse_count = 0;
832 const uint mvert_num = mesh->verts_num;
890 for (
uint i = 0; i < mvert_num; i++) {
902 if (cloth->springs !=
nullptr) {
911 search = search->
next;
915 cloth->springs =
nullptr;
922 cloth->edgeset.clear_and_shrink();
929 float fact = 1.0f /
len;
931 for (
int x = 0; x <
len; x++) {
941 float dir_a[3], dir_b[3];
942 float tmp[3], vec_e[3];
966 float hair_frame[3][3], dir_old[3], dir_new[3];
982 for (search = cloth->springs; search; search = search->
next) {
985 bool is_root = spring->
kl != prev_mn;
1003 sub_v3_v3v3(dir_new, cloth->verts[spring->
mn].x, cloth->verts[spring->
kl].x);
1016 prev_mn = spring->
mn;
1024 float hair_frame[3][3], dir_old[3], dir_new[3];
1040 for (search = cloth->springs; search; search = search->
next) {
1043 bool is_root = spring->
kl != prev_mn;
1061 sub_v3_v3v3(dir_new, cloth->verts[spring->
mn].xrest, cloth->verts[spring->
kl].xrest);
1071 prev_mn = spring->
mn;
1081 search = cloth->springs;
1090 cloth->verts[spring->
ij].bend_stiff) /
1097 cloth->verts[spring->
ij].struct_stiff) /
1102 cloth->verts[spring->
ij].shear_stiff) /
1107 cloth->verts[spring->
ij].bend_stiff) /
1112 cloth->verts[spring->
ij].internal_stiff) /
1133 spring->
flags &= ~CLOTH_SPRING_FLAG_DEACTIVATE;
1140 search = search->
next;
1155 for (i = 0; i < mesh->verts_num; i++,
verts++) {
1170 for (
const int i : positions.index_range()) {
1171 positions[i] =
verts[i].xrest;
1173 new_mesh->tag_positions_changed();
1183 uint struct_springs = 0;
1185 uint mvert_num =
uint(mesh->verts_num);
1186 float shrink_factor;
1190 for (i = 0; i < mvert_num; i++) {
1191 cloth->verts[i].avg_spring_len = 0.0f;
1204 shrink_factor = 1.0f;
1207 spring->
restlen =
len_v3v3(cloth->verts[spring->
kl].xrest, cloth->verts[spring->
ij].xrest) *
1212 cloth->verts, spring->
ij, spring->
kl, spring->
pa, spring->
pb, spring->
la, spring->
lb);
1218 cloth->verts[spring->
ij].avg_spring_len += spring->
restlen;
1219 cloth->verts[spring->
kl].avg_spring_len += spring->
restlen;
1223 search = search->
next;
1226 if (struct_springs > 0) {
1230 for (i = 0; i < mvert_num; i++) {
1231 if (cloth->verts[i].spring_count > 0) {
1232 cloth->verts[i].avg_spring_len = cloth->verts[i].avg_spring_len * 0.49f /
1233 float(cloth->verts[i].spring_count);
1251 r[0][0] += m[0][0] * f;
1252 r[0][1] += m[0][1] * f;
1253 r[0][2] += m[0][2] * f;
1254 r[1][0] += m[1][0] * f;
1255 r[1][1] += m[1][1] * f;
1256 r[1][2] += m[1][2] * f;
1257 r[2][0] += m[2][0] * f;
1258 r[2][1] += m[2][1] * f;
1259 r[2][2] += m[2][2] * f;
1263 const float dir_old[3],
1264 const float dir_new[3])
1286 const int *tmp_corner;
1287 float shrink_factor;
1300 spring->
restlen =
len_v3v3(cloth->verts[spring->
kl].xrest, cloth->verts[spring->
ij].xrest) *
1304 cloth->verts[spring->
ij].shear_stiff) /
1316 spring->
la = k - j + 1;
1317 spring->
lb = faces[i].size() - k + j + 1;
1319 spring->
pa =
static_cast<int *
>(
MEM_mallocN(
sizeof(*spring->
pa) * spring->
la,
"spring poly"));
1324 spring->
pb =
static_cast<int *
>(
MEM_mallocN(
sizeof(*spring->
pb) * spring->
lb,
"spring poly"));
1329 tmp_corner = &corner_verts[faces[i].start()];
1331 for (x = 0; x < spring->
la; x++) {
1332 spring->
pa[
x] = tmp_corner[j +
x];
1335 for (x = 0; x <= j; x++) {
1336 spring->
pb[
x] = tmp_corner[
x];
1339 for (y = k; y < faces[i].size(); x++, y++) {
1340 spring->
pb[
x] = tmp_corner[
y];
1346 cloth->verts, spring->
ij, spring->
kl, spring->
pa, spring->
pb, spring->
la, spring->
lb);
1349 cloth->verts[spring->
kl].bend_stiff) /
1360 int *p =
static_cast<int *
>(
MEM_mallocN(
sizeof(
int) *
len,
"spring poly"));
1366 for (
int i = 0; i <
len; i++) {
1367 p[i] = corner_verts[i];
1380 float max_diversion,
1384 float co[3], no[3], new_co[3];
1390 float vec_len = sin(max_diversion);
1408 if (max_length == 0.0f) {
1414 rayhit.
dist = max_length;
1422 if (rayhit.
index != -1 && rayhit.
dist <= max_length) {
1423 if (check_normal &&
dot_v3v3(rayhit.
no, no) < 0.0f) {
1431 for (
int i = 0; i < 3; i++) {
1432 int tmp_vert_idx = corner_verts[tri[i]];
1433 if (tmp_vert_idx == v_idx) {
1439 if (
len < min_len) {
1441 vert_idx = tmp_vert_idx;
1445 *r_tar_v_idx = vert_idx;
1457 ClothSpring *spring =
nullptr, *tspring =
nullptr, *tspring2 =
nullptr;
1458 uint struct_springs = 0, shear_springs = 0, bend_springs = 0, struct_springs_real = 0;
1459 uint mvert_num =
uint(mesh->verts_num);
1460 uint numedges =
uint(mesh->edges_num);
1461 uint numface =
uint(mesh->faces_num);
1462 float shrink_factor;
1464 const OffsetIndices faces = mesh->faces();
1465 const Span<int> corner_verts = mesh->corner_verts();
1466 const Span<int> corner_edges = mesh->corner_edges();
1469 LinkNode *search =
nullptr, *search2 =
nullptr;
1473 if (numedges == 0) {
1482 cloth->springs =
nullptr;
1486 MEM_callocN(
sizeof(*spring_ref) * numedges, __func__));
1502 if (use_internal_springs && numface > 0) {
1505 Mesh *tmp_mesh =
nullptr;
1515 Set<OrderedEdge> existing_vert_pairs;
1520 mesh->vert_normals();
1522 for (
int i = 0; i < mvert_num; i++) {
1533 if (existing_vert_pairs.contains({i, tar_v_idx})) {
1538 existing_vert_pairs.add({i, tar_v_idx});
1547 cloth->verts[spring->
ij].xrest) *
1550 cloth->verts[spring->
ij].internal_stiff) /
1559 spring_ref[i].
spring = spring;
1573 existing_vert_pairs.clear_and_shrink();
1582 for (
int i = 0; i < mvert_num; i++) {
1583 cloth->verts[i].avg_spring_len = 0.0f;
1588 BLI_assert(cloth->sew_edge_graph.is_empty());
1593 for (
int i = 0; i < numedges; i++) {
1606 cloth->sew_edge_graph.add({edges[i][0], edges[i][1]});
1611 cloth->verts[spring->
ij].xrest) *
1614 cloth->verts[spring->
ij].struct_stiff) /
1619 cloth->verts[spring->
ij].avg_spring_len += spring->
restlen;
1620 cloth->verts[spring->
kl].avg_spring_len += spring->
restlen;
1621 cloth->verts[spring->
ij].spring_count++;
1622 cloth->verts[spring->
kl].spring_count++;
1623 struct_springs_real++;
1632 spring_ref[i].
spring = spring;
1641 if (struct_springs_real > 0) {
1645 for (
int i = 0; i < mvert_num; i++) {
1646 if (cloth->verts[i].spring_count > 0) {
1647 cloth->verts[i].avg_spring_len = cloth->verts[i].avg_spring_len * 0.49f /
1648 float(cloth->verts[i].spring_count);
1652 cloth->edgeset.reserve(numedges);
1655 for (
int i = 0; i < numface; i++) {
1658 if (faces[i].
size() > 3) {
1659 for (
int j = 1; j < faces[i].size() - 1; j++) {
1674 for (
int k = j + 2; k < faces[i].size(); k++) {
1692 for (
int j = 0; j < faces[i].size(); j++) {
1693 const int edge_i = corner_edges[faces[i][j]];
1698 if (curr_ref->
face == 1) {
1699 curr_ref->
index = i;
1702 else if (curr_ref->
face == 2) {
1703 spring = curr_ref->
spring;
1707 spring->
la = faces[curr_ref->
index].size();
1708 spring->
lb = faces[i].size();
1711 &spring->
pa, spring->
la, &corner_verts[faces[curr_ref->
index].start()]) ||
1713 &spring->
pb, spring->
lb, &corner_verts[faces[i].start()]))
1719 spring->
mn = edge_i;
1730 cloth->verts[spring->
kl].bend_stiff) /
1736 else if (curr_ref->
face == 3) {
1737 spring = curr_ref->
spring;
1739 spring->
type &= ~CLOTH_SPRING_TYPE_BENDING;
1742 spring->
pa =
nullptr;
1743 spring->
pb =
nullptr;
1753 search2 = cloth->springs;
1755 for (
int i = struct_springs; i < struct_springs + shear_springs; i++) {
1760 tspring2 =
static_cast<ClothSpring *
>(search2->link);
1761 search = edgelist[tspring2->kl].
list;
1765 index2 = ((tspring->ij == tspring2->kl) ? (tspring->kl) : (tspring->ij));
1769 if ((index2 != tspring2->ij) && !cloth->edgeset.contains({tspring2->ij, index2})) {
1780 cloth->verts[spring->
ij].xrest) *
1784 cloth->verts[spring->
ij].bend_stiff) /
1786 cloth->edgeset.add({spring->
ij, spring->
kl});
1792 search = search->
next;
1795 search2 = search2->
next;
1799 else if (struct_springs > 2) {
1800 if (
G.debug_value != 1112) {
1801 search = cloth->springs;
1802 search2 = search->
next;
1803 while (search && search2) {
1805 tspring2 =
static_cast<ClothSpring *
>(search2->link);
1807 if (tspring->ij == tspring2->kl) {
1815 spring->
ij = tspring2->ij;
1816 spring->
kl = tspring->ij;
1817 spring->
mn = tspring->kl;
1819 cloth->verts[spring->
ij].xrest);
1822 cloth->verts[spring->
ij].bend_stiff) /
1829 search = search->
next;
1830 search2 = search2->
next;
1841 search = cloth->springs;
1842 search2 = search->
next;
1843 while (search && search2) {
1845 tspring2 =
static_cast<ClothSpring *
>(search2->link);
1847 if (tspring->ij == tspring2->kl) {
1855 spring->
ij = tspring2->ij;
1856 spring->
kl = tspring->kl;
1858 cloth->verts[spring->
ij].xrest);
1861 cloth->verts[spring->
ij].bend_stiff) /
1868 search = search->
next;
1869 search2 = search2->
next;
1880 for (
int i = 0; i < numedges; i++) {
1881 cloth->edgeset.add({edges[i][0], edges[i][1]});
1884 for (
int i = 0; i < numface; i++) {
1885 if (faces[i].
size() == 4) {
1886 cloth->edgeset.add({corner_verts[faces[i].start() + 0], corner_verts[faces[i].start() + 2]});
1887 cloth->edgeset.add({corner_verts[faces[i].start() + 1], corner_verts[faces[i].start() + 3]});
1893 cloth->numsprings = struct_springs + shear_springs + bend_springs;
1898 if (
G.debug_value > 0) {
void free_bvhtree_from_mesh(BVHTreeFromMesh *data)
BVHTree * BKE_bvhtree_from_mesh_get(BVHTreeFromMesh *data, const Mesh *mesh, BVHCacheType bvh_cache_type, int tree_type)
@ BVHTREE_FROM_CORNER_TRIS
@ 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
@ CLOTH_VERT_FLAG_NOSELFCOLL
@ CLOTH_VERT_FLAG_NOOBJCOLL
@ CLOTH_SPRING_FLAG_DEACTIVATE
CustomData interface, see also DNA_customdata_types.h.
const void * CustomData_get_layer(const CustomData *data, eCustomDataType type)
void BKE_effectors_free(struct ListBase *lb)
struct ListBase * BKE_effectors_create(struct Depsgraph *depsgraph, struct Object *ob_src, struct ParticleSystem *psys_src, struct EffectorWeights *weights, bool use_rotation)
void BKE_id_free(Main *bmain, void *idv)
Mesh * BKE_mesh_copy_for_eval(const Mesh &source)
void BKE_modifier_set_error(const Object *ob, ModifierData *md, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_ptcache_id_time(PTCacheID *pid, struct Scene *scene, float cfra, int *startframe, int *endframe, float *timescale)
#define PTCACHE_CLEAR_AFTER
void BKE_ptcache_validate(struct PointCache *cache, int framenr)
#define PTCACHE_READ_INTERPOLATED
int BKE_ptcache_read(PTCacheID *pid, float cfra, bool no_extrapolate_old)
void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
void BKE_ptcache_id_from_cloth(PTCacheID *pid, struct Object *ob, struct ClothModifierData *clmd)
int BKE_ptcache_write(PTCacheID *pid, unsigned int cfra)
#define PTCACHE_RESET_OUTDATED
int BKE_ptcache_id_reset(struct Scene *scene, PTCacheID *pid, int mode)
void BKE_ptcache_invalidate(struct PointCache *cache)
#define PTCACHE_READ_EXACT
BVHTree * BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis)
void BLI_bvhtree_balance(BVHTree *tree)
void BLI_bvhtree_update_tree(BVHTree *tree)
void BLI_bvhtree_free(BVHTree *tree)
void BLI_bvhtree_insert(BVHTree *tree, int index, const float co[3], int numpoints)
bool BLI_bvhtree_update_node(BVHTree *tree, int index, const float co[3], const float co_moving[3], int numpoints)
int BLI_bvhtree_ray_cast(const BVHTree *tree, const float co[3], const float dir[3], float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata)
void BLI_linklist_free(LinkNode *list, LinkNodeFreeFP freefunc)
void void void void BLI_linklist_append(LinkNodePair *list_pair, void *ptr) ATTR_NONNULL(1)
void void BLI_linklist_prepend(LinkNode **listp, void *ptr) ATTR_NONNULL(1)
MINLINE int compare_ff(float a, float b, float max_diff)
MINLINE float pow4f(float x)
float normal_tri_v3(float n[3], const float v1[3], const float v2[3], const float v3[3])
void copy_m3_m3(float m1[3][3], const float m2[3][3])
void zero_m3(float m[3][3])
void mul_m4_v3(const float M[4][4], float r[3])
bool invert_m4_m4(float inverse[4][4], const float mat[4][4])
void mul_v3_m3v3(float r[3], const float M[3][3], const float a[3])
void mul_transposed_m3_v3(const float M[3][3], float r[3])
void mul_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3])
void rotation_between_vecs_to_mat3(float m[3][3], const float v1[3], const float v2[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 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 void negate_v3_v3(float r[3], const float a[3])
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
MINLINE float normalize_v3(float n[3])
void BLI_rng_free(struct RNG *rng) ATTR_NONNULL(1)
struct RNG * BLI_rng_new_srandom(unsigned int seed)
float BLI_rng_get_float(struct RNG *rng) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
float DEG_get_ctime(const Depsgraph *graph)
@ CLOTH_COLLSETTINGS_FLAG_ENABLED
@ CLOTH_COLLSETTINGS_FLAG_SELF
@ CLOTH_SIMSETTINGS_FLAG_DYNAMIC_BASEMESH
@ CLOTH_SIMSETTINGS_FLAG_INTERNAL_SPRINGS_NORMAL
@ CLOTH_SIMSETTINGS_FLAG_PRESSURE_VOL
@ CLOTH_SIMSETTINGS_FLAG_SEW
@ CLOTH_SIMSETTINGS_FLAG_PRESSURE
@ CLOTH_SIMSETTINGS_FLAG_INTERNAL_SPRINGS
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
void SIM_cloth_solver_free(ClothModifierData *clmd)
int SIM_cloth_solver_init(Object *, ClothModifierData *clmd)
void SIM_cloth_solver_set_volume(ClothModifierData *clmd)
void SIM_mass_spring_set_implicit_vertex_mass(Implicit_Data *data, int index, float mass)
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 BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
constexpr const T * data() const
constexpr int64_t size() const
constexpr bool is_empty() const
static void cloth_update_verts(Object *ob, ClothModifierData *clmd, Mesh *mesh)
static bool do_init_cloth(Object *ob, ClothModifierData *clmd, Mesh *result, int framenr)
static float cloth_spring_angle(ClothVertex *verts, int i, int j, int *i_a, int *i_b, int len_a, int len_b)
BLI_INLINE void cross_identity_v3(float r[3][3], const float v[3])
void cloth_clear_cache(Object *ob, ClothModifierData *clmd, float framenr)
static void cloth_apply_vgroup(ClothModifierData *clmd, Mesh *mesh)
BLI_INLINE void cloth_bend_poly_dir(ClothVertex *verts, int i, int j, const int *inds, int len, float r_dir[3])
static bool cloth_build_springs(ClothModifierData *clmd, Mesh *mesh)
static void cloth_to_object(Object *ob, ClothModifierData *clmd, float(*vertexCos)[3])
static void cloth_free_edgelist(LinkNodePair *edgelist, uint mvert_num)
static bool cloth_add_shear_bend_spring(ClothModifierData *clmd, LinkNodePair *edgelist, const blender::Span< int > corner_verts, const blender::OffsetIndices< int > faces, int i, int j, int k)
static float cloth_shrink_factor(ClothModifierData *clmd, ClothVertex *verts, int i1, int i2)
static int do_step_cloth(Depsgraph *depsgraph, Object *ob, ClothModifierData *clmd, Mesh *result, int framenr)
static bool cloth_from_object(Object *ob, ClothModifierData *clmd, Mesh *mesh, float framenr, int first)
void clothModifier_do(ClothModifierData *clmd, Depsgraph *depsgraph, Scene *scene, Object *ob, Mesh *mesh, float(*vertexCos)[3])
BLI_INLINE void madd_m3_m3fl(float r[3][3], const float m[3][3], float f)
static void cloth_hair_update_bending_rest_targets(ClothModifierData *clmd)
static void cloth_hair_update_bending_targets(ClothModifierData *clmd)
void cloth_free_modifier_extern(ClothModifierData *clmd)
void bvhtree_update_from_cloth(ClothModifierData *clmd, bool moving, bool self)
static Mesh * cloth_make_rest_mesh(ClothModifierData *clmd, Mesh *mesh)
int cloth_uses_vgroup(ClothModifierData *clmd)
static void cloth_update_springs(ClothModifierData *clmd)
static bool find_internal_spring_target_vertex(BVHTreeFromMesh *treedata, const blender::Span< blender::float3 > vert_normals, uint v_idx, RNG *rng, float max_length, float max_diversion, bool check_normal, int *r_tar_v_idx)
void cloth_parallel_transport_hair_frame(float mat[3][3], const float dir_old[3], const float dir_new[3])
static void cloth_update_spring_lengths(ClothModifierData *clmd, Mesh *mesh)
BLI_INLINE bool cloth_bend_set_poly_vert_array(int **poly, int len, const int *corner_verts)
BLI_INLINE void spring_verts_ordered_set(ClothSpring *spring, int v0, int v1)
static void cloth_free_errorsprings(Cloth *cloth, LinkNodePair *edgelist, BendSpringRef *spring_ref)
void cloth_free_modifier(ClothModifierData *clmd)
static void cloth_from_mesh(ClothModifierData *clmd, const Object *ob, Mesh *mesh)
static BVHTree * bvhtree_build_from_cloth(ClothModifierData *clmd, float epsilon)
const Depsgraph * depsgraph
draw_view in_light_buf[] float
void *(* MEM_mallocN)(size_t len, const char *str)
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
ccl_device_inline float3 cos(float3 v)
void vert_tris_from_corner_tris(Span< int > corner_verts, Span< int3 > corner_tris, MutableSpan< int3 > vert_tris)
blender::Span< blender::int3 > corner_tris
BVHTree_RayCastCallback raycast_callback
blender::Span< blender::float3 > vert_positions
blender::Span< int > corner_verts
struct ClothHairData * hairdata
struct Cloth * clothObject
struct PointCache * point_cache
struct ClothSimSettings * sim_parms
struct ClothCollSettings * coll_parms
struct EffectorWeights * effector_weights
float internal_spring_max_length
float internal_spring_max_diversion
unsigned char old_solver_type
const blender::int2 * edges
blender::int3 * vert_tris
unsigned int primitive_num
ObjectRuntimeHandle * runtime
struct PointCache * cache
struct PTCacheEdit * edit
blender::BitVector is_loose_bits