diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-09-17 16:21:06 +0400 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-01-20 11:30:01 +0300 |
commit | bbae8f88b8f305a8ed85cab718d2a66b476da3c1 (patch) | |
tree | d1f4950ca2845f098a5d452db31ce390a3ed7dc0 /source/blender/physics | |
parent | be016daf15de7c1581a096b17c1380a35d742aa0 (diff) |
Made the voxel grid size for hair interaction configurable and increased
the default to 32.
Conflicts:
source/blender/blenloader/intern/versioning_270.c
Diffstat (limited to 'source/blender/physics')
-rw-r--r-- | source/blender/physics/intern/BPH_mass_spring.cpp | 2 | ||||
-rw-r--r-- | source/blender/physics/intern/hair_volume.c | 6 | ||||
-rw-r--r-- | source/blender/physics/intern/implicit.h | 2 |
3 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/physics/intern/BPH_mass_spring.cpp b/source/blender/physics/intern/BPH_mass_spring.cpp index e9107394bd2..0fa14fa4eab 100644 --- a/source/blender/physics/intern/BPH_mass_spring.cpp +++ b/source/blender/physics/intern/BPH_mass_spring.cpp @@ -421,7 +421,7 @@ static void cloth_calc_volume_force(ClothModifierData *clmd) /* gather velocities & density */ if (smoothfac > 0.0f || pressfac > 0.0f) { - HairVertexGrid *vertex_grid = BPH_hair_volume_create_vertex_grid(gmin, gmax); + HairVertexGrid *vertex_grid = BPH_hair_volume_create_vertex_grid(clmd->sim_parms->voxel_res, gmin, gmax); for (i = 0; i < numverts; i++) { float x[3], v[3]; diff --git a/source/blender/physics/intern/hair_volume.c b/source/blender/physics/intern/hair_volume.c index c129f029873..2d5efa8260b 100644 --- a/source/blender/physics/intern/hair_volume.c +++ b/source/blender/physics/intern/hair_volume.c @@ -57,9 +57,6 @@ static float I[3][3] = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; -/* 10x10x10 grid gives nice initial results */ -static const int hair_grid_res = 10; - static int hair_grid_size(int res) { return res * res * res; @@ -296,9 +293,8 @@ void BPH_hair_volume_normalize_vertex_grid(HairVertexGrid *grid) } } -HairVertexGrid *BPH_hair_volume_create_vertex_grid(const float gmin[3], const float gmax[3]) +HairVertexGrid *BPH_hair_volume_create_vertex_grid(int res, const float gmin[3], const float gmax[3]) { - int res = hair_grid_res; int size = hair_grid_size(res); HairVertexGrid *grid; int i = 0; diff --git a/source/blender/physics/intern/implicit.h b/source/blender/physics/intern/implicit.h index 66ee92f950e..28c4cbcf7ae 100644 --- a/source/blender/physics/intern/implicit.h +++ b/source/blender/physics/intern/implicit.h @@ -150,7 +150,7 @@ bool BPH_mass_spring_force_spring_goal(struct Implicit_Data *data, int i, int sp struct HairVertexGrid; struct HairColliderGrid; -struct HairVertexGrid *BPH_hair_volume_create_vertex_grid(const float gmin[3], const float gmax[3]); +struct HairVertexGrid *BPH_hair_volume_create_vertex_grid(int res, const float gmin[3], const float gmax[3]); void BPH_hair_volume_free_vertex_grid(struct HairVertexGrid *grid); void BPH_hair_volume_add_vertex(struct HairVertexGrid *grid, const float x[3], const float v[3]); |