Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/cloth.c
| Show First 20 Lines • Show All 578 Lines • ▼ Show 20 Lines | |||||
| /****************************************************************************** | /****************************************************************************** | ||||
| * | * | ||||
| * Internal functions. | * Internal functions. | ||||
| * | * | ||||
| ******************************************************************************/ | ******************************************************************************/ | ||||
| /** | /** | ||||
| * cloth_to_object - copies the deformed vertices to the object. | * Copies the deformed vertices to the object. | ||||
| * | */ | ||||
| **/ | |||||
| static void cloth_to_object (Object *ob, ClothModifierData *clmd, float (*vertexCos)[3]) | static void cloth_to_object (Object *ob, ClothModifierData *clmd, float (*vertexCos)[3]) | ||||
| { | { | ||||
| unsigned int i = 0; | unsigned int i = 0; | ||||
| Cloth *cloth = clmd->clothObject; | Cloth *cloth = clmd->clothObject; | ||||
| if (clmd->clothObject) { | if (clmd->clothObject) { | ||||
| /* inverse matrix is not uptodate... */ | /* inverse matrix is not uptodate... */ | ||||
| invert_m4_m4(ob->imat, ob->obmat); | invert_m4_m4(ob->imat, ob->obmat); | ||||
| Show All 11 Lines | int cloth_uses_vgroup(ClothModifierData *clmd) | ||||
| return (((clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_SELF) && (clmd->coll_parms->vgroup_selfcol > 0)) || | return (((clmd->coll_parms->flags & CLOTH_COLLSETTINGS_FLAG_SELF) && (clmd->coll_parms->vgroup_selfcol > 0)) || | ||||
| (clmd->sim_parms->vgroup_struct > 0) || | (clmd->sim_parms->vgroup_struct > 0) || | ||||
| (clmd->sim_parms->vgroup_bend > 0) || | (clmd->sim_parms->vgroup_bend > 0) || | ||||
| (clmd->sim_parms->vgroup_shrink > 0) || | (clmd->sim_parms->vgroup_shrink > 0) || | ||||
| (clmd->sim_parms->vgroup_mass > 0)); | (clmd->sim_parms->vgroup_mass > 0)); | ||||
| } | } | ||||
| /** | /** | ||||
| * cloth_apply_vgroup - applies a vertex group as specified by type | * Applies a vertex group as specified by type. | ||||
| * | */ | ||||
| **/ | |||||
| /* can be optimized to do all groups in one loop */ | |||||
| static void cloth_apply_vgroup ( ClothModifierData *clmd, Mesh *mesh ) | static void cloth_apply_vgroup ( ClothModifierData *clmd, Mesh *mesh ) | ||||
| { | { | ||||
| /* Can be optimized to do all groups in one loop. */ | |||||
| int i = 0; | int i = 0; | ||||
| int j = 0; | int j = 0; | ||||
| MDeformVert *dvert = NULL; | MDeformVert *dvert = NULL; | ||||
| Cloth *clothObj = NULL; | Cloth *clothObj = NULL; | ||||
| int mvert_num; | int mvert_num; | ||||
| /* float goalfac = 0; */ /* UNUSED */ | /* float goalfac = 0; */ /* UNUSED */ | ||||
| ClothVertex *verts = NULL; | ClothVertex *verts = NULL; | ||||
| ▲ Show 20 Lines • Show All 1,019 Lines • Show Last 20 Lines | |||||