common: mathlib: don't need #define ANGLEEPSILON
This commit is contained in:
parent
ca58e90e15
commit
e0564e8c2a
|
|
@ -775,10 +775,7 @@ float SignedDegreesBetweenUnitVectors(const vec3_t start, const vec3_t end, cons
|
|||
{
|
||||
const float cosangle = qmax(-1.0, qmin(1.0, DotProduct(start, end)));
|
||||
const float unsigned_degrees = acos(cosangle) * (360.0 / (2.0 * Q_PI));
|
||||
|
||||
if (unsigned_degrees < ANGLEEPSILON)
|
||||
return 0;
|
||||
|
||||
|
||||
// get a normal for the rotation plane using the right-hand rule
|
||||
vec3_t rotationNormal;
|
||||
CrossProduct(start, end, rotationNormal);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ typedef struct {
|
|||
|
||||
extern const vec3_t vec3_origin;
|
||||
|
||||
#define ANGLEEPSILON 0.000001
|
||||
#define ZERO_TRI_AREA_EPSILON 0.05f
|
||||
#define POINT_EQUAL_EPSILON 0.05f
|
||||
|
||||
|
|
|
|||
|
|
@ -419,6 +419,7 @@ TEST(mathlib, SignedDegreesBetweenUnitVectors) {
|
|||
|
||||
EXPECT_FLOAT_EQ(-90, SignedDegreesBetweenUnitVectors(right, fwd, up));
|
||||
EXPECT_FLOAT_EQ(90, SignedDegreesBetweenUnitVectors(fwd, right, up));
|
||||
EXPECT_FLOAT_EQ(0, SignedDegreesBetweenUnitVectors(right, right, up));
|
||||
}
|
||||
|
||||
static const float MANGLE_EPSILON = 0.1f;
|
||||
|
|
|
|||
Loading…
Reference in New Issue