1
0
forked from josh/j3ml

Implement more methods

This commit is contained in:
2024-01-30 21:35:55 -05:00
parent 0c20e9bb21
commit 132b8a0a66
7 changed files with 55 additions and 15 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include <J3ML/Geometry.h>
#include <J3ML/Geometry/AABB.h>
#include <J3ML/Geometry/LineSegment.h>
#include <J3ML/Geometry/Polyhedron.h>

View File

@@ -6,10 +6,21 @@
#include "AABB2D.h"
namespace Geometry {
using LinearAlgebra::Vector2;
template<typename T>
class QuadTree {
/// A fixed split rule for all QuadTrees: A QuadTree leaf node is only ever split if the leaf contains at least this many objects.
/// Leaves containing fewer than this many objects are always kept as leaves until the object count is exceeded.
constexpr static const int minQuadTreeNodeObjectCount = 16;
/// A fixed split limit rule for all QuadTrees: If the QuadTree node side length is smaller than this, the node will
/// never be split again into smaller subnodes. This provides a hard limit safety net for infinite/extra long recursion
/// in case multiple identical overlapping objects are placed into the tree.
constexpr static const float minQuadTreeQuadrantSize = 0.05f;
public:
struct Node {
Node *parent;

View File

@@ -8,6 +8,7 @@
namespace Geometry
{
using LinearAlgebra::Vector3;
class Ray
{
Vector3 Origin;