diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2015-01-20 20:29:31 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-01-20 20:32:06 +0300 |
commit | 9d9dc06014ea7f8fd186246d1e55d429c5193cb6 (patch) | |
tree | faad9521f23f32c9ce1b9331f9763c69d52bedae /source/blender/physics/intern | |
parent | 3356f3f0bb15fa50c2920e4bc428a8375b43f321 (diff) |
Made SimDebugData into a single global instance.
This way it doesn't have to be stored as DNA runtime pointers or passed
down as a function argument. Currently there is now no property or
button to enable debugging, this will be added again later.
Diffstat (limited to 'source/blender/physics/intern')
-rw-r--r-- | source/blender/physics/intern/BPH_mass_spring.cpp | 7 | ||||
-rw-r--r-- | source/blender/physics/intern/hair_volume.cpp | 24 | ||||
-rw-r--r-- | source/blender/physics/intern/implicit.h | 4 | ||||
-rw-r--r-- | source/blender/physics/intern/implicit_blender.c | 8 | ||||
-rw-r--r-- | source/blender/physics/intern/implicit_eigen.cpp | 8 |
5 files changed, 7 insertions, 44 deletions
diff --git a/source/blender/physics/intern/BPH_mass_spring.cpp b/source/blender/physics/intern/BPH_mass_spring.cpp index 112287150cd..668efbba315 100644 --- a/source/blender/physics/intern/BPH_mass_spring.cpp +++ b/source/blender/physics/intern/BPH_mass_spring.cpp @@ -712,7 +712,6 @@ static void cloth_continuum_step(ClothModifierData *clmd, float dt) if (smoothfac > 0.0f || density_strength > 0.0f) {
HairGrid *grid = BPH_hair_volume_create_vertex_grid(clmd->sim_parms->voxel_cell_size, gmin, gmax);
- BPH_hair_volume_set_debug_data(grid, clmd->debug_data);
BPH_hair_volume_set_debug_value(grid, parms->debug1, parms->debug2, parms->debug3, parms->debug4);
cloth_continuum_fill_grid(grid, cloth);
@@ -903,9 +902,7 @@ int BPH_cloth_solve(Object *ob, float frame, ClothModifierData *clmd, ListBase * ColliderContacts *contacts = NULL;
int totcolliders = 0;
- BPH_mass_spring_solver_debug_data(id, clmd->debug_data);
-
- BKE_sim_debug_data_clear_category(clmd->debug_data, "collision");
+ BKE_sim_debug_data_clear_category("collision");
if (!clmd->solver_result)
clmd->solver_result = (ClothSolverResult *)MEM_callocN(sizeof(ClothSolverResult), "cloth solver result");
@@ -997,8 +994,6 @@ int BPH_cloth_solve(Object *ob, float frame, ClothModifierData *clmd, ListBase * copy_v3_v3(verts[i].txold, verts[i].x);
}
- BPH_mass_spring_solver_debug_data(id, NULL);
-
return 1;
}
diff --git a/source/blender/physics/intern/hair_volume.cpp b/source/blender/physics/intern/hair_volume.cpp index c8f9edb3a98..c181cdc0f37 100644 --- a/source/blender/physics/intern/hair_volume.cpp +++ b/source/blender/physics/intern/hair_volume.cpp @@ -92,7 +92,6 @@ typedef struct HairGrid { float gmin[3], gmax[3]; float cellsize, inv_cellsize; - struct SimDebugData *debug_data; float debug1, debug2; int debug3, debug4; } HairGrid; @@ -405,21 +404,20 @@ BLI_INLINE void hair_volume_add_segment_2D(HairGrid *grid, #if 0 { - SimDebugData *debug_data = grid->debug_data; float wloc[3], x2w[3], x3w[3]; grid_to_world(grid, wloc, loc_k); grid_to_world(grid, x2w, x2); grid_to_world(grid, x3w, x3); if (vert_k->samples > 0) - BKE_sim_debug_data_add_circle(debug_data, wloc, 0.01f, 1.0, 1.0, 0.3, "grid", 2525, debug_i, j, k); + BKE_sim_debug_data_add_circle(wloc, 0.01f, 1.0, 1.0, 0.3, "grid", 2525, debug_i, j, k); if (grid->debug_value) { - BKE_sim_debug_data_add_dot(debug_data, wloc, 1, 0, 0, "grid", 93, debug_i, j, k); - BKE_sim_debug_data_add_dot(debug_data, x2w, 0.1, 0.1, 0.7, "grid", 649, debug_i, j, k); - BKE_sim_debug_data_add_line(debug_data, wloc, x2w, 0.3, 0.8, 0.3, "grid", 253, debug_i, j, k); - BKE_sim_debug_data_add_line(debug_data, wloc, x3w, 0.8, 0.3, 0.3, "grid", 254, debug_i, j, k); -// BKE_sim_debug_data_add_circle(debug_data, x2w, len_v3v3(wloc, x2w), 0.2, 0.7, 0.2, "grid", 255, i, j, k); + BKE_sim_debug_data_add_dot(wloc, 1, 0, 0, "grid", 93, debug_i, j, k); + BKE_sim_debug_data_add_dot(x2w, 0.1, 0.1, 0.7, "grid", 649, debug_i, j, k); + BKE_sim_debug_data_add_line(wloc, x2w, 0.3, 0.8, 0.3, "grid", 253, debug_i, j, k); + BKE_sim_debug_data_add_line(wloc, x3w, 0.8, 0.3, 0.3, "grid", 254, debug_i, j, k); +// BKE_sim_debug_data_add_circle(x2w, len_v3v3(wloc, x2w), 0.2, 0.7, 0.2, "grid", 255, i, j, k); } } #endif @@ -439,8 +437,6 @@ void BPH_hair_volume_add_segment(HairGrid *grid, const float x3[3], const float v3[3], const float x4[3], const float v4[3], const float dir1[3], const float dir2[3], const float dir3[3]) { - SimDebugData *debug_data = grid->debug_data; - const int res[3] = { grid->res[0], grid->res[1], grid->res[2] }; /* find the primary direction from the major axis of the direction vector */ @@ -476,8 +472,6 @@ void BPH_hair_volume_add_segment(HairGrid *grid, int j0, k0, j0_prev, k0_prev; int i; - (void)debug_data; - for (i = imin; i <= imax; ++i) { float shift1, shift2; /* fraction of a full cell shift [0.0, 1.0) */ int jmin, jmax, kmin, kmax; @@ -1029,12 +1023,6 @@ void BPH_hair_volume_free_vertex_grid(HairGrid *grid) } } -void BPH_hair_volume_set_debug_data(HairGrid *grid, SimDebugData *debug_data) -{ - grid->debug_data = debug_data; - BKE_sim_debug_data_clear_category(grid->debug_data, "grid"); -} - void BPH_hair_volume_set_debug_value(HairGrid *grid, float debug1, float debug2, int debug3, int debug4) { grid->debug1 = debug1; diff --git a/source/blender/physics/intern/implicit.h b/source/blender/physics/intern/implicit.h index 0e2d12ba99d..2f71485f914 100644 --- a/source/blender/physics/intern/implicit.h +++ b/source/blender/physics/intern/implicit.h @@ -60,7 +60,6 @@ extern "C" { struct Implicit_Data; struct ImplicitSolverInput; -struct SimDebugData; typedef struct ImplicitSolverResult { int status; @@ -74,8 +73,6 @@ BLI_INLINE void implicit_print_matrix_elem(float v) printf("%-8.3f", v); } -void BPH_mass_spring_solver_debug_data(struct Implicit_Data *id, struct SimDebugData *debug_data); - void BPH_mass_spring_set_vertex_mass(struct Implicit_Data *data, int index, float mass); void BPH_mass_spring_set_rest_transform(struct Implicit_Data *data, int index, float rot[3][3]); @@ -142,7 +139,6 @@ struct VoxelData; struct HairGrid *BPH_hair_volume_create_vertex_grid(float cellsize, const float gmin[3], const float gmax[3]); void BPH_hair_volume_free_vertex_grid(struct HairGrid *grid); void BPH_hair_volume_grid_geometry(struct HairGrid *grid, float *cellsize, int res[3], float gmin[3], float gmax[3]); -void BPH_hair_volume_set_debug_data(struct HairGrid *grid, struct SimDebugData *debug_data); void BPH_hair_volume_set_debug_value(struct HairGrid *grid, float debug1, float debug2, int debug3, int debug4); void BPH_hair_volume_grid_clear(struct HairGrid *grid); diff --git a/source/blender/physics/intern/implicit_blender.c b/source/blender/physics/intern/implicit_blender.c index ce65703901a..56ce1129cc7 100644 --- a/source/blender/physics/intern/implicit_blender.c +++ b/source/blender/physics/intern/implicit_blender.c @@ -700,8 +700,6 @@ typedef struct Implicit_Data { lfVector *z; /* target velocity in constrained directions */ fmatrix3x3 *S; /* filtering matrix for constraints */ fmatrix3x3 *P, *Pinv; /* pre-conditioning matrix */ - - struct SimDebugData *debug_data; } Implicit_Data; Implicit_Data *BPH_mass_spring_solver_create(int numverts, int numsprings) @@ -756,12 +754,6 @@ void BPH_mass_spring_solver_free(Implicit_Data *id) MEM_freeN(id); } -void BPH_mass_spring_solver_debug_data(Implicit_Data *id, struct SimDebugData *debug_data) -{ - if (id) - id->debug_data = debug_data; -} - /* ==== Transformation from/to root reference frames ==== */ BLI_INLINE void world_to_root_v3(Implicit_Data *data, int index, float r[3], const float v[3]) diff --git a/source/blender/physics/intern/implicit_eigen.cpp b/source/blender/physics/intern/implicit_eigen.cpp index ee95e94a843..d9e4d38dd70 100644 --- a/source/blender/physics/intern/implicit_eigen.cpp +++ b/source/blender/physics/intern/implicit_eigen.cpp @@ -445,8 +445,6 @@ struct Implicit_Data { lMatrixCtor iM; /* masses */ lMatrixCtor idFdX, idFdV; /* force jacobians */ lMatrixCtor iS; /* filtering matrix for constraints */ - - struct SimDebugData *debug_data; }; Implicit_Data *BPH_mass_spring_solver_create(int numverts, int numsprings) @@ -469,12 +467,6 @@ int BPH_mass_spring_solver_numvert(Implicit_Data *id) return 0; } -void BPH_mass_spring_solver_debug_data(Implicit_Data *id, struct SimDebugData *debug_data) -{ - if (id) - id->debug_data = debug_data; -} - /* ==== Transformation from/to root reference frames ==== */ BLI_INLINE void world_to_root_v3(Implicit_Data *data, int index, float r[3], const float v[3]) |