71 lines
1.4 KiB
C++
71 lines
1.4 KiB
C++
// Copyright (c) 2023 Dominic Masters
|
|
//
|
|
// This software is released under the MIT License.
|
|
// https://opensource.org/licenses/MIT
|
|
|
|
#pragma once
|
|
#include "dawnlibs.hpp"
|
|
#include "assert/assert.hpp"
|
|
#include "PhysicsTriangle.hpp"
|
|
#include "PhysicsSphere.hpp"
|
|
#include "PhysicsCapsule.hpp"
|
|
#include "AABB3D.hpp"
|
|
|
|
namespace Dawn {
|
|
struct Ray3D {
|
|
glm::vec3 origin;
|
|
glm::vec3 direction;
|
|
};
|
|
|
|
bool_t raytestSphere(
|
|
struct Ray3D ray,
|
|
struct PhysicsSphere sphere,
|
|
glm::vec3 *hit,
|
|
glm::vec3 *normal,
|
|
float_t *distance
|
|
);
|
|
|
|
bool_t raytestTriangle(
|
|
struct Ray3D ray,
|
|
struct PhysicsTriangle triangle,
|
|
glm::vec3 *hitPoint,
|
|
glm::vec3 *hitNormal,
|
|
float_t *hitDistance
|
|
);
|
|
|
|
bool_t raytestAABB(
|
|
struct Ray3D ray,
|
|
struct AABB3D box,
|
|
glm::vec3 *point,
|
|
glm::vec3 *normal,
|
|
float_t *distance
|
|
);
|
|
|
|
bool_t raytestCube(
|
|
struct Ray3D ray,
|
|
struct AABB3D box,
|
|
glm::mat4 transform,
|
|
glm::vec3 *point,
|
|
glm::vec3 *normal,
|
|
float_t *distance
|
|
);
|
|
|
|
bool_t raytestQuad(
|
|
struct Ray3D ray,
|
|
glm::vec2 min,
|
|
glm::vec2 max,
|
|
glm::mat4 transform,
|
|
glm::vec3 *point,
|
|
glm::vec3 *normal,
|
|
float_t *distance
|
|
);
|
|
|
|
bool_t raytestCapsule(
|
|
struct Ray3D ray,
|
|
struct PhysicsCapsule capsule,
|
|
glm::vec3 *point,
|
|
glm::vec3 *normal,
|
|
float_t *distance
|
|
);
|
|
}
|