Saga
Saga Game Engine
Loading...
Searching...
No Matches
ellipsoid.h
Go to the documentation of this file.
1#pragma once
2
3#include <optional>
4#include <glm/vec3.hpp>
5
6namespace Saga {
7 namespace Geometry {
8
22 std::optional<float> rayEllipsoidIntersection(const glm::vec3& rayOrigin, const glm::vec3& rayDirection, const glm::vec3& position, const glm::vec3& radius);
23
35 std::optional<float> rayUnitSphereAtOriginIntersection(const glm::vec3& origin, const glm::vec3& rayDirection);
36
50 std::optional<float> unitSphereTriangleCollision(const glm::vec3& pos, const glm::vec3& dir, const glm::vec3& a, const glm::vec3& b, const glm::vec3& c);
51
63 std::optional<float> movingEllipsoidEllipsoidIntersection(
64 const glm::vec3 &ellipsoidPos0, const glm::vec3 &ellipsoidDir0, const glm::vec3 &ellipsoidRadius0,
65 const glm::vec3 &ellipsoidPos1, const glm::vec3 &ellipsoidRadius1);
66
82 std::optional<float> ellipsoidTriangleCollision(const glm::vec3& ellipsoidPos, const glm::vec3& ellipsoidDir,
83 const glm::vec3& ellipsoidRadius, const glm::vec3& a, const glm::vec3& b, const glm::vec3& c);
84
99 std::optional<float> unitSphereEdgeCollision(const glm::vec3& pos, const glm::vec3& dir,
100 const glm::vec3& c, const glm::vec3& d);
101 }
102}
std::optional< float > unitSphereEdgeCollision(const glm::vec3 &pos, const glm::vec3 &dir, const glm::vec3 &c, const glm::vec3 &d)
Find collision between a moving unit sphere and an edge (line segment) in 3D.
Definition: ellipsoid.cpp:11
std::optional< float > ellipsoidTriangleCollision(const glm::vec3 &ellipsoidPos, const glm::vec3 &ellipsoidDir, const glm::vec3 &ellipsoidRadius, const glm::vec3 &a, const glm::vec3 &b, const glm::vec3 &c)
Find the intersection time t between a moving ellipsoid and a triangle.
Definition: ellipsoid.cpp:105
std::optional< float > rayEllipsoidIntersection(const glm::vec3 &rayOrigin, const glm::vec3 &rayDirection, const glm::vec3 &position, const glm::vec3 &radius)
Find the intersection time t between a ray and an axis-aligned ellipsoid.
Definition: ellipsoid.cpp:40
std::optional< float > rayUnitSphereAtOriginIntersection(const glm::vec3 &origin, const glm::vec3 &rayDirection)
Find the intersection time t between a unit sphere at the origin and a ray.
Definition: ellipsoid.cpp:33
std::optional< float > movingEllipsoidEllipsoidIntersection(const glm::vec3 &ellipsoidPos0, const glm::vec3 &ellipsoidDir0, const glm::vec3 &ellipsoidRadius0, const glm::vec3 &ellipsoidPos1, const glm::vec3 &ellipsoidRadius1)
Find the intersection between two moving axis-aligned ellipsoids.
Definition: ellipsoid.cpp:96
std::optional< float > unitSphereTriangleCollision(const glm::vec3 &pos, const glm::vec3 &dir, const glm::vec3 &a, const glm::vec3 &b, const glm::vec3 &c)
Find the intersection time t between a moving unit sphere with a triangle.
Definition: ellipsoid.cpp:46
Definition: app.cpp:8