Pages: 1
  Print  
Author Topic: Angular Unit Functions  (Read 591 times)
Offline (Male) Goombert
Posted on: October 12, 2013, 01:30:23 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3108

View Profile
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
« Last Edit: October 12, 2013, 02:11:00 PM by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) TheExDeus
Reply #1 Posted on: October 13, 2013, 11:37:59 AM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
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.
Logged
Offline (Male) Goombert
Reply #2 Posted on: October 13, 2013, 12:05:29 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3108

View Profile
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.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Pages: 1
  Print