Files
GP1-DirectX/project/src/HitTest.h
2024-12-25 03:14:05 +01:00

29 lines
548 B
C++

#ifndef GP1_DIRECTX_HITTEST_H
#define GP1_DIRECTX_HITTEST_H
#include <algorithm>
#include <optional>
#include "ColorRGB.h"
#include "Math/Vector3.h"
#include "Math/Vector2.h"
#include "Mesh.h"
using namespace dae;
struct Sample
{
Vector2 uv{};
Vector3 normal{};
Vector3 tangent{};
Vector3 viewDirection{};
float depth{};
Vector3 weight{};
Mesh* mesh{};
};
std::optional<Sample> TriangleHitTest(const Vector3& fragPos, const VertexOut& v0, const VertexOut& v1, const VertexOut& v2);
#endif //GP1_DIRECTX_HITTEST_H