[Bf-blender-cvs] [76a122f4967] soc-2019-adaptive-cloth: Cloth: initial steps for obstacle metric
ishbosamiya
noreply at git.blender.org
Fri Jul 19 11:16:22 CEST 2019
Commit: 76a122f49679b8ea5366fe6cc0689123aa324b74
Author: ishbosamiya
Date: Fri Jul 19 14:45:50 2019 +0530
Branches: soc-2019-adaptive-cloth
https://developer.blender.org/rB76a122f49679b8ea5366fe6cc0689123aa324b74
Cloth: initial steps for obstacle metric
===================================================================
M source/blender/blenkernel/BKE_cloth.h
M source/blender/blenkernel/intern/cloth.c
M source/blender/blenkernel/intern/cloth_remeshing.cpp
===================================================================
diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h
index 483973fd742..8b344414e5c 100644
--- a/source/blender/blenkernel/BKE_cloth.h
+++ b/source/blender/blenkernel/BKE_cloth.h
@@ -313,5 +313,6 @@ void cloth_parallel_transport_hair_frame(float mat[3][3],
void cloth_to_mesh(struct Object *ob, struct ClothModifierData *clmd, struct Mesh *r_mesh);
int cloth_build_springs(struct ClothModifierData *clmd, struct Mesh *mesh);
struct BVHTree *bvhtree_build_from_cloth(struct ClothModifierData *clmd, float epsilon);
+void cloth_apply_vgroup(struct ClothModifierData *clmd, struct Mesh *mesh);
#endif
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index af21b5b60e8..bde0b66c735 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -70,7 +70,6 @@ static int cloth_from_object(
static void cloth_update_springs(ClothModifierData *clmd);
static void cloth_update_verts(Object *ob, ClothModifierData *clmd, Mesh *mesh);
static void cloth_update_spring_lengths(ClothModifierData *clmd, Mesh *mesh);
-static void cloth_apply_vgroup(ClothModifierData *clmd, Mesh *mesh);
typedef struct BendSpringRef {
int index;
@@ -766,7 +765,7 @@ int cloth_uses_vgroup(ClothModifierData *clmd)
/**
* Applies a vertex group as specified by type.
*/
-static void cloth_apply_vgroup(ClothModifierData *clmd, Mesh *mesh)
+void cloth_apply_vgroup(ClothModifierData *clmd, Mesh *mesh)
{
/* Can be optimized to do all groups in one loop. */
int i = 0;
diff --git a/source/blender/blenkernel/intern/cloth_remeshing.cpp b/source/blender/blenkernel/intern/cloth_remeshing.cpp
index dbb212758bd..40447a3a9e6 100644
--- a/source/blender/blenkernel/intern/cloth_remeshing.cpp
+++ b/source/blender/blenkernel/intern/cloth_remeshing.cpp
@@ -325,6 +325,10 @@ static Mesh *cloth_remeshing_update_cloth_object_bmesh(Object *ob, ClothModifier
}
BKE_mesh_runtime_verttri_from_looptri(clmd->clothObject->tri, mloop, looptri, looptri_num);
+ /* // apply / set vertex groups */
+ /* // has to be happen before springs are build! */
+ /* cloth_apply_vgroup(clmd, mesh_result); */
+
if (!cloth_build_springs(clmd, mesh_result)) {
cloth_free_modifier(clmd);
modifier_setError(&(clmd->modifier), "Cannot build springs");
@@ -1853,6 +1857,12 @@ static void mul_m2_m23m32(float r[2][2], float a[2][3], float b[3][2])
}
}
+static void cloth_remeshing_obstacle_metric(ClothModifierData *clmd, float r_mat[2][2])
+{
+ Cloth *cloth = clmd->clothObject;
+ BVHTree *tree = cloth->bvhtree;
+}
+
static ClothSizing cloth_remeshing_compute_face_sizing(ClothModifierData *clmd, BMFace *f)
{
/* get the cloth verts for the respective verts of the face f */
More information about the Bf-blender-cvs
mailing list