Google testing works now
This commit is contained in:
@@ -175,8 +175,8 @@ namespace Phanes::Core::Math::Detail
|
||||
|
||||
static constexpr bool map(const Phanes::Core::Math::TVector2<T, S>& v1, const Phanes::Core::Math::TVector2<T, S>& v2)
|
||||
{
|
||||
return (Phanes::Core::Math::Abs(v1.x - v2.x) < P_FLT_INAC &&
|
||||
Phanes::Core::Math::Abs(v1.y - v2.y) < P_FLT_INAC);
|
||||
return (Phanes::Core::Math::Abs(v1.x - v2.x) <= P_FLT_INAC &&
|
||||
Phanes::Core::Math::Abs(v1.y - v2.y) <= P_FLT_INAC);
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -707,7 +707,7 @@ namespace Phanes::Core::Math {
|
||||
*/
|
||||
|
||||
template<RealType T, bool S>
|
||||
TVector3<T, S>& ClampToCubeV(TVector3<T, S> v1, T cubeRadius);
|
||||
TVector3<T, S>& ClampToCubeV(TVector3<T, S>& v1, T cubeRadius);
|
||||
|
||||
/**
|
||||
* Rotates vector around axis
|
||||
|
@@ -292,7 +292,7 @@ namespace Phanes::Core::Math
|
||||
}
|
||||
|
||||
template<RealType T, bool S>
|
||||
TVector3<T, S>& ClampToCubeV(TVector3<T, S> v1, T cubeRadius)
|
||||
TVector3<T, S>& ClampToCubeV(TVector3<T, S>& v1, T cubeRadius)
|
||||
{
|
||||
Detail::compute_vec3_clamp<T, S>::map(v1, v1, cubeRadius);
|
||||
return v1;
|
||||
|
21
Engine/Source/Runtime/Core/Tests/Math/MathTestFPU/main.cpp
Normal file
21
Engine/Source/Runtime/Core/Tests/Math/MathTestFPU/main.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <iostream>
|
||||
#include "Core/Math/Include.h"
|
||||
|
||||
namespace PMath = Phanes::Core::Math;
|
||||
|
||||
int main()
|
||||
{
|
||||
PMath::Matrix4 m0 = PMath::Matrix4(1.0f, 5.0f, 3.0f, 4.0f,
|
||||
2.0f, 6.0f, 4.0f, 1.0f,
|
||||
2.0f, -3.0f, 5.0f, 3.0f,
|
||||
8.0f, -4.0f, 6.0f, -2.0f);
|
||||
|
||||
|
||||
PMath::Matrix4 m2;
|
||||
|
||||
std::cout << std::to_string(PMath::InverseV<float, false>(m0)) << std::endl;
|
||||
|
||||
std::cout << PMath::ToString(m0) << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
@@ -0,0 +1,2 @@
|
||||
#include "pch.h"
|
||||
|
7
Engine/Source/Runtime/Core/Tests/Math/MathTestFPU/pch.h
Normal file
7
Engine/Source/Runtime/Core/Tests/Math/MathTestFPU/pch.h
Normal file
@@ -0,0 +1,7 @@
|
||||
//
|
||||
// pch.h
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "googletest/googletest/include/gtest/gtest.h"
|
@@ -0,0 +1,39 @@
|
||||
project "gtest"
|
||||
language "C++"
|
||||
kind "StaticLib"
|
||||
third_party_boilerplate()
|
||||
|
||||
includedirs {
|
||||
|
||||
PhanesThirdParty .. "/googletest/googletest/include",
|
||||
PhanesThirdParty .. "/googletest/googletest/include/gtest",
|
||||
PhanesThirdParty .. "/googletest/googletest"
|
||||
|
||||
}
|
||||
files {
|
||||
PhanesThirdParty .. "/googletest/googletest/src/**.cc",
|
||||
PhanesThirdParty .. "/googletest/googletest/include/gtest/**.h"
|
||||
}
|
||||
|
||||
project "MathTestFPU"
|
||||
kind "ConsoleApp"
|
||||
boilerplate()
|
||||
|
||||
files {
|
||||
PhanesRuntime .. "/Core/Tests/Math/MathTestFPU/test.cpp"
|
||||
}
|
||||
|
||||
buildoptions {"-Wno-unused-variable", "-w", "-fpermissive"}
|
||||
|
||||
pchheader (PhanesRuntime .. "/Core/Tests/Math/MathTestFPU/pch.h")
|
||||
pchsource (PhanesRuntime .. "/Core/Tests/Math/MathTestFPU/pch.cpp")
|
||||
|
||||
links { "gtest" }
|
||||
dependson { "gtest" }
|
||||
|
||||
includedirs {
|
||||
PhanesRuntime .. "/Core/Tests/Math/MathTestFPU",
|
||||
PhanesThirdParty .. "/googletest/googletest/include",
|
||||
PhanesThirdParty,
|
||||
PhanesRuntime
|
||||
}
|
1280
Engine/Source/Runtime/Core/Tests/Math/MathTestFPU/test.cpp
Normal file
1280
Engine/Source/Runtime/Core/Tests/Math/MathTestFPU/test.cpp
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user