Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
TriangleSplitterMorton.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2021 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
8
10
13{
14public:
16 TriangleSplitterMorton(const VertexList &inVertices, const IndexedTriangleList &inTriangles);
17
18 // See TriangleSplitter::GetStats
19 virtual void GetStats(Stats &outStats) const override
20 {
21 outStats.mSplitterName = "TriangleSplitterMorton";
22 }
23
24 // See TriangleSplitter::Split
25 virtual bool Split(const Range &inTriangles, Range &outLeft, Range &outRight) override;
26
27private:
28 // Precalculated Morton codes
29 Array<uint32> mMortonCodes;
30};
31
#define JPH_EXPORT
Definition: Core.h:227
#define JPH_NAMESPACE_END
Definition: Core.h:367
#define JPH_NAMESPACE_BEGIN
Definition: Core.h:361
Array< Float3 > VertexList
Definition: Float3.h:43
Array< IndexedTriangle > IndexedTriangleList
Definition: IndexedTriangle.h:109
std::vector< T, STLAllocator< T > > Array
Definition: STLAllocator.h:81
A class that splits a triangle list into two parts for building a tree.
Definition: TriangleSplitter.h:14
virtual bool Split(const Range &inTriangles, Range &outLeft, Range &outRight)=0
Splitter using Morton codes, see: http://devblogs.nvidia.com/parallelforall/thinking-parallel-part-ii...
Definition: TriangleSplitterMorton.h:13
virtual void GetStats(Stats &outStats) const override
Get stats of splitter.
Definition: TriangleSplitterMorton.h:19
Definition: TriangleSplitter.h:23
const char * mSplitterName
Definition: TriangleSplitter.h:24