Ajout de Jolt Physics + 1ere version des factory entitecomposants - camera, transform, rigidbody, collider, renderer

This commit is contained in:
Tom Ray
2026-03-22 00:28:03 +01:00
parent 6695d46bcd
commit 48348936a8
1147 changed files with 214331 additions and 353 deletions

View File

@@ -0,0 +1,51 @@
// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
// SPDX-FileCopyrightText: 2024 Jorrit Rouwe
// SPDX-License-Identifier: MIT
#include "UnitTestFramework.h"
#include <Jolt/Core/HashCombine.h>
TEST_SUITE("HashCombineTest")
{
TEST_CASE("TestHashBytes")
{
CHECK(HashBytes("This is a test", 14) == 2733878766136413408UL);
}
TEST_CASE("TestHashString")
{
CHECK(HashString("This is a test") == 2733878766136413408UL);
}
TEST_CASE("TestHashStruct")
{
const char *char_test = "This is a test";
CHECK(Hash<const char *> { } (char_test) == 2733878766136413408UL);
std::string_view str_view_test = "This is a test";
CHECK(Hash<std::string_view> { } (str_view_test) == 2733878766136413408UL);
String str_test = "This is a test";
CHECK(Hash<String> { } (str_test) == 2733878766136413408UL);
}
TEST_CASE("TestHashCombine")
{
int val1 = 0;
uint64 val1_hash = Hash<int> { } (val1);
int val2 = 1;
uint64 val2_hash = Hash<int> { } (val2);
// Check non-commutative
uint64 seed1 = val1_hash;
HashCombine(seed1, val2);
uint64 seed2 = val2_hash;
HashCombine(seed2, val1);
CHECK(seed1 != seed2);
// Check that adding a 0 changes the hash
uint64 seed3 = val1_hash;
HashCombine(seed3, val1);
CHECK(seed3 != val1_hash);
}
}