Added proper debug line renderer!

This commit is contained in:
Antoine Pilote
2024-08-09 23:36:02 -04:00
parent 275aad82b9
commit f3b9b328b1
12 changed files with 234 additions and 7 deletions

View File

@@ -1,5 +1,8 @@
#include "EngineNetAPI.h"
#include <Coral/String.hpp>
#include <src/Core/Maths.h>
#include <Engine.h>
#include "src/Rendering/SceneRenderer.h"
namespace Nuake {
@@ -8,9 +11,19 @@ namespace Nuake {
Logger::Log(string, ".net", VERBOSE);
}
void DrawLine(float startX, float startY, float startZ, float endX, float endY, float endZ, float r, float g, float b, float a, float life)
{
const Vector3 start = { startX, startY, startZ };
const Vector3 end = { endX, endY, endZ };
const Vector4 color = { r, g, b, a };
Engine::GetCurrentScene()->m_SceneRenderer->DrawDebugLine(start, end, color, life);
}
void EngineNetAPI::RegisterMethods()
{
RegisterMethod("Engine.LoggerLogIcall", (void*)(&Log));
RegisterMethod("Debug.DrawLineIcall", &DrawLine);
}
}