ENIGMA Forums

General fluff => General ENIGMA => Topic started by: Goombert on October 12, 2013, 01:30:23 PM

Title: Angular Unit Functions
Post by: Goombert on October 12, 2013, 01:30:23 PM
I have made a further attempt at eliminating casting. Most of the API's we use internally use radians, not degrees, so I decided to implement a macro to the universal system scalars that can be easily changed and used to switch entire systems between degrees and radians. Please use these functions, as I have added them to Box2D extensions already, anywhere in the engine that a function takes degrees or any sort of degree/radian conversion occurs.

The angular unity macros can be found in this file.
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Universal_System/scalar.h
Title: Re: Angular Unit Functions
Post by: TheExDeus on October 13, 2013, 11:37:59 AM
You might as well use a more precise representation of Pi. It won't make it work any faster or slower. Maybe use the M_PI included in math.
Title: Re: Angular Unit Functions
Post by: Goombert on October 13, 2013, 12:05:29 PM
Yah I really don't care Harri, you just pick which one you'd prefer and tell me and I'll use it. Or feel free to commit it yourself.