mirror of
https://github.com/orange-cpp/omath.git
synced 2026-04-20 22:23:26 +00:00
renamed headers
This commit is contained in:
38
include/omath/collision/line_tracer.hpp
Normal file
38
include/omath/collision/line_tracer.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// Created by Orange on 11/13/2024.
|
||||
//
|
||||
#pragma once
|
||||
|
||||
#include "omath/Vector3.hpp"
|
||||
#include "omath/Triangle.hpp"
|
||||
|
||||
namespace omath::collision
|
||||
{
|
||||
class Ray
|
||||
{
|
||||
public:
|
||||
Vector3<float> start;
|
||||
Vector3<float> end;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3<float> DirectionVector() const;
|
||||
|
||||
[[nodiscard]]
|
||||
Vector3<float> DirectionVectorNormalized() const;
|
||||
};
|
||||
class LineTracer
|
||||
{
|
||||
public:
|
||||
LineTracer() = delete;
|
||||
|
||||
|
||||
[[nodiscard]]
|
||||
static bool CanTraceLine(const Ray& ray, const Triangle<Vector3<float>>& triangle);
|
||||
|
||||
|
||||
// Realization of Möller–Trumbore intersection algorithm
|
||||
// https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm
|
||||
[[nodiscard]]
|
||||
static Vector3<float> GetRayHitPoint(const Ray& ray, const Triangle<Vector3<float>>& triangle);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user