17template <
class T>
using Deque = std::deque<T, STLAllocator<T>>;
20template <
class TriangleCodec,
class NodeCodec>
146 outError =
"Internal Error: Array reallocated, memory corruption!";
151 if (
node_list.back().mNode->HasChildren())
166 if (
node_data->mParentChildNodeStart !=
nullptr)
182 if (!
node_ctx.NodeFinalize(
n.mNode,
n.mNodeStart,
n.mNumChildren,
n.mChildNodeStart,
n.mChildTrianglesStart, mTree,
outError))
191 outError =
"Internal Error: Not enough memory reserved for nodes!";
196 outError =
"Internal Error: Not enough memory reserved for triangles!";
205 mTree.shrink_to_fit();
std::deque< T, STLAllocator< T > > Deque
Definition AABBTreeToBuffer.h:17
#define JPH_SUPPRESS_WARNINGS_STD_BEGIN
Definition Core.h:372
#define JPH_SUPPRESS_WARNINGS_STD_END
Definition Core.h:384
unsigned int uint
Definition Core.h:439
#define JPH_NAMESPACE_END
Definition Core.h:367
#define JPH_NAMESPACE_BEGIN
Definition Core.h:361
Array< Float3 > VertexList
Definition Float3.h:43
#define JPH_ASSERT(...)
Definition IssueReporting.h:33
AllocateFunction Allocate
Definition Memory.cpp:59
std::vector< T, STLAllocator< T > > Array
Definition STLAllocator.h:81
A node in the tree, contains the AABox for the tree and any child nodes or triangles.
Definition AABBTreeBuilder.h:40
Conversion algorithm that converts an AABB tree to an optimized binary buffer.
Definition AABBTreeToBuffer.h:22
bool Convert(const VertexList &inVertices, const AABBTreeBuilder::Node *inRoot, const char *&outError)
Convert AABB tree. Returns false if failed.
Definition AABBTreeToBuffer.h:40
static const int TriangleHeaderSize
Size in bytes of the header for the triangles.
Definition AABBTreeToBuffer.h:37
typename TriangleCodec::TriangleHeader TriangleHeader
Header for the triangles.
Definition AABBTreeToBuffer.h:34
const ByteBuffer & GetBuffer() const
Get resulting data.
Definition AABBTreeToBuffer.h:211
typename NodeCodec::Header NodeHeader
Header for the tree.
Definition AABBTreeToBuffer.h:25
static const int HeaderSize
Size in bytes of the header of the tree.
Definition AABBTreeToBuffer.h:28
static const int NumChildrenPerNode
Maximum number of children per node in the tree.
Definition AABBTreeToBuffer.h:31
const TriangleHeader * GetTriangleHeader() const
Get header for triangles.
Definition AABBTreeToBuffer.h:229
const NodeHeader * GetNodeHeader() const
Get header for tree.
Definition AABBTreeToBuffer.h:223
ByteBuffer & GetBuffer()
Get resulting data.
Definition AABBTreeToBuffer.h:217
const void * GetRoot() const
Get root of resulting tree.
Definition AABBTreeToBuffer.h:235
Axis aligned box.
Definition AABox.h:16
bool Contains(const AABox &inOther) const
Check if this box contains another box.
Definition AABox.h:137
Simple byte buffer, aligned to a cache line.
Definition ByteBuffer.h:16
Type * Allocate(size_t inSize=1)
Allocate block of data of inSize elements and return the pointer.
Definition ByteBuffer.h:33
const Type * Get(size_t inPosition) const
Get object at inPosition (an offset in bytes)
Definition ByteBuffer.h:61
This class encodes and compresses quad tree nodes.
Definition NodeCodecQuadTreeHalfFloat.h:62
static constexpr int HeaderSize
Size of the header (an empty struct is always > 0 bytes so this needs a separate variable)
Definition NodeCodecQuadTreeHalfFloat.h:29
static constexpr int NumChildrenPerNode
Number of child nodes of this node.
Definition NodeCodecQuadTreeHalfFloat.h:18
This class is used to encode and compress triangle data into a byte buffer.
Definition TriangleCodecIndexed8BitPackSOA4Flags.h:123
static constexpr int TriangleHeaderSize
Size of the header (an empty struct is always > 0 bytes so this needs a separate variable)
Definition TriangleCodecIndexed8BitPackSOA4Flags.h:34
static JPH_INLINE Vec3 sZero()
Vector with all zeros.
Definition Vec3.inl:107