Changeset View
Changeset View
Standalone View
Standalone View
source/blender/physics/intern/hair_volume.cpp
| Show First 20 Lines • Show All 297 Lines • ▼ Show 20 Lines | void BPH_hair_volume_grid_clear(HairGrid *grid) | ||||
| for (i = 0; i < size; i++) { | for (i = 0; i < size; i++) { | ||||
| zero_v3(grid->verts[i].velocity); | zero_v3(grid->verts[i].velocity); | ||||
| zero_v3(grid->verts[i].velocity_smooth); | zero_v3(grid->verts[i].velocity_smooth); | ||||
| grid->verts[i].density = 0.0f; | grid->verts[i].density = 0.0f; | ||||
| grid->verts[i].samples = 0; | grid->verts[i].samples = 0; | ||||
| } | } | ||||
| } | } | ||||
| BLI_INLINE bool hair_grid_point_valid(const float vec[3], float gmin[3], float gmax[3]) | BLI_INLINE bool hair_grid_point_valid(const float vec[3], const float gmin[3], const float gmax[3]) | ||||
| { | { | ||||
| return !(vec[0] < gmin[0] || vec[1] < gmin[1] || vec[2] < gmin[2] || vec[0] > gmax[0] || | return !(vec[0] < gmin[0] || vec[1] < gmin[1] || vec[2] < gmin[2] || vec[0] > gmax[0] || | ||||
| vec[1] > gmax[1] || vec[2] > gmax[2]); | vec[1] > gmax[1] || vec[2] > gmax[2]); | ||||
| } | } | ||||
| BLI_INLINE float dist_tent_v3f3(const float a[3], float x, float y, float z) | BLI_INLINE float dist_tent_v3f3(const float a[3], float x, float y, float z) | ||||
| { | { | ||||
| float w = (1.0f - fabsf(a[0] - x)) * (1.0f - fabsf(a[1] - y)) * (1.0f - fabsf(a[2] - z)); | float w = (1.0f - fabsf(a[0] - x)) * (1.0f - fabsf(a[1] - y)) * (1.0f - fabsf(a[2] - z)); | ||||
| ▲ Show 20 Lines • Show All 960 Lines • Show Last 20 Lines | |||||