Fix T97278: wrong hair particle shape with kink spiral

Revert change from 3da84d8b that incorrectly used M_PI_4.

Differential Revision: https://developer.blender.org/D14636
This commit is contained in:
Hallam Roberts 2022-04-13 16:23:38 +02:00 committed by Brecht Van Lommel
parent 9c09e5ba24
commit 7dc4ac71e8
Notes: blender-bot 2023-02-13 15:43:36 +01:00
Referenced by issue #97278, Regression: Increasing the shape value for spiral kink generates hair to infinite
1 changed files with 1 additions and 1 deletions

View File

@ -85,7 +85,7 @@ static void do_kink_spiral_deform(ParticleKey *state,
* and goes up to the Golden Spiral for 1.0
* https://en.wikipedia.org/wiki/Golden_spiral
*/
const float b = shape * (1.0f + sqrtf(5.0f)) / (float)M_PI_4;
const float b = shape * (1.0f + sqrtf(5.0f)) / (float)M_PI * 0.25f;
/* angle of the spiral against the curve (rotated opposite to make a smooth transition) */
const float start_angle = ((b != 0.0f) ? atanf(1.0f / b) : (float)-M_PI_2) +
(b > 0.0f ? -(float)M_PI_2 : (float)M_PI_2);