Skip to content

Commit

Permalink
set these variables to constexpr
Browse files Browse the repository at this point in the history
  • Loading branch information
jfmherokiller committed Oct 24, 2023
1 parent 79bd917 commit 628841a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Sources/Plasma/PubUtilLib/plMath/plTriUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,18 @@ You can contact Cyan Worlds, Inc. by email [email protected]
#include <cmath>
#include "plTriUtils.h"

static const float kAlmostZero = 1.e-5f;
static const float kPastZero = -kAlmostZero;
static const float kPastOne = 1.f + kAlmostZero;
static const float kAlmostOne = 1.f - kAlmostZero;
static const float kAlmostZeroSquared = kAlmostZero*kAlmostZero;
static constexpr float kAlmostZero = 1.e-5f;
static constexpr float kPastZero = -kAlmostZero;
static constexpr float kPastOne = 1.f + kAlmostZero;
static constexpr float kAlmostOne = 1.f - kAlmostZero;
static constexpr float kAlmostZeroSquared = kAlmostZero*kAlmostZero;

static inline hsVector3 Cross(const hsScalarTriple& p0, const hsScalarTriple& p1)
{
return hsVector3(p0.fY * p1.fZ - p0.fZ * p1.fY,
p0.fZ * p1.fX - p0.fX * p1.fZ,
p0.fX * p1.fY - p0.fY * p1.fX);
return {p0.fY * p1.fZ - p0.fZ * p1.fY,
p0.fZ * p1.fX - p0.fX * p1.fZ,
p0.fX * p1.fY - p0.fY * p1.fX
};
}


Expand Down

0 comments on commit 628841a

Please sign in to comment.