Browse Source

Some code style refactoring #5

Panagiotis Christopoulos Charitos 3 years ago
parent
commit
6fa2bc4c2f
40 changed files with 299 additions and 299 deletions
  1. 1 1
      AnKi/Collision/Aabb.cpp
  2. 1 1
      AnKi/Collision/Aabb.h
  3. 24 24
      AnKi/Collision/Common.h
  4. 4 4
      AnKi/Collision/Cone.h
  5. 1 1
      AnKi/Collision/ConvexHullShape.h
  6. 1 1
      AnKi/Collision/FunctionsComputeAabb.cpp
  7. 6 6
      AnKi/Collision/FunctionsMisc.cpp
  8. 1 1
      AnKi/Collision/LineSegment.h
  9. 1 1
      AnKi/Collision/Obb.h
  10. 1 1
      AnKi/Collision/Plane.h
  11. 2 2
      AnKi/Collision/Ray.h
  12. 1 1
      AnKi/Collision/Sphere.h
  13. 2 2
      AnKi/Importer/GltfImporter.cpp
  14. 1 1
      AnKi/Importer/GltfImporterAnimation.cpp
  15. 9 9
      AnKi/Importer/GltfImporterMesh.cpp
  16. 1 1
      AnKi/Math/Axisang.h
  17. 4 4
      AnKi/Math/Euler.h
  18. 2 2
      AnKi/Math/Functions.cpp
  19. 6 6
      AnKi/Math/Functions.h
  20. 31 31
      AnKi/Math/Mat.h
  21. 2 2
      AnKi/Math/Quat.h
  22. 3 3
      AnKi/Math/Simd.h
  23. 76 76
      AnKi/Math/Vec.h
  24. 1 1
      AnKi/Renderer/ClusterBinning.cpp
  25. 2 2
      AnKi/Renderer/VolumetricLightingAccumulation.cpp
  26. 4 4
      AnKi/Scene/CameraNode.cpp
  27. 19 19
      AnKi/Scene/Components/FrustumComponent.cpp
  28. 24 24
      AnKi/Scene/Components/FrustumComponent.h
  29. 6 6
      AnKi/Scene/Components/LightComponent.cpp
  30. 3 3
      AnKi/Scene/Components/SkinComponent.cpp
  31. 5 5
      AnKi/Scene/Components/SpatialComponent.cpp
  32. 5 5
      AnKi/Scene/Components/SpatialComponent.h
  33. 1 1
      AnKi/Scene/Events/JitterMoveEvent.cpp
  34. 1 1
      AnKi/Scene/Events/LightEvent.cpp
  35. 7 7
      AnKi/Scene/GlobalIlluminationProbeNode.cpp
  36. 8 8
      AnKi/Scene/LightNode.cpp
  37. 7 7
      AnKi/Scene/ReflectionProbeNode.cpp
  38. 4 4
      AnKi/Scene/SoftwareRasterizer.cpp
  39. 9 9
      AnKi/Scene/Visibility.cpp
  40. 12 12
      Tests/Math/Math.cpp

+ 1 - 1
AnKi/Collision/Aabb.cpp

@@ -21,7 +21,7 @@ Aabb Aabb::getTransformed(const Transform& trf) const
 	Vec4 newC = trf.transform(center);
 	Vec4 newE = Vec4(absM * (extend * trf.getScale()), 0.0f);
 
-	return Aabb(newC - newE, newC + newE + Vec4(EPSILON, EPSILON, EPSILON, 0.0f));
+	return Aabb(newC - newE, newC + newE + Vec4(kEpsilonf, kEpsilonf, kEpsilonf, 0.0f));
 }
 
 Aabb Aabb::getCompoundShape(const Aabb& b) const

+ 1 - 1
AnKi/Collision/Aabb.h

@@ -16,7 +16,7 @@ namespace anki {
 class Aabb
 {
 public:
-	static constexpr CollisionShapeType CLASS_TYPE = CollisionShapeType::AABB;
+	static constexpr CollisionShapeType kClassType = CollisionShapeType::kAABB;
 
 	/// Will not initialize any memory, nothing.
 	Aabb()

+ 24 - 24
AnKi/Collision/Common.h

@@ -17,43 +17,43 @@ namespace anki {
 /// The 6 frustum planes.
 enum class FrustumPlaneType : U8
 {
-	NEAR,
-	FAR,
-	LEFT,
-	RIGHT,
-	TOP,
-	BOTTOM,
-
-	COUNT,
-	FIRST = 0
+	kNear,
+	kFar,
+	kLeft,
+	kRight,
+	kTop,
+	kBottom,
+
+	kCount,
+	kFirst = 0
 };
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(FrustumPlaneType)
 
 /// Collision shape type.
 enum class CollisionShapeType : U8
 {
-	PLANE,
-	LINE_SEGMENT,
-	RAY,
-	AABB,
-	SPHERE,
-	OBB,
-	CONVEX_HULL,
-	CONE,
-
-	COUNT,
-	FIRST = 0
+	kPlane,
+	kLineSegment,
+	kRay,
+	kAABB,
+	kSphere,
+	kOBB,
+	kConvexHull,
+	kCone,
+
+	kCount,
+	kFirst = 0
 };
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(CollisionShapeType)
 
 /// Frustum type
 enum class FrustumType : U8
 {
-	PERSPECTIVE,
-	ORTHOGRAPHIC,
+	kPerspective,
+	kOrthographic,
 
-	COUNT,
-	FIRST = 0
+	kCount,
+	kFirst = 0
 };
 ANKI_ENUM_ALLOW_NUMERIC_OPERATIONS(FrustumType)
 /// @}

+ 4 - 4
AnKi/Collision/Cone.h

@@ -16,7 +16,7 @@ namespace anki {
 class Cone
 {
 public:
-	static constexpr CollisionShapeType CLASS_TYPE = CollisionShapeType::CONE;
+	static constexpr CollisionShapeType kClassType = CollisionShapeType::kCone;
 
 	/// Will not initialize any memory, nothing.
 	Cone()
@@ -73,7 +73,7 @@ public:
 
 	void setLength(F32 len)
 	{
-		ANKI_ASSERT(len > EPSILON);
+		ANKI_ASSERT(len > kEpsilonf);
 		m_length = len;
 	}
 
@@ -85,7 +85,7 @@ public:
 
 	void setAngle(F32 ang)
 	{
-		ANKI_ASSERT(ang > 0.0f && ang < 2.0f * PI);
+		ANKI_ASSERT(ang > 0.0f && ang < 2.0f * kPi);
 		m_angle = ang;
 	}
 
@@ -134,7 +134,7 @@ private:
 		ANKI_ASSERT(m_origin.w() == 0.0f);
 		ANKI_ASSERT(m_dir.w() == 0.0f);
 		ANKI_ASSERT(m_length > 0.0f);
-		ANKI_ASSERT(m_angle > 0.0f && m_angle < 2.0f * PI);
+		ANKI_ASSERT(m_angle > 0.0f && m_angle < 2.0f * kPi);
 	}
 };
 /// @}

+ 1 - 1
AnKi/Collision/ConvexHullShape.h

@@ -17,7 +17,7 @@ namespace anki {
 class ConvexHullShape
 {
 public:
-	static constexpr CollisionShapeType CLASS_TYPE = CollisionShapeType::CONVEX_HULL;
+	static constexpr CollisionShapeType kClassType = CollisionShapeType::kConvexHull;
 
 	/// Will not initialize any memory, nothing.
 	ConvexHullShape()

+ 1 - 1
AnKi/Collision/FunctionsComputeAabb.cpp

@@ -31,7 +31,7 @@ Aabb computeAabb(const Obb& obb)
 	const Vec4 newE = Vec4(absM * obb.getExtend(), 0.0f);
 
 	// Add a small epsilon to avoid some assertions
-	const Vec4 epsilon(Vec3(EPSILON * 100.0f), 0.0f);
+	const Vec4 epsilon(Vec3(kEpsilonf * 100.0f), 0.0f);
 
 	return Aabb(obb.getCenter() - newE, obb.getCenter() + newE + epsilon);
 }

+ 6 - 6
AnKi/Collision/FunctionsMisc.cpp

@@ -21,12 +21,12 @@ void extractClipPlane(const Mat4& mvp, FrustumPlaneType id, Plane& plane)
 
 	switch(id)
 	{
-		ANKI_CASE(FrustumPlaneType::NEAR, 3, +, 2)
-		ANKI_CASE(FrustumPlaneType::FAR, 3, -, 2)
-		ANKI_CASE(FrustumPlaneType::LEFT, 3, +, 0)
-		ANKI_CASE(FrustumPlaneType::RIGHT, 3, -, 0)
-		ANKI_CASE(FrustumPlaneType::TOP, 3, -, 1)
-		ANKI_CASE(FrustumPlaneType::BOTTOM, 3, +, 1)
+		ANKI_CASE(FrustumPlaneType::kNear, 3, +, 2)
+		ANKI_CASE(FrustumPlaneType::kFar, 3, -, 2)
+		ANKI_CASE(FrustumPlaneType::kLeft, 3, +, 0)
+		ANKI_CASE(FrustumPlaneType::kRight, 3, -, 0)
+		ANKI_CASE(FrustumPlaneType::kTop, 3, -, 1)
+		ANKI_CASE(FrustumPlaneType::kBottom, 3, +, 1)
 	default:
 		ANKI_ASSERT(0);
 	}

+ 1 - 1
AnKi/Collision/LineSegment.h

@@ -17,7 +17,7 @@ namespace anki {
 class LineSegment
 {
 public:
-	static constexpr CollisionShapeType CLASS_TYPE = CollisionShapeType::LINE_SEGMENT;
+	static constexpr CollisionShapeType kClassType = CollisionShapeType::kLineSegment;
 
 	/// Will not initialize any memory, nothing.
 	LineSegment()

+ 1 - 1
AnKi/Collision/Obb.h

@@ -18,7 +18,7 @@ namespace anki {
 class Obb
 {
 public:
-	static constexpr CollisionShapeType CLASS_TYPE = CollisionShapeType::OBB;
+	static constexpr CollisionShapeType kClassType = CollisionShapeType::kOBB;
 
 	/// Will not initialize any memory, nothing.
 	Obb()

+ 1 - 1
AnKi/Collision/Plane.h

@@ -16,7 +16,7 @@ namespace anki {
 class Plane
 {
 public:
-	static constexpr CollisionShapeType CLASS_TYPE = CollisionShapeType::PLANE;
+	static constexpr CollisionShapeType kClassType = CollisionShapeType::kPlane;
 
 	/// Will not initialize any memory, nothing.
 	Plane()

+ 2 - 2
AnKi/Collision/Ray.h

@@ -16,7 +16,7 @@ namespace anki {
 class Ray
 {
 public:
-	static constexpr CollisionShapeType CLASS_TYPE = CollisionShapeType::RAY;
+	static constexpr CollisionShapeType kClassType = CollisionShapeType::kRay;
 
 	/// Will not initialize any memory, nothing.
 	Ray()
@@ -109,7 +109,7 @@ private:
 	void check() const
 	{
 		ANKI_ASSERT(m_origin.w() == 0.0f && m_dir.w() == 0.0f
-					&& isZero(m_dir.getLengthSquared() - 1.0f, EPSILON * 100.0f));
+					&& isZero(m_dir.getLengthSquared() - 1.0f, kEpsilonf * 100.0f));
 	}
 };
 /// @}

+ 1 - 1
AnKi/Collision/Sphere.h

@@ -16,7 +16,7 @@ namespace anki {
 class Sphere
 {
 public:
-	static constexpr CollisionShapeType CLASS_TYPE = CollisionShapeType::SPHERE;
+	static constexpr CollisionShapeType kClassType = CollisionShapeType::kSphere;
 
 	/// Will not initialize any memory, nothing.
 	Sphere()

+ 2 - 2
AnKi/Importer/GltfImporter.cpp

@@ -176,7 +176,7 @@ Error GltfImporter::init(const GltfImporterInitInfo& initInfo)
 	m_optimizeAnimations = initInfo.m_optimizeAnimations;
 	m_comment.create(initInfo.m_comment);
 
-	m_lightIntensityScale = max(initInfo.m_lightIntensityScale, EPSILON);
+	m_lightIntensityScale = max(initInfo.m_lightIntensityScale, kEpsilonf);
 
 	m_lodCount = clamp(initInfo.m_lodCount, 1u, 3u);
 	m_lodFactor = clamp(initInfo.m_lodFactor, 0.0f, 1.0f);
@@ -186,7 +186,7 @@ Error GltfImporter::init(const GltfImporterInitInfo& initInfo)
 		return Error::kUserData;
 	}
 
-	if(m_lodFactor < EPSILON || m_lodCount == 1)
+	if(m_lodFactor < kEpsilonf || m_lodCount == 1)
 	{
 		m_lodCount = 1;
 		m_lodFactor = 0.0f;

+ 1 - 1
AnKi/Importer/GltfImporterAnimation.cpp

@@ -274,7 +274,7 @@ Error GltfImporter::writeAnimation(const cgltf_animation& anim)
 			optimizeChannel(
 				channel.m_rotations, Quat::getIdentity(),
 				[&](const Quat& a) -> Bool {
-					return a.abs() < Quat(EPSILON * 20.0f);
+					return a.abs() < Quat(kEpsilonf * 20.0f);
 				},
 				[&](const Quat& a, const Quat& b, F32 u) -> Quat {
 					return a.slerp(b, u);

+ 9 - 9
AnKi/Importer/GltfImporterMesh.cpp

@@ -70,7 +70,7 @@ static U calcImplicitStride(const cgltf_attribute& attrib)
 template<typename T>
 static Error checkAttribute(const cgltf_attribute& attrib)
 {
-	if(cgltfComponentCount(attrib.data->type) != T::COMPONENT_COUNT)
+	if(cgltfComponentCount(attrib.data->type) != T::kComponentCount)
 	{
 		ANKI_IMPORTER_LOGE("Wrong component count for attribute: %s", attrib.name);
 		return Error::kUserData;
@@ -389,7 +389,7 @@ Error GltfImporter::writeMesh(const cgltf_mesh& mesh, U32 lod, F32 decimateFacto
 
 		aabbMin = aabbMin.min(submesh.m_aabbMin);
 		// Bump aabbMax a bit
-		submesh.m_aabbMax += EPSILON * 10.0f;
+		submesh.m_aabbMax += kEpsilonf * 10.0f;
 		aabbMax = aabbMax.max(submesh.m_aabbMax);
 
 		//
@@ -406,7 +406,7 @@ Error GltfImporter::writeMesh(const cgltf_mesh& mesh, U32 lod, F32 decimateFacto
 
 				// Check the positions dist
 				const F32 posDist = (otherPos - pos).getLengthSquared();
-				if(posDist > EPSILON * EPSILON)
+				if(posDist > kEpsilonf * kEpsilonf)
 				{
 					continue;
 				}
@@ -497,7 +497,7 @@ Error GltfImporter::writeMesh(const cgltf_mesh& mesh, U32 lod, F32 decimateFacto
 				Vec3 t = (edge02 * uvedge01.y() - edge01 * uvedge02.y()) * det;
 				Vec3 b = (edge02 * uvedge01.x() - edge01 * uvedge02.x()) * det;
 
-				if(t.getLengthSquared() < EPSILON)
+				if(t.getLengthSquared() < kEpsilonf)
 				{
 					t = Vec3(1.0f, 0.0f, 0.0f); // Something random
 				}
@@ -506,7 +506,7 @@ Error GltfImporter::writeMesh(const cgltf_mesh& mesh, U32 lod, F32 decimateFacto
 					t.normalize();
 				}
 
-				if(b.getLengthSquared() < EPSILON)
+				if(b.getLengthSquared() < kEpsilonf)
 				{
 					b = Vec3(0.0f, 1.0f, 0.0f); // Something random
 				}
@@ -530,7 +530,7 @@ Error GltfImporter::writeMesh(const cgltf_mesh& mesh, U32 lod, F32 decimateFacto
 				const Vec3& n = submesh.m_verts[i].m_normal;
 				Vec3& b = bitangents[i];
 
-				if(t.getLengthSquared() < EPSILON)
+				if(t.getLengthSquared() < kEpsilonf)
 				{
 					t = Vec3(1.0f, 0.0f, 0.0f); // Something random
 				}
@@ -539,7 +539,7 @@ Error GltfImporter::writeMesh(const cgltf_mesh& mesh, U32 lod, F32 decimateFacto
 					t.normalize();
 				}
 
-				if(b.getLengthSquared() < EPSILON)
+				if(b.getLengthSquared() < kEpsilonf)
 				{
 					b = Vec3(0.0f, 1.0f, 0.0f); // Something random
 				}
@@ -601,7 +601,7 @@ Error GltfImporter::writeMesh(const cgltf_mesh& mesh, U32 lod, F32 decimateFacto
 			const Vec3& v1 = submesh.m_verts[i1].m_position;
 			const Vec3& v2 = submesh.m_verts[i2].m_position;
 
-			if(computeTriangleArea(v0, v1, v2) <= EPSILON)
+			if(computeTriangleArea(v0, v1, v2) <= kEpsilonf)
 			{
 				continue;
 			}
@@ -614,7 +614,7 @@ Error GltfImporter::writeMesh(const cgltf_mesh& mesh, U32 lod, F32 decimateFacto
 				for(const TempVertex& vertB : submeshB.m_verts)
 				{
 					const F32 test = testPlane(plane, vertB.m_position.xyz0());
-					if(test > EPSILON)
+					if(test > kEpsilonf)
 					{
 						convex = false;
 						break;

+ 1 - 1
AnKi/Math/Axisang.h

@@ -64,7 +64,7 @@ public:
 				return;
 			}
 
-			m_ang = PI;
+			m_ang = kPi;
 			m_axis.x() = (m3(0, 0) + T(1)) / T(2);
 			if(m_axis.x() > T(0))
 			{

+ 4 - 4
AnKi/Math/Euler.h

@@ -44,13 +44,13 @@ public:
 		if(test > T(0.499))
 		{
 			y() = T(2) * atan2<T>(q.x(), q.w());
-			z() = PI / T(2);
+			z() = kPi / T(2);
 			x() = T(0);
 		}
 		else if(test < T(-0.499))
 		{
 			y() = -T(2) * atan2<T>(q.x(), q.w());
-			z() = -PI / T(2);
+			z() = -kPi / T(2);
 			x() = T(0);
 		}
 		else
@@ -70,14 +70,14 @@ public:
 		{
 			// Singularity at north pole
 			y() = atan2(m3(0, 2), m3(2, 2));
-			z() = PI / T(2);
+			z() = kPi / T(2);
 			x() = T(0);
 		}
 		else if(m3(1, 0) < T(-0.998))
 		{
 			// Singularity at south pole
 			y() = atan2(m3(0, 2), m3(2, 2));
-			z() = -PI / T(2);
+			z() = -kPi / T(2);
 			x() = T(0);
 		}
 		else

+ 2 - 2
AnKi/Math/Functions.cpp

@@ -28,8 +28,8 @@ static void sinCosInternal(const Scalar a_, Scalar& sina, Scalar& cosa)
 		a = -a;
 		negative = true;
 	}
-	const Scalar TWO_OVER_PI = Scalar(1.0 / (PI / 2.0));
-	Scalar floatA = TWO_OVER_PI * a;
+	constexpr Scalar k2OverPi = Scalar(1.0 / (kPi / 2.0));
+	Scalar floatA = k2OverPi * a;
 	I intA = (int)floatA;
 
 	const Scalar RATIONAL_HALF_PI = 201 / 128.0;

+ 6 - 6
AnKi/Math/Functions.h

@@ -15,10 +15,10 @@ namespace anki {
 /// @{
 
 /// Just PI.
-constexpr F32 PI = 3.14159265358979323846f;
+constexpr F32 kPi = 3.14159265358979323846f;
 
 /// Floating point epsilon.
-constexpr F32 EPSILON = 1.0e-6f;
+constexpr F32 kEpsilonf = 1.0e-6f;
 
 template<typename T>
 inline T sin(const T rad)
@@ -125,7 +125,7 @@ inline constexpr T log2(const T x)
 }
 
 template<typename T, ANKI_ENABLE(std::is_floating_point<T>::value)>
-inline constexpr Bool isZero(const T f, const T e = EPSILON)
+inline constexpr Bool isZero(const T f, const T e = kEpsilonf)
 {
 	return absolute<T>(f) < e;
 }
@@ -139,13 +139,13 @@ inline constexpr Bool isZero(const T f)
 template<typename T, ANKI_ENABLE(std::is_floating_point<T>::value)>
 inline constexpr T toRad(const T degrees)
 {
-	return degrees * (PI / T(180));
+	return degrees * (kPi / T(180));
 }
 
 template<typename T>
 inline constexpr T toDegrees(const T rad)
 {
-	return rad * (T(180) / PI);
+	return rad * (T(180) / kPi);
 }
 
 template<typename T>
@@ -187,7 +187,7 @@ inline constexpr T linearInterpolate(const T& from, const T& to, F32 u)
 template<typename T>
 inline T cosInterpolate(const T& from, const T& to, F32 u)
 {
-	const F32 u2 = (1.0f - cos<F32>(u * PI)) / 2.0f;
+	const F32 u2 = (1.0f - cos<F32>(u * kPi)) / 2.0f;
 	return from * T(1.0f - u2) + to * T(u2);
 }
 

+ 31 - 31
AnKi/Math/Mat.h

@@ -18,7 +18,7 @@ namespace anki {
 /// @tparam J The number of rows.
 /// @tparam I The number of columns.
 template<typename T, U J, U I>
-class alignas(MathSimd<T, I>::ALIGNMENT) TMat
+class alignas(MathSimd<T, I>::kAlignment) TMat
 {
 public:
 	using Scalar = T;
@@ -36,12 +36,12 @@ public:
 	using RowVec = TVec<T, I>;
 	using ColumnVec = TVec<T, J>;
 
-	static constexpr U ROW_COUNT = J; ///< Number of rows
-	static constexpr U COLUMN_COUNT = I; ///< Number of columns
-	static constexpr U SIZE = J * I; ///< Number of total elements
-	static constexpr Bool HAS_SIMD = I == 4 && std::is_same<T, F32>::value && ANKI_ENABLE_SIMD;
-	static constexpr Bool HAS_MAT4_SIMD = J == 4 && I == 4 && std::is_same<T, F32>::value && ANKI_ENABLE_SIMD;
-	static constexpr Bool HAS_MAT3X4_SIMD = J == 3 && I == 4 && std::is_same<T, F32>::value && ANKI_ENABLE_SIMD;
+	static constexpr U kRowCount = J; ///< Number of rows
+	static constexpr U kColumnCount = I; ///< Number of columns
+	static constexpr U kSize = J * I; ///< Number of total elements
+	static constexpr Bool kHasSIMD = I == 4 && std::is_same<T, F32>::value && ANKI_ENABLE_SIMD;
+	static constexpr Bool kHasMat4SIMD = J == 4 && I == 4 && std::is_same<T, F32>::value && ANKI_ENABLE_SIMD;
+	static constexpr Bool kHasMat3x4SIMD = J == 3 && I == 4 && std::is_same<T, F32>::value && ANKI_ENABLE_SIMD;
 
 	/// @name Constructors
 	/// @{
@@ -52,7 +52,7 @@ public:
 	/// Copy.
 	constexpr TMat(const TMat& b)
 	{
-		for(U i = 0; i < ROW_COUNT; i++)
+		for(U i = 0; i < kRowCount; i++)
 		{
 			m_rows[i] = b.m_rows[i];
 		}
@@ -60,7 +60,7 @@ public:
 
 	explicit constexpr TMat(const T f)
 	{
-		for(U i = 0; i < ROW_COUNT; i++)
+		for(U i = 0; i < kRowCount; i++)
 		{
 			m_rows[i] = RowVec(f);
 		}
@@ -275,7 +275,7 @@ public:
 	/// Copy.
 	TMat& operator=(const TMat& b)
 	{
-		for(U i = 0; i < ROW_COUNT; ++i)
+		for(U i = 0; i < kRowCount; ++i)
 		{
 			m_rows[i] = b.m_rows[i];
 		}
@@ -285,7 +285,7 @@ public:
 	TMat operator+(const TMat& b) const
 	{
 		TMat c;
-		for(U i = 0; i < ROW_COUNT; ++i)
+		for(U i = 0; i < kRowCount; ++i)
 		{
 			c.m_rows[i] = m_rows[i] + b.m_rows[i];
 		}
@@ -294,7 +294,7 @@ public:
 
 	TMat& operator+=(const TMat& b)
 	{
-		for(U i = 0; i < ROW_COUNT; ++i)
+		for(U i = 0; i < kRowCount; ++i)
 		{
 			m_rows[i] += b.m_rows[i];
 		}
@@ -304,7 +304,7 @@ public:
 	TMat operator-(const TMat& b) const
 	{
 		TMat c;
-		for(U i = 0; i < ROW_COUNT; ++i)
+		for(U i = 0; i < kRowCount; ++i)
 		{
 			c.m_rows[i] = m_rows[i] - b.m_rows[i];
 		}
@@ -313,14 +313,14 @@ public:
 
 	TMat& operator-=(const TMat& b)
 	{
-		for(U i = 0; i < ROW_COUNT; ++i)
+		for(U i = 0; i < kRowCount; ++i)
 		{
 			m_rows[i] -= b.m_rows[i];
 		}
 		return *this;
 	}
 
-	ANKI_ENABLE_METHOD(J == I && !HAS_MAT4_SIMD)
+	ANKI_ENABLE_METHOD(J == I && !kHasMat4SIMD)
 	TMat operator*(const TMat& b) const
 	{
 		TMat out;
@@ -340,7 +340,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(HAS_MAT4_SIMD)
+	ANKI_ENABLE_METHOD(kHasMat4SIMD)
 	TMat operator*(const TMat& b) const
 	{
 		TMat out;
@@ -416,7 +416,7 @@ public:
 	TMat operator+(const T f) const
 	{
 		TMat out;
-		for(U i = 0; i < ROW_COUNT; ++i)
+		for(U i = 0; i < kRowCount; ++i)
 		{
 			out.m_rows[i] = m_rows[i] + f;
 		}
@@ -425,7 +425,7 @@ public:
 
 	TMat& operator+=(const T f)
 	{
-		for(U i = 0; i < ROW_COUNT; ++i)
+		for(U i = 0; i < kRowCount; ++i)
 		{
 			m_rows[i] += f;
 		}
@@ -435,7 +435,7 @@ public:
 	TMat operator-(const T f) const
 	{
 		TMat out;
-		for(U i = 0; i < ROW_COUNT; ++i)
+		for(U i = 0; i < kRowCount; ++i)
 		{
 			out.m_rows[i] = m_rows[i] - f;
 		}
@@ -444,7 +444,7 @@ public:
 
 	TMat& operator-=(const T f)
 	{
-		for(U i = 0; i < ROW_COUNT; ++i)
+		for(U i = 0; i < kRowCount; ++i)
 		{
 			m_rows[i] -= f;
 		}
@@ -454,7 +454,7 @@ public:
 	TMat operator*(const T f) const
 	{
 		TMat out;
-		for(U i = 0; i < ROW_COUNT; ++i)
+		for(U i = 0; i < kRowCount; ++i)
 		{
 			out.m_rows[i] = m_rows[i] * f;
 		}
@@ -463,7 +463,7 @@ public:
 
 	TMat& operator*=(const T f)
 	{
-		for(U i = 0; i < ROW_COUNT; ++i)
+		for(U i = 0; i < kRowCount; ++i)
 		{
 			m_rows[i] *= f;
 		}
@@ -474,7 +474,7 @@ public:
 	{
 		ANKI_ASSERT(f != T(0));
 		TMat out;
-		for(U i = 0; i < ROW_COUNT; ++i)
+		for(U i = 0; i < kRowCount; ++i)
 		{
 			out.m_rows[i] = m_rows[i] / f;
 		}
@@ -484,7 +484,7 @@ public:
 	TMat& operator/=(const T f)
 	{
 		ANKI_ASSERT(f != T(0));
-		for(U i = 0; i < ROW_COUNT; ++i)
+		for(U i = 0; i < kRowCount; ++i)
 		{
 			m_rows[i] /= f;
 		}
@@ -494,7 +494,7 @@ public:
 
 	/// @name Operators with other types
 	/// @{
-	ANKI_ENABLE_METHOD(!HAS_SIMD)
+	ANKI_ENABLE_METHOD(!kHasSIMD)
 	ColumnVec operator*(const RowVec& v) const
 	{
 		const TMat& m = *this;
@@ -512,7 +512,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(HAS_SIMD)
+	ANKI_ENABLE_METHOD(kHasSIMD)
 	ColumnVec operator*(const RowVec& v) const
 	{
 		ColumnVec out;
@@ -898,7 +898,7 @@ public:
 
 	void setTranslationPart(const ColumnVec& v)
 	{
-		if(ROW_COUNT == 4)
+		if(kRowCount == 4)
 		{
 			ANKI_ASSERT(isZero<T>(v[3] - T(1)) && "w should be 1");
 		}
@@ -927,7 +927,7 @@ public:
 		setColumns(xAxis, yAxis, zAxis);
 	}
 
-	ANKI_ENABLE_METHOD(J == I && !HAS_SIMD)
+	ANKI_ENABLE_METHOD(J == I && !kHasSIMD)
 	void transpose()
 	{
 		for(U j = 0; j < J; j++)
@@ -942,7 +942,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(J == I && HAS_SIMD)
+	ANKI_ENABLE_METHOD(J == I && kHasSIMD)
 	void transpose()
 	{
 #	if ANKI_SIMD_SSE
@@ -1162,7 +1162,7 @@ public:
 	}
 
 	/// Create a new matrix that is equivalent to Mat4(this)*Mat4(b)
-	ANKI_ENABLE_METHOD(J == 3 && I == 4 && !HAS_SIMD)
+	ANKI_ENABLE_METHOD(J == 3 && I == 4 && !kHasSIMD)
 	TMat combineTransformations(const TMat& b) const
 	{
 		const auto& a = *this;
@@ -1188,7 +1188,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(J == 3 && I == 4 && HAS_SIMD)
+	ANKI_ENABLE_METHOD(J == 3 && I == 4 && kHasSIMD)
 	TMat combineTransformations(const TMat& b) const
 	{
 		TMat c;

+ 2 - 2
AnKi/Math/Quat.h

@@ -79,7 +79,7 @@ public:
 	explicit TQuat(const TMat<T, 3, 3>& m3)
 	{
 		const T trace = m3(0, 0) + m3(1, 1) + m3(2, 2) + T(1.0);
-		if(trace > EPSILON)
+		if(trace > kEpsilonf)
 		{
 			T s = T(0.5) / sqrt<T>(trace);
 			w() = T(0.25) / s;
@@ -187,7 +187,7 @@ public:
 		normalize();
 		w() += 1.0;
 
-		if(w() <= EPSILON)
+		if(w() <= kEpsilonf)
 		{
 			if(from.z() * from.z() > from.x() * from.x())
 			{

+ 3 - 3
AnKi/Math/Simd.h

@@ -23,7 +23,7 @@ class MathSimd
 {
 public:
 	using Type = T[N];
-	static constexpr U ALIGNMENT = alignof(T);
+	static constexpr U kAlignment = alignof(T);
 };
 
 #if ANKI_SIMD_SSE
@@ -33,7 +33,7 @@ class MathSimd<F32, 4>
 {
 public:
 	using Type = __m128;
-	static constexpr U ALIGNMENT = 16;
+	static constexpr U kAlignment = 16;
 };
 #elif ANKI_SIMD_NEON
 // Specialize for F32
@@ -42,7 +42,7 @@ class MathSimd<F32, 4>
 {
 public:
 	using Type = float32x4_t;
-	static constexpr U ALIGNMENT = 16;
+	static constexpr U kAlignment = 16;
 };
 #endif
 

+ 76 - 76
AnKi/Math/Vec.h

@@ -17,14 +17,14 @@ namespace anki {
 /// @tparam T The scalar type. Eg float.
 /// @tparam N The number of the vector components (2, 3 or 4).
 template<typename T, U N>
-class alignas(MathSimd<T, N>::ALIGNMENT) TVec
+class alignas(MathSimd<T, N>::kAlignment) TVec
 {
 public:
 	using Scalar = T;
 	using Simd = typename MathSimd<T, N>::Type;
-	static constexpr U COMPONENT_COUNT = N;
-	static constexpr Bool IS_INTEGER = std::is_integral<T>::value;
-	static constexpr Bool HAS_VEC4_SIMD = N == 4 && std::is_same<T, F32>::value && ANKI_ENABLE_SIMD;
+	static constexpr U kComponentCount = N;
+	static constexpr Bool kIsInteger = std::is_integral<T>::value;
+	static constexpr Bool kHasVec4SIMD = N == 4 && std::is_same<T, F32>::value && ANKI_ENABLE_SIMD;
 
 	/// @name Constructors
 	/// @{
@@ -35,7 +35,7 @@ public:
 	}
 
 	/// Copy.
-	TVec(ANKI_ENABLE_ARG(const TVec&, !HAS_VEC4_SIMD) b)
+	TVec(ANKI_ENABLE_ARG(const TVec&, !kHasVec4SIMD) b)
 	{
 		for(U i = 0; i < N; i++)
 		{
@@ -44,7 +44,7 @@ public:
 	}
 
 	/// Copy.
-	TVec(ANKI_ENABLE_ARG(const TVec&, HAS_VEC4_SIMD) b)
+	TVec(ANKI_ENABLE_ARG(const TVec&, kHasVec4SIMD) b)
 	{
 		m_simd = b.m_simd;
 	}
@@ -59,7 +59,7 @@ public:
 		}
 	}
 
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	explicit TVec(const T f)
 	{
 		for(U i = 0; i < N; ++i)
@@ -69,7 +69,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	explicit TVec(const T f)
 	{
 #	if ANKI_SIMD_SSE
@@ -80,7 +80,7 @@ public:
 	}
 #endif
 
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	explicit TVec(const T arr[])
 	{
 		for(U i = 0; i < N; ++i)
@@ -89,7 +89,7 @@ public:
 		}
 	}
 
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	explicit TVec(const T arr[])
 	{
 		m_simd = _mm_load_ps(arr);
@@ -143,7 +143,7 @@ public:
 
 	// Vec4 specific
 
-	ANKI_ENABLE_METHOD(N == 4 && !HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(N == 4 && !kHasVec4SIMD)
 	TVec(const T x_, const T y_, const T z_, const T w_)
 	{
 		x() = x_;
@@ -153,7 +153,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	TVec(const T x_, const T y_, const T z_, const T w_)
 	{
 #	if ANKI_SIMD_SSE
@@ -2320,7 +2320,7 @@ public:
 	/// @{
 
 	// Copy
-	TVec& operator=(ANKI_ENABLE_ARG(const TVec&, !HAS_VEC4_SIMD) b)
+	TVec& operator=(ANKI_ENABLE_ARG(const TVec&, !kHasVec4SIMD) b)
 	{
 		for(U i = 0; i < N; i++)
 		{
@@ -2330,13 +2330,13 @@ public:
 	}
 
 	// Copy
-	TVec& operator=(ANKI_ENABLE_ARG(const TVec&, HAS_VEC4_SIMD) b)
+	TVec& operator=(ANKI_ENABLE_ARG(const TVec&, kHasVec4SIMD) b)
 	{
 		m_simd = b.m_simd;
 		return *this;
 	}
 
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	TVec operator+(const TVec& b) const
 	{
 		TVec out;
@@ -2348,7 +2348,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	TVec operator+(const TVec& b) const
 	{
 #	if ANKI_SIMD_SSE
@@ -2359,7 +2359,7 @@ public:
 	}
 #endif
 
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	TVec& operator+=(const TVec& b)
 	{
 		for(U i = 0; i < N; i++)
@@ -2370,7 +2370,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	TVec& operator+=(const TVec& b)
 	{
 #	if ANKI_SIMD_SSE
@@ -2382,7 +2382,7 @@ public:
 	}
 #endif
 
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	TVec operator-(const TVec& b) const
 	{
 		TVec out;
@@ -2394,7 +2394,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	TVec operator-(const TVec& b) const
 	{
 #	if ANKI_SIMD_SSE
@@ -2405,7 +2405,7 @@ public:
 	}
 #endif
 
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	TVec& operator-=(const TVec& b)
 	{
 		for(U i = 0; i < N; i++)
@@ -2416,7 +2416,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	TVec& operator-=(const TVec& b)
 	{
 #	if ANKI_SIMD_SSE
@@ -2428,7 +2428,7 @@ public:
 	}
 #endif
 
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	TVec operator*(const TVec& b) const
 	{
 		TVec out;
@@ -2440,7 +2440,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	TVec operator*(const TVec& b) const
 	{
 #	if ANKI_SIMD_SSE
@@ -2451,7 +2451,7 @@ public:
 	}
 #endif
 
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	TVec& operator*=(const TVec& b)
 	{
 		for(U i = 0; i < N; i++)
@@ -2462,7 +2462,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	TVec& operator*=(const TVec& b)
 	{
 #	if ANKI_SIMD_SSE
@@ -2474,7 +2474,7 @@ public:
 	}
 #endif
 
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	TVec operator/(const TVec& b) const
 	{
 		TVec out;
@@ -2487,7 +2487,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	TVec operator/(const TVec& b) const
 	{
 #	if ANKI_SIMD_SSE
@@ -2498,7 +2498,7 @@ public:
 	}
 #endif
 
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	TVec& operator/=(const TVec& b)
 	{
 		for(U i = 0; i < N; i++)
@@ -2510,7 +2510,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	TVec& operator/=(const TVec& b)
 	{
 #	if ANKI_SIMD_SSE
@@ -2522,7 +2522,7 @@ public:
 	}
 #endif
 
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	TVec operator-() const
 	{
 		TVec out;
@@ -2534,7 +2534,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	TVec operator-() const
 	{
 #	if ANKI_SIMD_SSE
@@ -2545,7 +2545,7 @@ public:
 	}
 #endif
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec operator<<(const TVec& b) const
 	{
 		TVec out;
@@ -2556,7 +2556,7 @@ public:
 		return out;
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec& operator<<=(const TVec& b)
 	{
 		for(U i = 0; i < N; i++)
@@ -2566,7 +2566,7 @@ public:
 		return *this;
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec operator>>(const TVec& b) const
 	{
 		TVec out;
@@ -2577,7 +2577,7 @@ public:
 		return out;
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec& operator>>=(const TVec& b)
 	{
 		for(U i = 0; i < N; i++)
@@ -2587,7 +2587,7 @@ public:
 		return *this;
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec operator&(const TVec& b) const
 	{
 		TVec out;
@@ -2598,7 +2598,7 @@ public:
 		return out;
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec& operator&=(const TVec& b)
 	{
 		for(U i = 0; i < N; i++)
@@ -2608,7 +2608,7 @@ public:
 		return *this;
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec operator|(const TVec& b) const
 	{
 		TVec out;
@@ -2619,7 +2619,7 @@ public:
 		return out;
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec& operator|=(const TVec& b)
 	{
 		for(U i = 0; i < N; i++)
@@ -2629,7 +2629,7 @@ public:
 		return *this;
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec operator^(const TVec& b) const
 	{
 		TVec out;
@@ -2640,7 +2640,7 @@ public:
 		return out;
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec& operator^=(const TVec& b)
 	{
 		for(U i = 0; i < N; i++)
@@ -2650,7 +2650,7 @@ public:
 		return *this;
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec operator%(const TVec& b) const
 	{
 		TVec out;
@@ -2661,7 +2661,7 @@ public:
 		return out;
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec& operator%=(const TVec& b)
 	{
 		for(U i = 0; i < N; i++)
@@ -2783,78 +2783,78 @@ public:
 		return *this;
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec operator<<(const T f) const
 	{
 		return (*this) << TVec(f);
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec& operator<<=(const T f)
 	{
 		(*this) <<= TVec(f);
 		return *this;
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec operator>>(const T f) const
 	{
 		return (*this) >> TVec(f);
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec& operator>>=(const T f)
 	{
 		(*this) >>= TVec(f);
 		return *this;
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec operator&(const T f) const
 	{
 		return (*this) & TVec(f);
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec& operator&=(const T f)
 	{
 		(*this) &= TVec(f);
 		return *this;
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec operator|(const T f) const
 	{
 		return (*this) | TVec(f);
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec& operator|=(const T f)
 	{
 		(*this) |= TVec(f);
 		return *this;
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec operator^(const T f) const
 	{
 		return (*this) ^ TVec(f);
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec& operator^=(const T f)
 	{
 		(*this) ^= TVec(f);
 		return *this;
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec operator%(const T f) const
 	{
 		return (*this) % TVec(f);
 	}
 
-	ANKI_ENABLE_METHOD(IS_INTEGER)
+	ANKI_ENABLE_METHOD(kIsInteger)
 	TVec& operator%=(const T f)
 	{
 		(*this) %= TVec(f);
@@ -2908,7 +2908,7 @@ public:
 
 	/// @name Other
 	/// @{
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	T dot(const TVec& b) const
 	{
 		T out = T(0);
@@ -2920,7 +2920,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	T dot(const TVec& b) const
 	{
 		T o;
@@ -2944,7 +2944,7 @@ public:
 	}
 
 	/// It's like calculating the cross of a 3 component TVec.
-	ANKI_ENABLE_METHOD(N == 4 && !HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(N == 4 && !kHasVec4SIMD)
 	TVec cross(const TVec& b) const
 	{
 		ANKI_ASSERT(w() == T(0));
@@ -2953,7 +2953,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(N == 4 && HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(N == 4 && kHasVec4SIMD)
 	TVec cross(const TVec& b) const
 	{
 		ANKI_ASSERT(w() == T(0));
@@ -3024,7 +3024,7 @@ public:
 		return (*this) * invw;
 	}
 
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	T getLengthSquared() const
 	{
 		T out = T(0);
@@ -3035,7 +3035,7 @@ public:
 		return out;
 	}
 
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	T getLengthSquared() const
 	{
 		return dot(*this);
@@ -3056,14 +3056,14 @@ public:
 		return sqrt<T>(getDistance(b));
 	}
 
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	void normalize()
 	{
 		(*this) /= getLength();
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	void normalize()
 	{
 #	if ANKI_SIMD_SSE
@@ -3085,14 +3085,14 @@ public:
 	}
 #endif
 
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	TVec getNormalized() const
 	{
 		return (*this) / getLength();
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	TVec getNormalized() const
 	{
 #	if ANKI_SIMD_SSE
@@ -3131,7 +3131,7 @@ public:
 		return ((*this) * (T(1) - t)) + (v1 * t);
 	}
 
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	TVec abs() const
 	{
 		TVec out;
@@ -3143,7 +3143,7 @@ public:
 	}
 
 #if ANKI_ENABLE_SIMD
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	TVec abs() const
 	{
 #	if ANKI_SIMD_SSE
@@ -3168,7 +3168,7 @@ public:
 	}
 
 	/// Get the min of all components.
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	TVec min(const TVec& b) const
 	{
 		TVec out;
@@ -3181,7 +3181,7 @@ public:
 
 #if ANKI_ENABLE_SIMD
 	/// Get the min of all components.
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	TVec min(const TVec& b) const
 	{
 #	if ANKI_SIMD_SSE
@@ -3199,7 +3199,7 @@ public:
 	}
 
 	/// Get the max of all components.
-	ANKI_ENABLE_METHOD(!HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(!kHasVec4SIMD)
 	TVec max(const TVec& b) const
 	{
 		TVec out;
@@ -3212,7 +3212,7 @@ public:
 
 #if ANKI_ENABLE_SIMD
 	/// Get the max of all components.
-	ANKI_ENABLE_METHOD(HAS_VEC4_SIMD)
+	ANKI_ENABLE_METHOD(kHasVec4SIMD)
 	TVec max(const TVec& b) const
 	{
 #	if ANKI_SIMD_SSE
@@ -3288,8 +3288,8 @@ public:
 		}
 	}
 
-	static constexpr Bool CLANG_WORKAROUND = std::is_integral<T>::value && std::is_unsigned<T>::value;
-	ANKI_ENABLE_METHOD(CLANG_WORKAROUND)
+	static constexpr Bool kClangWorkaround = std::is_integral<T>::value && std::is_unsigned<T>::value;
+	ANKI_ENABLE_METHOD(kClangWorkaround)
 	void toString(StringAuto& str) const
 	{
 		for(U i = 0; i < N; ++i)
@@ -3298,8 +3298,8 @@ public:
 		}
 	}
 
-	static constexpr Bool CLANG_WORKAROUND2 = std::is_integral<T>::value && std::is_signed<T>::value;
-	ANKI_ENABLE_METHOD(CLANG_WORKAROUND2)
+	static constexpr Bool kClangWorkaround2 = std::is_integral<T>::value && std::is_signed<T>::value;
+	ANKI_ENABLE_METHOD(kClangWorkaround2)
 	void toString(StringAuto& str) const
 	{
 		for(U i = 0; i < N; ++i)

+ 1 - 1
AnKi/Renderer/ClusterBinning.cpp

@@ -421,7 +421,7 @@ void ClusterBinning::writeClustererBuffersTask()
 		unis.m_frame = m_r->getFrameCount() & kMaxU32;
 
 		Plane nearPlane;
-		extractClipPlane(rqueue.m_viewProjectionMatrix, FrustumPlaneType::NEAR, nearPlane);
+		extractClipPlane(rqueue.m_viewProjectionMatrix, FrustumPlaneType::kNear, nearPlane);
 		unis.m_nearPlaneWSpace = Vec4(nearPlane.getNormal().xyz(), nearPlane.getOffset());
 		unis.m_near = rqueue.m_cameraNear;
 		unis.m_far = rqueue.m_cameraFar;

+ 2 - 2
AnKi/Renderer/VolumetricLightingAccumulation.cpp

@@ -131,14 +131,14 @@ void VolumetricLightingAccumulation::run(const RenderingContext& ctx, RenderPass
 	if(queueEl.m_fog.m_heightOfMaxDensity > queueEl.m_fog.m_heightOfMinDensity)
 	{
 		unis.m_minHeight = queueEl.m_fog.m_heightOfMinDensity;
-		unis.m_oneOverMaxMinusMinHeight = 1.0f / (queueEl.m_fog.m_heightOfMaxDensity - unis.m_minHeight + EPSILON);
+		unis.m_oneOverMaxMinusMinHeight = 1.0f / (queueEl.m_fog.m_heightOfMaxDensity - unis.m_minHeight + kEpsilonf);
 		unis.m_densityAtMinHeight = queueEl.m_fog.m_minDensity;
 		unis.m_densityAtMaxHeight = queueEl.m_fog.m_maxDensity;
 	}
 	else
 	{
 		unis.m_minHeight = queueEl.m_fog.m_heightOfMaxDensity;
-		unis.m_oneOverMaxMinusMinHeight = 1.0f / (queueEl.m_fog.m_heightOfMinDensity - unis.m_minHeight + EPSILON);
+		unis.m_oneOverMaxMinusMinHeight = 1.0f / (queueEl.m_fog.m_heightOfMinDensity - unis.m_minHeight + kEpsilonf);
 		unis.m_densityAtMinHeight = queueEl.m_fog.m_maxDensity;
 		unis.m_densityAtMaxHeight = queueEl.m_fog.m_minDensity;
 	}

+ 4 - 4
AnKi/Scene/CameraNode.cpp

@@ -80,7 +80,7 @@ void CameraNode::initCommon(FrustumType frustumType)
 	   && getConfig().getSceneRayTracedShadows())
 	{
 		FrustumComponent* rtFrustumComponent = newComponent<FrustumComponent>();
-		rtFrustumComponent->setFrustumType(FrustumType::ORTHOGRAPHIC);
+		rtFrustumComponent->setFrustumType(FrustumType::kOrthographic);
 		rtFrustumComponent->setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag::RAY_TRACING_SHADOWS);
 
 		const F32 dist = getConfig().getSceneRayTracingExtendedFrustumDistance();
@@ -105,7 +105,7 @@ void CameraNode::onMoveComponentUpdate(MoveComponent& move)
 		else
 		{
 			// Extended RT frustum, re-align it so the frustum is positioned at the center of the camera eye
-			ANKI_ASSERT(fc.getFrustumType() == FrustumType::ORTHOGRAPHIC);
+			ANKI_ASSERT(fc.getFrustumType() == FrustumType::kOrthographic);
 			const F32 far = fc.getFar();
 			Transform extendedFrustumTransform = Transform::getIdentity();
 			Vec3 newOrigin = worldTransform.getOrigin().xyz();
@@ -121,7 +121,7 @@ void CameraNode::onMoveComponentUpdate(MoveComponent& move)
 PerspectiveCameraNode::PerspectiveCameraNode(SceneGraph* scene, CString name)
 	: CameraNode(scene, name)
 {
-	initCommon(FrustumType::PERSPECTIVE);
+	initCommon(FrustumType::kPerspective);
 }
 
 PerspectiveCameraNode::~PerspectiveCameraNode()
@@ -131,7 +131,7 @@ PerspectiveCameraNode::~PerspectiveCameraNode()
 OrthographicCameraNode::OrthographicCameraNode(SceneGraph* scene, CString name)
 	: CameraNode(scene, name)
 {
-	initCommon(FrustumType::ORTHOGRAPHIC);
+	initCommon(FrustumType::kOrthographic);
 }
 
 OrthographicCameraNode::~OrthographicCameraNode()

+ 19 - 19
AnKi/Scene/Components/FrustumComponent.cpp

@@ -21,7 +21,7 @@ FrustumComponent::FrustumComponent(SceneNode* node)
 	ANKI_ASSERT(node);
 
 	// Set some default values
-	setFrustumType(FrustumType::PERSPECTIVE);
+	setFrustumType(FrustumType::kPerspective);
 	updateInternal();
 }
 
@@ -32,7 +32,7 @@ FrustumComponent::~FrustumComponent()
 
 Bool FrustumComponent::updateInternal()
 {
-	ANKI_ASSERT(m_frustumType != FrustumType::COUNT);
+	ANKI_ASSERT(m_frustumType != FrustumType::kCount);
 
 	Bool updated = false;
 
@@ -52,7 +52,7 @@ Bool FrustumComponent::updateInternal()
 	{
 		updated = true;
 
-		if(m_frustumType == FrustumType::PERSPECTIVE)
+		if(m_frustumType == FrustumType::kPerspective)
 		{
 			m_projMat = Mat4::calculatePerspectiveProjectionMatrix(m_perspective.m_fovX, m_perspective.m_fovY,
 																   m_perspective.m_near, m_perspective.m_far);
@@ -63,22 +63,22 @@ Bool FrustumComponent::updateInternal()
 			// Planes
 			F32 c, s; // cos & sine
 
-			sinCos(PI + m_perspective.m_fovX / 2.0f, s, c);
+			sinCos(kPi + m_perspective.m_fovX / 2.0f, s, c);
 			// right
-			m_viewPlanesL[FrustumPlaneType::RIGHT] = Plane(Vec4(c, 0.0f, s, 0.0f), 0.0f);
+			m_viewPlanesL[FrustumPlaneType::kRight] = Plane(Vec4(c, 0.0f, s, 0.0f), 0.0f);
 			// left
-			m_viewPlanesL[FrustumPlaneType::LEFT] = Plane(Vec4(-c, 0.0f, s, 0.0f), 0.0f);
+			m_viewPlanesL[FrustumPlaneType::kLeft] = Plane(Vec4(-c, 0.0f, s, 0.0f), 0.0f);
 
-			sinCos((PI + m_perspective.m_fovY) * 0.5f, s, c);
+			sinCos((kPi + m_perspective.m_fovY) * 0.5f, s, c);
 			// bottom
-			m_viewPlanesL[FrustumPlaneType::BOTTOM] = Plane(Vec4(0.0f, s, c, 0.0f), 0.0f);
+			m_viewPlanesL[FrustumPlaneType::kBottom] = Plane(Vec4(0.0f, s, c, 0.0f), 0.0f);
 			// top
-			m_viewPlanesL[FrustumPlaneType::TOP] = Plane(Vec4(0.0f, -s, c, 0.0f), 0.0f);
+			m_viewPlanesL[FrustumPlaneType::kTop] = Plane(Vec4(0.0f, -s, c, 0.0f), 0.0f);
 
 			// near
-			m_viewPlanesL[FrustumPlaneType::NEAR] = Plane(Vec4(0.0f, 0.0f, -1.0, 0.0f), m_perspective.m_near);
+			m_viewPlanesL[FrustumPlaneType::kNear] = Plane(Vec4(0.0f, 0.0f, -1.0, 0.0f), m_perspective.m_near);
 			// far
-			m_viewPlanesL[FrustumPlaneType::FAR] = Plane(Vec4(0.0f, 0.0f, 1.0, 0.0f), -m_perspective.m_far);
+			m_viewPlanesL[FrustumPlaneType::kFar] = Plane(Vec4(0.0f, 0.0f, 1.0, 0.0f), -m_perspective.m_far);
 		}
 		else
 		{
@@ -93,12 +93,12 @@ Bool FrustumComponent::updateInternal()
 			m_ortho.m_obbL = Obb(c, Mat3x4::getIdentity(), e);
 
 			// Planes
-			m_viewPlanesL[FrustumPlaneType::LEFT] = Plane(Vec4(1.0f, 0.0f, 0.0f, 0.0f), m_ortho.m_left);
-			m_viewPlanesL[FrustumPlaneType::RIGHT] = Plane(Vec4(-1.0f, 0.0f, 0.0f, 0.0f), -m_ortho.m_right);
-			m_viewPlanesL[FrustumPlaneType::NEAR] = Plane(Vec4(0.0f, 0.0f, -1.0f, 0.0f), m_ortho.m_near);
-			m_viewPlanesL[FrustumPlaneType::FAR] = Plane(Vec4(0.0f, 0.0f, 1.0f, 0.0f), -m_ortho.m_far);
-			m_viewPlanesL[FrustumPlaneType::TOP] = Plane(Vec4(0.0f, -1.0f, 0.0f, 0.0f), -m_ortho.m_top);
-			m_viewPlanesL[FrustumPlaneType::BOTTOM] = Plane(Vec4(0.0f, 1.0f, 0.0f, 0.0f), m_ortho.m_bottom);
+			m_viewPlanesL[FrustumPlaneType::kLeft] = Plane(Vec4(1.0f, 0.0f, 0.0f, 0.0f), m_ortho.m_left);
+			m_viewPlanesL[FrustumPlaneType::kRight] = Plane(Vec4(-1.0f, 0.0f, 0.0f, 0.0f), -m_ortho.m_right);
+			m_viewPlanesL[FrustumPlaneType::kNear] = Plane(Vec4(0.0f, 0.0f, -1.0f, 0.0f), m_ortho.m_near);
+			m_viewPlanesL[FrustumPlaneType::kFar] = Plane(Vec4(0.0f, 0.0f, 1.0f, 0.0f), -m_ortho.m_far);
+			m_viewPlanesL[FrustumPlaneType::kTop] = Plane(Vec4(0.0f, -1.0f, 0.0f, 0.0f), -m_ortho.m_top);
+			m_viewPlanesL[FrustumPlaneType::kBottom] = Plane(Vec4(0.0f, 1.0f, 0.0f, 0.0f), m_ortho.m_bottom);
 		}
 	}
 
@@ -116,7 +116,7 @@ Bool FrustumComponent::updateInternal()
 		m_shapeMarkedForUpdate = false;
 		m_trfMarkedForUpdate = false;
 
-		if(m_frustumType == FrustumType::PERSPECTIVE)
+		if(m_frustumType == FrustumType::kPerspective)
 		{
 			m_perspective.m_edgesW[0] = m_trf.getOrigin();
 			m_perspective.m_edgesW[1] = m_trf.transform(m_perspective.m_edgesL[0]);
@@ -131,7 +131,7 @@ Bool FrustumComponent::updateInternal()
 			m_ortho.m_obbW = m_ortho.m_obbL.getTransformed(m_trf);
 		}
 
-		for(FrustumPlaneType planeId = FrustumPlaneType::FIRST; planeId < FrustumPlaneType::COUNT; ++planeId)
+		for(FrustumPlaneType planeId : EnumIterable<FrustumPlaneType>())
 		{
 			m_viewPlanesW[planeId] = m_viewPlanesL[planeId].getTransformed(m_trf);
 		}

+ 24 - 24
AnKi/Scene/Components/FrustumComponent.h

@@ -78,9 +78,9 @@ public:
 
 	void setFrustumType(FrustumType type)
 	{
-		ANKI_ASSERT(type >= FrustumType::FIRST && type < FrustumType::COUNT);
+		ANKI_ASSERT(type >= FrustumType::kFirst && type < FrustumType::kCount);
 		m_frustumType = type;
-		if(m_frustumType == FrustumType::PERSPECTIVE)
+		if(m_frustumType == FrustumType::kPerspective)
 		{
 			setPerspective(0.1f, 100.0f, toRad(45.0f), toRad(45.0f));
 		}
@@ -92,15 +92,15 @@ public:
 
 	FrustumType getFrustumType() const
 	{
-		ANKI_ASSERT(m_frustumType != FrustumType::COUNT);
+		ANKI_ASSERT(m_frustumType != FrustumType::kCount);
 		return m_frustumType;
 	}
 
 	void setPerspective(F32 near, F32 far, F32 fovX, F32 fovY)
 	{
 		ANKI_ASSERT(near > 0.0f && far > 0.0f && near < far);
-		ANKI_ASSERT(fovX > 0.0f && fovY > 0.0f && fovX < PI && fovY < PI);
-		ANKI_ASSERT(m_frustumType == FrustumType::PERSPECTIVE);
+		ANKI_ASSERT(fovX > 0.0f && fovY > 0.0f && fovX < kPi && fovY < kPi);
+		ANKI_ASSERT(m_frustumType == FrustumType::kPerspective);
 		m_perspective.m_near = near;
 		m_perspective.m_far = far;
 		m_perspective.m_fovX = fovX;
@@ -112,7 +112,7 @@ public:
 	{
 		ANKI_ASSERT(near > 0.0f && far > 0.0f && near < far);
 		ANKI_ASSERT(right > left && top > bottom);
-		ANKI_ASSERT(m_frustumType == FrustumType::ORTHOGRAPHIC);
+		ANKI_ASSERT(m_frustumType == FrustumType::kOrthographic);
 		m_ortho.m_near = near;
 		m_ortho.m_far = far;
 		m_ortho.m_right = right;
@@ -146,75 +146,75 @@ public:
 
 	void setFovX(F32 fovx)
 	{
-		ANKI_ASSERT(m_frustumType == FrustumType::PERSPECTIVE);
+		ANKI_ASSERT(m_frustumType == FrustumType::kPerspective);
 		m_shapeMarkedForUpdate = true;
 		m_perspective.m_fovX = fovx;
 	}
 
 	F32 getFovX() const
 	{
-		ANKI_ASSERT(m_frustumType == FrustumType::PERSPECTIVE);
+		ANKI_ASSERT(m_frustumType == FrustumType::kPerspective);
 		return m_perspective.m_fovX;
 	}
 
 	void setFovY(F32 fovy)
 	{
-		ANKI_ASSERT(m_frustumType == FrustumType::PERSPECTIVE);
+		ANKI_ASSERT(m_frustumType == FrustumType::kPerspective);
 		m_shapeMarkedForUpdate = true;
 		m_perspective.m_fovY = fovy;
 	}
 
 	F32 getFovY() const
 	{
-		ANKI_ASSERT(m_frustumType == FrustumType::PERSPECTIVE);
+		ANKI_ASSERT(m_frustumType == FrustumType::kPerspective);
 		return m_perspective.m_fovY;
 	}
 
 	F32 getLeft() const
 	{
-		ANKI_ASSERT(m_frustumType == FrustumType::ORTHOGRAPHIC);
+		ANKI_ASSERT(m_frustumType == FrustumType::kOrthographic);
 		return m_ortho.m_left;
 	}
 
 	void setLeft(F32 value)
 	{
-		ANKI_ASSERT(m_frustumType == FrustumType::ORTHOGRAPHIC);
+		ANKI_ASSERT(m_frustumType == FrustumType::kOrthographic);
 		m_ortho.m_left = value;
 	}
 
 	F32 getRight() const
 	{
-		ANKI_ASSERT(m_frustumType == FrustumType::ORTHOGRAPHIC);
+		ANKI_ASSERT(m_frustumType == FrustumType::kOrthographic);
 		return m_ortho.m_right;
 	}
 
 	void setRight(F32 value)
 	{
-		ANKI_ASSERT(m_frustumType == FrustumType::ORTHOGRAPHIC);
+		ANKI_ASSERT(m_frustumType == FrustumType::kOrthographic);
 		m_ortho.m_right = value;
 	}
 
 	F32 getTop() const
 	{
-		ANKI_ASSERT(m_frustumType == FrustumType::ORTHOGRAPHIC);
+		ANKI_ASSERT(m_frustumType == FrustumType::kOrthographic);
 		return m_ortho.m_top;
 	}
 
 	void setTop(F32 value)
 	{
-		ANKI_ASSERT(m_frustumType == FrustumType::ORTHOGRAPHIC);
+		ANKI_ASSERT(m_frustumType == FrustumType::kOrthographic);
 		m_ortho.m_top = value;
 	}
 
 	F32 getBottom() const
 	{
-		ANKI_ASSERT(m_frustumType == FrustumType::ORTHOGRAPHIC);
+		ANKI_ASSERT(m_frustumType == FrustumType::kOrthographic);
 		return m_ortho.m_bottom;
 	}
 
 	void setBottom(F32 value)
 	{
-		ANKI_ASSERT(m_frustumType == FrustumType::ORTHOGRAPHIC);
+		ANKI_ASSERT(m_frustumType == FrustumType::kOrthographic);
 		m_ortho.m_bottom = value;
 	}
 
@@ -360,17 +360,17 @@ public:
 
 	const ConvexHullShape& getPerspectiveBoundingShapeWorldSpace() const
 	{
-		ANKI_ASSERT(m_frustumType == FrustumType::PERSPECTIVE);
+		ANKI_ASSERT(m_frustumType == FrustumType::kPerspective);
 		return m_perspective.m_hull;
 	}
 
 	const Obb& getOrthographicBoundingShapeWorldSpace() const
 	{
-		ANKI_ASSERT(m_frustumType == FrustumType::ORTHOGRAPHIC);
+		ANKI_ASSERT(m_frustumType == FrustumType::kOrthographic);
 		return m_ortho.m_obbW;
 	}
 
-	const Array<Plane, U32(FrustumPlaneType::COUNT)>& getViewPlanes() const
+	const Array<Plane, U32(FrustumPlaneType::kCount)>& getViewPlanes() const
 	{
 		return m_viewPlanesW;
 	}
@@ -420,7 +420,7 @@ private:
 
 	SceneNode* m_node;
 
-	FrustumType m_frustumType = FrustumType::COUNT;
+	FrustumType m_frustumType = FrustumType::kCount;
 
 	union
 	{
@@ -430,8 +430,8 @@ private:
 	};
 
 	// View planes
-	Array<Plane, U32(FrustumPlaneType::COUNT)> m_viewPlanesL;
-	Array<Plane, U32(FrustumPlaneType::COUNT)> m_viewPlanesW;
+	Array<Plane, U32(FrustumPlaneType::kCount)> m_viewPlanesL;
+	Array<Plane, U32(FrustumPlaneType::kCount)> m_viewPlanesW;
 
 	Transform m_trf = Transform::getIdentity();
 	Mat4 m_projMat = Mat4::getIdentity(); ///< Projection matrix

+ 6 - 6
AnKi/Scene/Components/LightComponent.cpp

@@ -94,7 +94,7 @@ void LightComponent::setupDirectionalLightQueueElement(const FrustumComponent& f
 
 	// Compute the texture matrices
 	const Mat4 lightTrf(m_worldtransform);
-	if(frustumComp.getFrustumType() == FrustumType::PERSPECTIVE)
+	if(frustumComp.getFrustumType() == FrustumType::kPerspective)
 	{
 		// Get some stuff
 		const F32 fovX = frustumComp.getFovX();
@@ -127,7 +127,7 @@ void LightComponent::setupDirectionalLightQueueElement(const FrustumComponent& f
 			const F32 b = n * tan(fovY / 2.0f) * fovX / fovY;
 			const F32 z = (b * b + n * n - a * a - f * f) / (2.0f * (f - n));
 			ANKI_ASSERT(absolute((Vec2(a, -f) - Vec2(0, z)).getLength() - (Vec2(b, -n) - Vec2(0, z)).getLength())
-						<= EPSILON * 100.0f);
+						<= kEpsilonf * 100.0f);
 
 			Vec3 C(0.0f, 0.0f, z); // Sphere center
 
@@ -202,13 +202,13 @@ void LightComponent::setupDirectionalLightQueueElement(const FrustumComponent& f
 
 			// Fill the frustum with the fixed projection parameters from the fixed projection matrix
 			Plane plane;
-			extractClipPlane(cascadeProjMat, FrustumPlaneType::LEFT, plane);
+			extractClipPlane(cascadeProjMat, FrustumPlaneType::kLeft, plane);
 			const F32 left = plane.getOffset();
-			extractClipPlane(cascadeProjMat, FrustumPlaneType::RIGHT, plane);
+			extractClipPlane(cascadeProjMat, FrustumPlaneType::kRight, plane);
 			const F32 right = -plane.getOffset();
-			extractClipPlane(cascadeProjMat, FrustumPlaneType::TOP, plane);
+			extractClipPlane(cascadeProjMat, FrustumPlaneType::kTop, plane);
 			const F32 top = -plane.getOffset();
-			extractClipPlane(cascadeProjMat, FrustumPlaneType::BOTTOM, plane);
+			extractClipPlane(cascadeProjMat, FrustumPlaneType::kBottom, plane);
 			const F32 bottom = plane.getOffset();
 
 			FrustumComponent& cascadeFrustumComp = cascadeFrustumComponents[i];

+ 3 - 3
AnKi/Scene/Components/SkinComponent.cpp

@@ -178,9 +178,9 @@ Error SkinComponent::update(SceneComponentUpdateInfo& info, Bool& updated)
 		// Walk the bone hierarchy to add additional transforms
 		visitBones(m_skeleton->getRootBone(), Mat4::getIdentity(), bonesAnimated, minExtend, maxExtend);
 
-		const Vec4 E(EPSILON, EPSILON, EPSILON, 0.0f);
-		m_boneBoundingVolume.setMin(minExtend - E);
-		m_boneBoundingVolume.setMax(maxExtend + E);
+		const Vec4 e(kEpsilonf, kEpsilonf, kEpsilonf, 0.0f);
+		m_boneBoundingVolume.setMin(minExtend - e);
+		m_boneBoundingVolume.setMax(maxExtend + e);
 	}
 	else
 	{

+ 5 - 5
AnKi/Scene/Components/SpatialComponent.cpp

@@ -51,7 +51,7 @@ void SpatialComponent::setConvexHullWorldSpace(const ConvexHullShape& hull)
 		m_hull.setTransform(hull.getTransform());
 	}
 
-	m_collisionObjectType = hull.CLASS_TYPE;
+	m_collisionObjectType = hull.kClassType;
 	m_markedForUpdate = true;
 }
 
@@ -67,16 +67,16 @@ Error SpatialComponent::update([[maybe_unused]] SceneComponentUpdateInfo& info,
 			// Compute the AABB
 			switch(m_collisionObjectType)
 			{
-			case CollisionShapeType::AABB:
+			case CollisionShapeType::kAABB:
 				m_derivedAabb = m_aabb;
 				break;
-			case CollisionShapeType::OBB:
+			case CollisionShapeType::kOBB:
 				m_derivedAabb = computeAabb(m_obb);
 				break;
-			case CollisionShapeType::SPHERE:
+			case CollisionShapeType::kSphere:
 				m_derivedAabb = computeAabb(m_sphere);
 				break;
-			case CollisionShapeType::CONVEX_HULL:
+			case CollisionShapeType::kConvexHull:
 				m_derivedAabb = computeAabb(m_hull);
 				break;
 			default:

+ 5 - 5
AnKi/Scene/Components/SpatialComponent.h

@@ -30,21 +30,21 @@ public:
 	void setObbWorldSpace(const Obb& obb)
 	{
 		m_obb = obb;
-		m_collisionObjectType = obb.CLASS_TYPE;
+		m_collisionObjectType = obb.kClassType;
 		m_markedForUpdate = true;
 	}
 
 	void setAabbWorldSpace(const Aabb& aabb)
 	{
 		m_aabb = aabb;
-		m_collisionObjectType = aabb.CLASS_TYPE;
+		m_collisionObjectType = aabb.kClassType;
 		m_markedForUpdate = true;
 	}
 
 	void setSphereWorldSpace(const Sphere& sphere)
 	{
 		m_sphere = sphere;
-		m_collisionObjectType = sphere.CLASS_TYPE;
+		m_collisionObjectType = sphere.kClassType;
 		m_markedForUpdate = true;
 	}
 
@@ -53,7 +53,7 @@ public:
 	template<typename T>
 	const T& getCollisionShape() const
 	{
-		ANKI_ASSERT(T::CLASS_TYPE == m_collisionObjectType);
+		ANKI_ASSERT(T::kClassType == m_collisionObjectType);
 		return *reinterpret_cast<const T*>(&m_anyShape);
 	}
 
@@ -126,7 +126,7 @@ private:
 
 	DynamicArray<Vec4> m_convexHullPoints;
 
-	CollisionShapeType m_collisionObjectType = CollisionShapeType::COUNT;
+	CollisionShapeType m_collisionObjectType = CollisionShapeType::kCount;
 	Aabb m_derivedAabb; ///< A faster shape
 
 	Vec3 m_origin = Vec3(kMaxF32);

+ 1 - 1
AnKi/Scene/Events/JitterMoveEvent.cpp

@@ -42,7 +42,7 @@ Error JitterMoveEvent::update([[maybe_unused]] Second prevUpdateTime, Second crn
 
 	Transform trf = move.getLocalTransform();
 
-	F32 factor = F32(sin(getDelta(crntTime) * PI));
+	F32 factor = F32(sin(getDelta(crntTime) * kPi));
 
 	trf.getOrigin() = linearInterpolate(m_originalPos, m_newPos, factor);
 

+ 1 - 1
AnKi/Scene/Events/LightEvent.cpp

@@ -38,7 +38,7 @@ Error LightEvent::update([[maybe_unused]] Second prevUpdateTime, Second crntTime
 {
 	const F32 freq = getRandomRange(m_freq - m_freqDeviation, m_freq + m_freqDeviation);
 
-	F32 factor = F32(sin(crntTime * freq * PI)) / 2.0f + 0.5f;
+	F32 factor = F32(sin(crntTime * freq * kPi)) / 2.0f + 0.5f;
 	LightComponent& lightc = m_associatedNodes[0]->getFirstComponentOfType<LightComponent>();
 
 	// Update radius

+ 7 - 7
AnKi/Scene/GlobalIlluminationProbeNode.cpp

@@ -93,17 +93,17 @@ GlobalIlluminationProbeNode::GlobalIlluminationProbeNode(SceneGraph* scene, CStr
 	const F32 zNear = CLUSTER_OBJECT_FRUSTUM_NEAR_PLANE;
 
 	Mat3 rot;
-	rot = Mat3(Euler(0.0f, -PI / 2.0f, 0.0f)) * Mat3(Euler(0.0f, 0.0f, PI));
+	rot = Mat3(Euler(0.0f, -kPi / 2.0f, 0.0f)) * Mat3(Euler(0.0f, 0.0f, kPi));
 	m_cubeFaceTransforms[0].setRotation(Mat3x4(Vec3(0.0f), rot));
-	rot = Mat3(Euler(0.0f, PI / 2.0f, 0.0f)) * Mat3(Euler(0.0f, 0.0f, PI));
+	rot = Mat3(Euler(0.0f, kPi / 2.0f, 0.0f)) * Mat3(Euler(0.0f, 0.0f, kPi));
 	m_cubeFaceTransforms[1].setRotation(Mat3x4(Vec3(0.0f), rot));
-	rot = Mat3(Euler(PI / 2.0f, 0.0f, 0.0f));
+	rot = Mat3(Euler(kPi / 2.0f, 0.0f, 0.0f));
 	m_cubeFaceTransforms[2].setRotation(Mat3x4(Vec3(0.0f), rot));
-	rot = Mat3(Euler(-PI / 2.0f, 0.0f, 0.0f));
+	rot = Mat3(Euler(-kPi / 2.0f, 0.0f, 0.0f));
 	m_cubeFaceTransforms[3].setRotation(Mat3x4(Vec3(0.0f), rot));
-	rot = Mat3(Euler(0.0f, PI, 0.0f)) * Mat3(Euler(0.0f, 0.0f, PI));
+	rot = Mat3(Euler(0.0f, kPi, 0.0f)) * Mat3(Euler(0.0f, 0.0f, kPi));
 	m_cubeFaceTransforms[4].setRotation(Mat3x4(Vec3(0.0f), rot));
-	rot = Mat3(Euler(0.0f, 0.0f, PI));
+	rot = Mat3(Euler(0.0f, 0.0f, kPi));
 	m_cubeFaceTransforms[5].setRotation(Mat3x4(Vec3(0.0f), rot));
 
 	for(U i = 0; i < 6; ++i)
@@ -112,7 +112,7 @@ GlobalIlluminationProbeNode::GlobalIlluminationProbeNode(SceneGraph* scene, CStr
 		m_cubeFaceTransforms[i].setScale(1.0f);
 
 		FrustumComponent* frc = newComponent<FrustumComponent>();
-		frc->setFrustumType(FrustumType::PERSPECTIVE);
+		frc->setFrustumType(FrustumType::kPerspective);
 		const F32 tempEffectiveDistance = 1.0f;
 		frc->setPerspective(zNear, tempEffectiveDistance, ang, ang);
 		frc->setWorldTransform(m_cubeFaceTransforms[i]);

+ 8 - 8
AnKi/Scene/LightNode.cpp

@@ -168,17 +168,17 @@ Error PointLightNode::frameUpdate([[maybe_unused]] Second prevUpdateTime, [[mayb
 
 		Mat3 rot;
 
-		rot = Mat3(Euler(0.0, -PI / 2.0, 0.0)) * Mat3(Euler(0.0, 0.0, PI));
+		rot = Mat3(Euler(0.0, -kPi / 2.0, 0.0)) * Mat3(Euler(0.0, 0.0, kPi));
 		m_shadowData[0].m_localTrf.setRotation(Mat3x4(Vec3(0.0f), rot));
-		rot = Mat3(Euler(0.0, PI / 2.0, 0.0)) * Mat3(Euler(0.0, 0.0, PI));
+		rot = Mat3(Euler(0.0, kPi / 2.0, 0.0)) * Mat3(Euler(0.0, 0.0, kPi));
 		m_shadowData[1].m_localTrf.setRotation(Mat3x4(Vec3(0.0f), rot));
-		rot = Mat3(Euler(PI / 2.0, 0.0, 0.0));
+		rot = Mat3(Euler(kPi / 2.0, 0.0, 0.0));
 		m_shadowData[2].m_localTrf.setRotation(Mat3x4(Vec3(0.0f), rot));
-		rot = Mat3(Euler(-PI / 2.0, 0.0, 0.0));
+		rot = Mat3(Euler(-kPi / 2.0, 0.0, 0.0));
 		m_shadowData[3].m_localTrf.setRotation(Mat3x4(Vec3(0.0f), rot));
-		rot = Mat3(Euler(0.0, PI, 0.0)) * Mat3(Euler(0.0, 0.0, PI));
+		rot = Mat3(Euler(0.0, kPi, 0.0)) * Mat3(Euler(0.0, 0.0, kPi));
 		m_shadowData[4].m_localTrf.setRotation(Mat3x4(Vec3(0.0f), rot));
-		rot = Mat3(Euler(0.0, 0.0, PI));
+		rot = Mat3(Euler(0.0, 0.0, kPi));
 		m_shadowData[5].m_localTrf.setRotation(Mat3x4(Vec3(0.0f), rot));
 
 		const Vec4& origin = getFirstComponentOfType<MoveComponent>().getWorldTransform().getOrigin();
@@ -188,7 +188,7 @@ Error PointLightNode::frameUpdate([[maybe_unused]] Second prevUpdateTime, [[mayb
 			trf.setOrigin(origin);
 
 			FrustumComponent* frc = newComponent<FrustumComponent>();
-			frc->setFrustumType(FrustumType::PERSPECTIVE);
+			frc->setFrustumType(FrustumType::kPerspective);
 			frc->setPerspective(zNear, dist, ang, ang);
 			frc->setWorldTransform(trf);
 		}
@@ -240,7 +240,7 @@ SpotLightNode::SpotLightNode(SceneGraph* scene, CString name)
 	newComponent<OnLightShapeUpdatedFeedbackComponent>();
 
 	FrustumComponent* fr = newComponent<FrustumComponent>();
-	fr->setFrustumType(FrustumType::PERSPECTIVE);
+	fr->setFrustumType(FrustumType::kPerspective);
 	fr->setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag::NONE);
 
 	newComponent<OnFrustumUpdatedFeedbackComponent>();

+ 7 - 7
AnKi/Scene/ReflectionProbeNode.cpp

@@ -84,17 +84,17 @@ ReflectionProbeNode::ReflectionProbeNode(SceneGraph* scene, CString name)
 
 	Mat3 rot;
 
-	rot = Mat3(Euler(0.0f, -PI / 2.0f, 0.0f)) * Mat3(Euler(0.0f, 0.0f, PI));
+	rot = Mat3(Euler(0.0f, -kPi / 2.0f, 0.0f)) * Mat3(Euler(0.0f, 0.0f, kPi));
 	m_frustumTransforms[0].setRotation(Mat3x4(Vec3(0.0f), rot));
-	rot = Mat3(Euler(0.0f, PI / 2.0f, 0.0f)) * Mat3(Euler(0.0f, 0.0f, PI));
+	rot = Mat3(Euler(0.0f, kPi / 2.0f, 0.0f)) * Mat3(Euler(0.0f, 0.0f, kPi));
 	m_frustumTransforms[1].setRotation(Mat3x4(Vec3(0.0f), rot));
-	rot = Mat3(Euler(PI / 2.0f, 0.0f, 0.0f));
+	rot = Mat3(Euler(kPi / 2.0f, 0.0f, 0.0f));
 	m_frustumTransforms[2].setRotation(Mat3x4(Vec3(0.0f), rot));
-	rot = Mat3(Euler(-PI / 2.0f, 0.0f, 0.0f));
+	rot = Mat3(Euler(-kPi / 2.0f, 0.0f, 0.0f));
 	m_frustumTransforms[3].setRotation(Mat3x4(Vec3(0.0f), rot));
-	rot = Mat3(Euler(0.0f, PI, 0.0f)) * Mat3(Euler(0.0f, 0.0f, PI));
+	rot = Mat3(Euler(0.0f, kPi, 0.0f)) * Mat3(Euler(0.0f, 0.0f, kPi));
 	m_frustumTransforms[4].setRotation(Mat3x4(Vec3(0.0f), rot));
-	rot = Mat3(Euler(0.0f, 0.0f, PI));
+	rot = Mat3(Euler(0.0f, 0.0f, kPi));
 	m_frustumTransforms[5].setRotation(Mat3x4(Vec3(0.0f), rot));
 
 	for(U i = 0; i < 6; ++i)
@@ -103,7 +103,7 @@ ReflectionProbeNode::ReflectionProbeNode(SceneGraph* scene, CString name)
 		m_frustumTransforms[i].setScale(1.0f);
 
 		FrustumComponent* frc = newComponent<FrustumComponent>();
-		frc->setFrustumType(FrustumType::PERSPECTIVE);
+		frc->setFrustumType(FrustumType::kPerspective);
 		frc->setPerspective(CLUSTER_OBJECT_FRUSTUM_NEAR_PLANE, 10.0f, ang, ang);
 		frc->setWorldTransform(m_frustumTransforms[i]);
 		frc->setEnabledVisibilityTests(FrustumComponentVisibilityTestFlag::NONE);

+ 4 - 4
AnKi/Scene/SoftwareRasterizer.cpp

@@ -36,8 +36,8 @@ void SoftwareRasterizer::clipTriangle(const Vec4* inVerts, Vec4* outVerts, U& ou
 {
 	ANKI_ASSERT(inVerts && outVerts);
 
-	const Plane& plane = m_planesL[FrustumPlaneType::NEAR];
-	F32 clipZ = -plane.getOffset() - EPSILON;
+	const Plane& plane = m_planesL[FrustumPlaneType::kNear];
+	F32 clipZ = -plane.getOffset() - kEpsilonf;
 	ANKI_ASSERT(clipZ < 0.0);
 
 	Array<Bool, 3> vertInside;
@@ -282,7 +282,7 @@ void SoftwareRasterizer::rasterizeTriangle(const Vec4* tri)
 				ANKI_ASSERT(depth >= 0.0 && depth <= 1.0);
 
 				// Clamp it to a bit less that 1.0f because 1.0f will produce a 0 depthi
-				depth = min(depth, 1.0f - EPSILON);
+				depth = min(depth, 1.0f - kEpsilonf);
 
 				// Store the min of the current value and new one
 				const U32 depthi = U32(depth * F32(kMaxU32));
@@ -395,7 +395,7 @@ void SoftwareRasterizer::fillDepthBuffer(ConstWeakArray<F32> depthValues)
 		F32 depth = depthValues[count];
 		ANKI_ASSERT(depth >= 0.0f && depth <= 1.0f);
 
-		depth = min(depth, 1.0f - EPSILON); // See a few lines above why is that
+		depth = min(depth, 1.0f - kEpsilonf); // See a few lines above why is that
 
 		const U32 depthi = U32(depth * F32(kMaxU32));
 		m_zbuffer[count].setNonAtomically(depthi);

+ 9 - 9
AnKi/Scene/Visibility.cpp

@@ -54,16 +54,16 @@ static Bool spatialInsideFrustum(const FrustumComponent& frc, const SpatialCompo
 {
 	switch(spc.getCollisionShapeType())
 	{
-	case CollisionShapeType::OBB:
+	case CollisionShapeType::kOBB:
 		return frc.insideFrustum(spc.getCollisionShape<Obb>());
 		break;
-	case CollisionShapeType::AABB:
+	case CollisionShapeType::kAABB:
 		return frc.insideFrustum(spc.getCollisionShape<Aabb>());
 		break;
-	case CollisionShapeType::SPHERE:
+	case CollisionShapeType::kSphere:
 		return frc.insideFrustum(spc.getCollisionShape<Sphere>());
 		break;
-	case CollisionShapeType::CONVEX_HULL:
+	case CollisionShapeType::kConvexHull:
 		return frc.insideFrustum(spc.getCollisionShape<ConvexHullShape>());
 		break;
 	default:
@@ -98,7 +98,7 @@ void VisibilityContext::submitNewWork(const FrustumComponent& frc, const Frustum
 	rqueue.m_previousViewProjectionMatrix = frc.getPreviousViewProjectionMatrix();
 	rqueue.m_cameraNear = frc.getNear();
 	rqueue.m_cameraFar = frc.getFar();
-	if(frc.getFrustumType() == FrustumType::PERSPECTIVE)
+	if(frc.getFrustumType() == FrustumType::kPerspective)
 	{
 		rqueue.m_cameraFovX = frc.getFovX();
 		rqueue.m_cameraFovY = frc.getFovY();
@@ -381,7 +381,7 @@ void VisibilityTestTask::test(ThreadHive& hive, U32 taskId)
 			rc.setupRenderableQueueElement(*el);
 
 			// Compute distance from the frustum
-			const Plane& nearPlane = primaryFrc.getViewPlanes()[FrustumPlaneType::NEAR];
+			const Plane& nearPlane = primaryFrc.getViewPlanes()[FrustumPlaneType::kNear];
 			el->m_distanceFromCamera = !!(rc.getFlags() & RenderComponentFlag::SORT_LAST)
 										   ? primaryFrc.getFar()
 										   : max(0.0f, testPlane(nearPlane, spatialc->getAabbWorldSpace()));
@@ -402,7 +402,7 @@ void VisibilityTestTask::test(ThreadHive& hive, U32 taskId)
 				RayTracingInstanceQueueElement* el = result.m_rayTracingInstances.newElement(alloc);
 
 				// Compute the LOD
-				const Plane& nearPlane = primaryFrc.getViewPlanes()[FrustumPlaneType::NEAR];
+				const Plane& nearPlane = primaryFrc.getViewPlanes()[FrustumPlaneType::kNear];
 				const F32 dist = testPlane(nearPlane, spatialc->getAabbWorldSpace());
 				rc.setupRayTracingInstanceQueueElement(computeLod(primaryFrc, dist), *el);
 			}
@@ -417,7 +417,7 @@ void VisibilityTestTask::test(ThreadHive& hive, U32 taskId)
 				// Extra check
 
 				// Compute distance from the frustum
-				const Plane& nearPlane = primaryFrc.getViewPlanes()[FrustumPlaneType::NEAR];
+				const Plane& nearPlane = primaryFrc.getViewPlanes()[FrustumPlaneType::kNear];
 				const F32 distFromFrustum = max(0.0f, testPlane(nearPlane, spatialc->getAabbWorldSpace()));
 
 				castsShadow = distFromFrustum < primaryFrc.getEffectiveShadowDistance();
@@ -493,7 +493,7 @@ void VisibilityTestTask::test(ThreadHive& hive, U32 taskId)
 				for(U32 i = 0; i < cascadeCount; ++i)
 				{
 					::new(&cascadeFrustumComponents[i]) FrustumComponent(&node);
-					cascadeFrustumComponents[i].setFrustumType(FrustumType::ORTHOGRAPHIC);
+					cascadeFrustumComponents[i].setFrustumType(FrustumType::kOrthographic);
 				}
 
 				lc->setupDirectionalLightQueueElement(testedFrc, result.m_directionalLight, cascadeFrustumComponents);

+ 12 - 12
Tests/Math/Math.cpp

@@ -12,7 +12,7 @@ using namespace anki;
 template<typename Vec>
 void operatorsSame()
 {
-	const U size = Vec::COMPONENT_COUNT;
+	const U size = Vec::kComponentCount;
 	using T = typename Vec::Scalar;
 
 	Vec a, b;
@@ -63,7 +63,7 @@ void operatorsSame()
 template<typename Vec>
 void dot()
 {
-	const U size = Vec::COMPONENT_COUNT;
+	const U size = Vec::kComponentCount;
 	using T = typename Vec::Scalar;
 	T res = 0;
 	Vec vec;
@@ -84,7 +84,7 @@ template<typename Vec>
 void length()
 {
 	using T = typename Vec::Scalar;
-	U size = Vec::COMPONENT_COUNT;
+	U size = Vec::kComponentCount;
 	Vec vec;
 	T res = 0;
 
@@ -99,7 +99,7 @@ void length()
 	res = T(sqrt(F32(res)));
 	ANKI_TEST_EXPECT_EQ(vec.getLength(), res);
 
-	if(Vec::IS_INTEGER)
+	if(Vec::kIsInteger)
 	{
 		ANKI_TEST_EXPECT_EQ(vec.getNormalized(), vec / res);
 	}
@@ -117,7 +117,7 @@ void length()
 template<typename Vec>
 void comparision()
 {
-	U size = Vec::COMPONENT_COUNT;
+	U size = Vec::kComponentCount;
 	using Scalar = typename Vec::Scalar;
 	Vec a, a1, b;
 
@@ -178,7 +178,7 @@ ANKI_TEST(Math, Vec4)
 template<typename Mat>
 void matOperatorsSame()
 {
-	const U size = Mat::SIZE;
+	const U size = Mat::kSize;
 	using T = typename Mat::Scalar;
 
 	Mat a, b;
@@ -219,7 +219,7 @@ Mat getNonEmptyMat(typename Mat::Scalar offset = 0)
 {
 	Mat out;
 
-	for(U i = 0; i < Mat::SIZE; i++)
+	for(U i = 0; i < Mat::kSize; i++)
 	{
 		out[i] = typename Mat::Scalar(i) + offset;
 	}
@@ -253,9 +253,9 @@ void transpose()
 	Mat a = getNonEmptyMat<Mat>();
 	Mat b = a.getTransposed();
 
-	for(U j = 0; j < Mat::ROW_COUNT; j++)
+	for(U j = 0; j < Mat::kRowCount; j++)
 	{
-		for(U i = 0; i < Mat::COLUMN_COUNT; i++)
+		for(U i = 0; i < Mat::kColumnCount; i++)
 		{
 			ANKI_TEST_EXPECT_EQ(a(j, i), b(i, j));
 		}
@@ -279,17 +279,17 @@ void matVecMul()
 
 	Mat m = getNonEmptyMat<Mat>();
 	VecIn v;
-	for(U i = 0; i < VecIn::SIZE; i++)
+	for(U i = 0; i < VecIn::kSize; i++)
 	{
 		v[i] = i;
 	}
 
 	VecOut out = m * v;
 	VecOut out1;
-	for(U j = 0; j < Mat::ROW_COUNT; j++)
+	for(U j = 0; j < Mat::kRowCount; j++)
 	{
 		T sum = 0;
-		for(U i = 0; i < Mat::COLUMN_COUNT; i++)
+		for(U i = 0; i < Mat::kColumnCount; i++)
 		{
 			sum += m(j, i) * v[j];
 		}