allegro_flare icon indicating copy to clipboard operation
allegro_flare copied to clipboard

Create a Math class

Open MarkOates opened this issue 9 years ago • 3 comments

However, a lot of geometry can go into vec2d and might not leave much left for a Math class.

MarkOates avatar Jun 20 '16 04:06 MarkOates

Maybe useful constants and general stuff like clamp and whatnot?

arvidsson avatar Sep 02 '16 11:09 arvidsson

Exactly. Right now there are a bunch of things stuffed in useful.h/useful.cpp that should belong in a Math class.

There are a few constants already like

  • TAU
  • FULL_ROTATION

And a few functions like

  • degrees_to_radians(deg)
  • radians_to_degrees(rad)
  • limit<T>(min, max, val)
  • in_range<T>(min, max, val)

Eventually, I'll need to assemble a comprehensive list practical for games.

MarkOates avatar Sep 02 '16 16:09 MarkOates

Pushing this to 0.9

MarkOates avatar Jun 15 '22 17:06 MarkOates