Added various functions basic math classes. Also enabled math checks only for debug builds.

Added set_scale, set_rotation_euler, set_rotation_axis_angle. Addresses #2565 directly.
Added an euler angle constructor for Basis in GDScript and also exposed is_normalized for vectors and quaternions.
Various other changes mostly cosmetic in nature.
This commit is contained in:
Ferenc Arn 2017-04-05 17:47:13 -05:00
parent 454f53c776
commit 9a37ff1e34
13 changed files with 217 additions and 50 deletions

View file

@ -167,7 +167,7 @@ public:
static float random(float from, float to);
static real_t random(int from, int to) { return (real_t)random((real_t)from, (real_t)to); }
static _ALWAYS_INLINE_ bool isequal_approx(real_t a, real_t b) {
static _ALWAYS_INLINE_ bool is_equal_approx(real_t a, real_t b) {
// TODO: Comparing floats for approximate-equality is non-trivial.
// Using epsilon should cover the typical cases in Godot (where a == b is used to compare two reals), such as matrix and vector comparison operators.
// A proper implementation in terms of ULPs should eventually replace the contents of this function.