do not compare traceresult fraction directly 1.0

some cosmetic changes
bots will spray more logos
reduced "cheating" in jumping a little bit
optimized checking 3d vector for zero
This commit is contained in:
jeefo 2015-08-15 18:09:15 +03:00
commit 36b865abde
14 changed files with 958 additions and 1060 deletions

View file

@ -592,14 +592,14 @@ public:
}
//
// Function: IsNull
// Function: IsZero
//
// Checks whether vector is null.
//
// Returns:
// True if this vector is (0.0f, 0.0f, 0.0f) within tolerance, false otherwise.
//
inline bool IsNull (void) const
inline bool IsZero (void) const
{
return Math::FltZero (x) && Math::FltZero (y) && Math::FltZero (z);
}
@ -612,10 +612,17 @@ public:
// Returns:
// Nulled vector.
//
inline static const Vector &GetNull (void)
inline static const Vector &GetZero (void)
{
static const Vector &s_null = Vector (0.0, 0.0, 0.0f);
return s_null;
static const Vector &s_zero = Vector (0.0f, 0.0f, 0.0f);
return s_zero;
}
inline void Zero (void)
{
x = 0.0f;
y = 0.0f;
z = 0.0f;
}
//
@ -729,9 +736,6 @@ public:
}
};
static const Vector &nullvec = Vector::GetNull ();
//
// Class: List
// Simple linked list container.