Just roughing physics

This commit is contained in:
2023-01-07 17:07:16 -08:00
parent 2592da24d9
commit 9505dd9f06
14 changed files with 151 additions and 0 deletions

View File

@ -0,0 +1,31 @@
// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "dawnlibs.hpp"
namespace Dawn {
struct Ray2D {
const glm::vec2 position;
const glm::vec2 direction;
/**
* Constructs a new Ray 2D.
*
* @param position Position of this ray in 2D space.
* @param direction Direction from the origin in 2D space of this ray.
*/
Ray2D(glm::vec2 position, glm::vec2 direction);
/**
* Checks whether one ray is intersecting with another ray.
*
* @param ray The ray to check if this ray is intersecting.
* @param out The point in space where the two rays intersect.
* @return True if they intersect, otherwise false.
*/
bool_t intersects(struct Ray2D ray, glm::vec2 *out);
};
}