Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmake/FetchDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ set(PROFILER_IN_DEBUG_AND_RELEASE OFF CACHE BOOL "" FORCE)
set(ENABLE_INSTALL OFF CACHE BOOL "" FORCE)
FetchContent_Declare(JoltPhysics
GIT_REPOSITORY https://github.com/jrouwe/JoltPhysics
GIT_TAG v5.3.0
GIT_TAG 0ec24eb93ad8ebe01f7f095b544af8e122713123 # No release available yet with VS 2026 fixes yet
GIT_SHALLOW TRUE
SOURCE_SUBDIR "Build"
)
Expand Down Expand Up @@ -192,6 +192,7 @@ if(NC_BUILD_NCCONVERT)
set(ASSIMP_BUILD_FBX_IMPORTER ON CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_OBJ_IMPORTER ON CACHE BOOL "" FORCE)
set(ASSIMP_INSTALL_PDB OFF CACHE BOOL "" FORCE)
set(ASSIMP_BUILD_USE_CCACHE OFF CACHE BOOL "" FORCE)

FetchContent_Declare(assimp
GIT_REPOSITORY https://github.com/assimp/assimp
Expand Down
27 changes: 14 additions & 13 deletions test/ncengine/physics/jolt/SupportFunctions_unit_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,17 +279,18 @@ TEST_F(SupportFunctionsTest, GetDistanceFromOrigin_CompoundShape_translatedRotat
rotation
};

EXPECT_FLOAT_EQ(2.0f, nc::GetWorldSupport(shape, nc::Vector3::Right()).x);
EXPECT_FLOAT_EQ(0.0f, nc::GetWorldSupport(shape, nc::Vector3::Left()).x);
EXPECT_FLOAT_EQ(2.5f, nc::GetWorldSupport(shape, nc::Vector3::Up()).y);
EXPECT_FLOAT_EQ(1.5f, nc::GetWorldSupport(shape, nc::Vector3::Down()).y);
EXPECT_FLOAT_EQ(4.5f, nc::GetWorldSupport(shape, nc::Vector3::Front()).z);
EXPECT_FLOAT_EQ(1.5f, nc::GetWorldSupport(shape, nc::Vector3::Back()).z);

EXPECT_FLOAT_EQ(1.0f, nc::GetHalfExtent(shape, nc::Vector3::Right()));
EXPECT_FLOAT_EQ(1.0f, nc::GetHalfExtent(shape, nc::Vector3::Left()));
EXPECT_FLOAT_EQ(0.5f, nc::GetHalfExtent(shape, nc::Vector3::Up()));
EXPECT_FLOAT_EQ(0.5f, nc::GetHalfExtent(shape, nc::Vector3::Down()));
EXPECT_FLOAT_EQ(1.5f, nc::GetHalfExtent(shape, nc::Vector3::Front()));
EXPECT_FLOAT_EQ(1.5f, nc::GetHalfExtent(shape, nc::Vector3::Back()));
constexpr auto epsilon = 1e-6f; // Account for floating-point error from quaternion calculations
EXPECT_NEAR(2.0f, nc::GetWorldSupport(shape, nc::Vector3::Right()).x, epsilon);
EXPECT_NEAR(0.0f, nc::GetWorldSupport(shape, nc::Vector3::Left()).x, epsilon);
EXPECT_NEAR(2.5f, nc::GetWorldSupport(shape, nc::Vector3::Up()).y, epsilon);
EXPECT_NEAR(1.5f, nc::GetWorldSupport(shape, nc::Vector3::Down()).y, epsilon);
EXPECT_NEAR(4.5f, nc::GetWorldSupport(shape, nc::Vector3::Front()).z, epsilon);
EXPECT_NEAR(1.5f, nc::GetWorldSupport(shape, nc::Vector3::Back()).z, epsilon);

EXPECT_NEAR(1.0f, nc::GetHalfExtent(shape, nc::Vector3::Right()), epsilon);
EXPECT_NEAR(1.0f, nc::GetHalfExtent(shape, nc::Vector3::Left()), epsilon);
EXPECT_NEAR(0.5f, nc::GetHalfExtent(shape, nc::Vector3::Up()), epsilon);
EXPECT_NEAR(0.5f, nc::GetHalfExtent(shape, nc::Vector3::Down()), epsilon);
EXPECT_NEAR(1.5f, nc::GetHalfExtent(shape, nc::Vector3::Front()), epsilon);
EXPECT_NEAR(1.5f, nc::GetHalfExtent(shape, nc::Vector3::Back()), epsilon);
}