2022-06-19 20:44:07 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
2022-06-22 23:37:46 -04:00
|
|
|
|
2022-06-19 20:44:07 -04:00
|
|
|
#include "goalc/build_level/collide_common.h"
|
|
|
|
|
|
|
|
// requirements:
|
|
|
|
// max depth of 3 (maybe?)
|
|
|
|
// max face per frag = 90
|
|
|
|
// max vert per frag = 110
|
|
|
|
// branching factor of 8 everywhere.
|
|
|
|
namespace collide {
|
|
|
|
|
|
|
|
struct DrawNode {
|
2022-08-05 12:25:35 -04:00
|
|
|
std::vector<DrawNode> draw_node_children;
|
|
|
|
std::vector<int> frag_children;
|
2022-06-19 20:44:07 -04:00
|
|
|
math::Vector4f bsphere;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CollideFrag {
|
|
|
|
math::Vector4f bsphere;
|
|
|
|
std::vector<CollideFace> faces;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DrawableInlineArrayNode {
|
|
|
|
std::vector<DrawNode> nodes;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DrawableInlineArrayCollideFrag {
|
|
|
|
std::vector<CollideFrag> frags;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CollideTree {
|
2022-08-05 12:25:35 -04:00
|
|
|
// std::vector<DrawableInlineArrayNode> node_arrays;
|
|
|
|
DrawNode fake_root_node; // the children of this are the ones that go in the top level.
|
2022-06-19 20:44:07 -04:00
|
|
|
DrawableInlineArrayCollideFrag frags;
|
|
|
|
};
|
|
|
|
|
|
|
|
CollideTree construct_collide_bvh(const std::vector<CollideFace>& tris);
|
|
|
|
} // namespace collide
|