Page MenuHome

Cleanup: Use M_PI_2 and M_PI_4 where possible
ClosedPublic

Authored by Hallam Roberts (MysteryPancake) on Mar 9 2022, 4:13 AM.

Details

Summary

This patch replaces M_PI / 2 and M_PI * 0.5 with M_PI_2.

Similarly, M_PI / 4 and M_PI * 0.25 is replaced with M_PI_4.
The constant M_PI_4 is added to GLSL to ensure it works there too.

Two cases of (1/(pi/2)) were also replaced with the equivalent, M_2_PI (2/pi).

Diff Detail

Repository
rB Blender
Branch
pi_cleanup (branched from master)
Build Status
Buildable 20987
Build 20987: arc lint + arc unit

Event Timeline

Hallam Roberts (MysteryPancake) requested review of this revision.Mar 9 2022, 4:13 AM
Hallam Roberts (MysteryPancake) created this revision.
  • Adjust GLSL value to match BLI_math_base
  • Replace (1/(pi/2)) with equivalent: M_2_PI (2/pi)
Brecht Van Lommel (brecht) requested changes to this revision.Mar 11 2022, 2:19 PM

Don't change files in extern/, those are libraries maintained elsewhere and we don't change them to conform to our code style or preferences.

This revision now requires changes to proceed.Mar 11 2022, 2:19 PM
  • Undo changes to external files

Don't change files in extern/, those are libraries maintained elsewhere and we don't change them to conform to our code style or preferences.

Ah sorry, didn't realise. Reverted those changes now

  • Remove unneeded brackets within uvedit_parametrizer
This revision was not accepted when it landed; it landed in state Needs Review.Mar 11 2022, 6:28 PM
This revision was automatically updated to reflect the committed changes.