Permalink
Browse files

Define LINE_DISTANCE_EPSILON publicly.

  • Loading branch information...
DolceTriade committed Dec 29, 2015
1 parent 9c98c92 commit f196d3785f7e876ca5bc5683e3048bb310765257
@@ -524,7 +524,7 @@ Traces a ray from inside a rectangle and returns the point of
intersection with the rectangle
==================
*/
float ProjectPointOntoRectangleOutwards( vec2_t out, const vec2_t point, const vec2_t dir,
float ProjectPointOntoRectangleOutwards( vec2_t out, const vec2_t point, const vec2_t dir,
const vec2_t bounds[ 2 ] )
{
float t, ty;
@@ -1214,7 +1214,6 @@ void ProjectPointOntoVector( vec3_t point, vec3_t vStart, vec3_t vEnd, vec3_t vP
VectorMA( vStart, DotProduct( pVec, vec ), vec, vProj );
}

#define LINE_DISTANCE_EPSILON 1e-05f

/*
* ================
@@ -374,6 +374,10 @@ void Com_Free_Aligned( void *ptr );
#define M_ROOT3 1.732050808f
#endif

#ifndef LINE_DISTANCE_EPSILON
#define LINE_DISTANCE_EPSILON 1e-05f
#endif

#define ARRAY_LEN(x) ( sizeof( x ) / sizeof( *( x ) ) )

// angle indexes
@@ -48,7 +48,7 @@ float ResourceStorageComponent::GetStoredFraction() {
// The stored fraction is equal to the acquired fraction.
float storedFraction = acquiredBuildPoints / level.team[team].acquiredBuildPoints;

if (storedFraction < 0.0f || storedFraction > 1.0f + 1.0e-5) {
if (storedFraction < 0.0f || storedFraction > 1.0f + LINE_DISTANCE_EPSILON) {
resourceStorageLogger.Warn(
"A resource storage stores an invalid fraction of all build points: %.1f", storedFraction
);

0 comments on commit f196d37

Please sign in to comment.