Cleanup: Clang format
This commit is contained in:
parent
142aba9485
commit
0c8b9cd7d1
|
@ -233,10 +233,10 @@ class MeshFairingContext : public FairingContext {
|
|||
|
||||
/* Deformation coords. */
|
||||
if (deform_mverts) {
|
||||
deform_mvert_ = deform_mverts;
|
||||
deform_mvert_ = deform_mverts;
|
||||
}
|
||||
else {
|
||||
deform_mvert_ = mesh->mvert;
|
||||
deform_mvert_ = mesh->mvert;
|
||||
}
|
||||
|
||||
loop_to_poly_map_.resize(mesh->totloop);
|
||||
|
@ -255,12 +255,14 @@ class MeshFairingContext : public FairingContext {
|
|||
MEM_SAFE_FREE(elmap_mem_);
|
||||
}
|
||||
|
||||
float *vertex_deformation_co_get(const int v) {
|
||||
return deform_mvert_[v].co;
|
||||
float *vertex_deformation_co_get(const int v)
|
||||
{
|
||||
return deform_mvert_[v].co;
|
||||
}
|
||||
|
||||
void vertex_deformation_co_set(const int v, const float co[3]) {
|
||||
copy_v3_v3(deform_mvert_[v].co, co);
|
||||
void vertex_deformation_co_set(const int v, const float co[3])
|
||||
{
|
||||
copy_v3_v3(deform_mvert_[v].co, co);
|
||||
}
|
||||
|
||||
void adjacents_coords_from_loop(const int loop,
|
||||
|
@ -351,12 +353,14 @@ class BMeshFairingContext : public FairingContext {
|
|||
MEM_SAFE_FREE(vlmap_mem_);
|
||||
}
|
||||
|
||||
float *vertex_deformation_co_get(const int v) {
|
||||
return BM_vert_at_index(bm, v)->co;
|
||||
float *vertex_deformation_co_get(const int v)
|
||||
{
|
||||
return BM_vert_at_index(bm, v)->co;
|
||||
}
|
||||
|
||||
void vertex_deformation_co_set(const int v, const float co[3]) {
|
||||
copy_v3_v3(BM_vert_at_index(bm, v)->co, co);
|
||||
void vertex_deformation_co_set(const int v, const float co[3])
|
||||
{
|
||||
copy_v3_v3(BM_vert_at_index(bm, v)->co, co);
|
||||
}
|
||||
|
||||
void adjacents_coords_from_loop(const int loop,
|
||||
|
|
|
@ -103,7 +103,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
/* Experimental features. */
|
||||
|
||||
#define USE_SOLVER_RIPPLE_CONSTRAINT false
|
||||
|
@ -470,17 +469,17 @@ static void do_cloth_brush_build_constraints_task_cb_ex(
|
|||
BKE_pbvh_vertex_iter_end;
|
||||
}
|
||||
|
||||
static void cloth_brush_constraint_pos_to_line(SculptClothSimulation *cloth_sim, const int v) {
|
||||
if (!USE_SOLVER_RIPPLE_CONSTRAINT) {
|
||||
return;
|
||||
}
|
||||
float line_points[2][3];
|
||||
copy_v3_v3(line_points[0], cloth_sim->init_pos[v]);
|
||||
add_v3_v3v3(line_points[1], cloth_sim->init_pos[v], cloth_sim->init_normal[v]);
|
||||
closest_to_line_v3(cloth_sim->pos[v], cloth_sim->pos[v], line_points[0], line_points[1]);
|
||||
static void cloth_brush_constraint_pos_to_line(SculptClothSimulation *cloth_sim, const int v)
|
||||
{
|
||||
if (!USE_SOLVER_RIPPLE_CONSTRAINT) {
|
||||
return;
|
||||
}
|
||||
float line_points[2][3];
|
||||
copy_v3_v3(line_points[0], cloth_sim->init_pos[v]);
|
||||
add_v3_v3v3(line_points[1], cloth_sim->init_pos[v], cloth_sim->init_normal[v]);
|
||||
closest_to_line_v3(cloth_sim->pos[v], cloth_sim->pos[v], line_points[0], line_points[1]);
|
||||
}
|
||||
|
||||
|
||||
static void cloth_brush_apply_force_to_vertex(SculptSession *UNUSED(ss),
|
||||
SculptClothSimulation *cloth_sim,
|
||||
const float force[3],
|
||||
|
@ -892,7 +891,6 @@ static void do_cloth_brush_solve_simulation_task_cb_ex(
|
|||
cloth_sim->node_state[node_index] = SCULPT_CLOTH_NODE_INACTIVE;
|
||||
}
|
||||
|
||||
|
||||
static void cloth_brush_satisfy_constraints(SculptSession *ss,
|
||||
Brush *brush,
|
||||
SculptClothSimulation *cloth_sim)
|
||||
|
@ -1160,13 +1158,11 @@ SculptClothSimulation *SCULPT_cloth_brush_simulation_create(SculptSession *ss,
|
|||
}
|
||||
|
||||
if (USE_SOLVER_RIPPLE_CONSTRAINT) {
|
||||
cloth_sim->init_normal = MEM_calloc_arrayN(
|
||||
totverts, sizeof(float) * 3, "init noramls");
|
||||
for (int i = 0; i < totverts; i++) {
|
||||
cloth_sim->init_normal = MEM_calloc_arrayN(totverts, sizeof(float) * 3, "init noramls");
|
||||
for (int i = 0; i < totverts; i++) {
|
||||
SCULPT_vertex_normal_get(ss, i, cloth_sim->init_normal[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
cloth_sim->mass = cloth_mass;
|
||||
cloth_sim->damping = cloth_damping;
|
||||
|
|
Loading…
Reference in New Issue