29 lines
548 B
C++
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
|