jak-project/goalc/build_level/collide_bvh.h
water111 da4ec008c3
Add a gltf level exporter (#1719)
* Add a gltf level exporter

* more fixes

* disable by default

* compile fixes for windows

* improve collide packer

* bug fix

* clang format

* fix texture bug
2022-08-05 12:25:35 -04:00

41 lines
901 B
C++

#pragma once
#include <vector>
#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 {
std::vector<DrawNode> draw_node_children;
std::vector<int> frag_children;
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 {
// std::vector<DrawableInlineArrayNode> node_arrays;
DrawNode fake_root_node; // the children of this are the ones that go in the top level.
DrawableInlineArrayCollideFrag frags;
};
CollideTree construct_collide_bvh(const std::vector<CollideFace>& tris);
} // namespace collide