SpoutDev/SpoutAPI — pull request #149 by bergerkiller (2012-03-28 23:15:54+00:00)
Title: Added and improved: math helper functions

Signed-off-by: berger killer

Added the 'length', 'lengthSquared', 'wrapAngle', 'wrapRadian', 'getAngleDifference' and 'getRadianDifference' functions to the MathHelper class, as well fixed a typo and added a few more constants. (such as SQRTOFTWO to use during block 'length' calculations, and the HALF function for a 45-degree SIN value)

Also made sure that the Vector3 class uses the correct 'fastLength' sqrt function, and added distanceSquared. Both distance and distanceSquared use the MathHelper.length(Squared) function.

The 'length' function can be used to calculate the length of ANY vector by passing in the vector 'axis' values.