feat: add line renderer / visualisations for box collidors as a test
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include <destrum/Components/Animator.h>
|
||||
#include <destrum/Components/Physics/Rigidbody.h>
|
||||
#include <destrum/Graphics/Material.h>
|
||||
#include <destrum/Graphics/Managers/LineRenderingManager.h>
|
||||
|
||||
namespace {
|
||||
class TestComponent final : public Component {
|
||||
@@ -189,6 +190,29 @@ namespace {
|
||||
"RigidBody legacy alias must not be registered");
|
||||
}
|
||||
|
||||
void testLineRenderingManager()
|
||||
{
|
||||
auto& lineManager = LineRenderingManager::GetInstance();
|
||||
lineManager.ClearLines();
|
||||
|
||||
lineManager.SubmitLine(
|
||||
glm::vec3{0.0f},
|
||||
glm::vec3{1.0f, 0.0f, 0.0f},
|
||||
glm::vec4{1.0f, 0.0f, 0.0f, 1.0f});
|
||||
lineManager.SubmitLine(Line{
|
||||
.start = glm::vec3{1.0f},
|
||||
.end = glm::vec3{2.0f},
|
||||
.color = glm::vec4{0.0f, 1.0f, 0.0f, 1.0f},
|
||||
});
|
||||
|
||||
check(lineManager.GetLines().size() == 2,
|
||||
"line rendering manager must retain submitted lines");
|
||||
|
||||
lineManager.ClearLines();
|
||||
check(lineManager.GetLines().empty(),
|
||||
"line rendering manager must clear transient lines");
|
||||
}
|
||||
|
||||
void testAssetPathValidation()
|
||||
{
|
||||
const auto root = std::filesystem::temp_directory_path() / "destrum_asset_test";
|
||||
@@ -469,6 +493,7 @@ int main()
|
||||
testEventRemoval();
|
||||
testComponentRemoval();
|
||||
testEngineComponentRegistration();
|
||||
testLineRenderingManager();
|
||||
testAssetPathValidation();
|
||||
testLegacySceneLoad();
|
||||
testSceneLoadRollback();
|
||||
|
||||
Reference in New Issue
Block a user