6#include "Resources/Resources.h"
7#include "Services/PropertiesManager.h"
9#include "Foundation/Geometry/BoundingBox.hpp"
13namespace Cogs::Core::SparseOctree
45 uint32_t index = (uint32_t)-1;
46 uint32_t parent = (uint32_t)-1;
50 uint32_t startIndex = 0;
51 uint32_t vertexCount = (uint32_t)-1;
53 Geometry::BoundingBox box;
63 Geometry::BoundingBox bounds;
65 std::vector<EntityRef> entities;
77 uint32_t
part = (uint32_t)-1;
78 Cogs::Geometry::BoundingBox bbox;
85 Cogs::Geometry::BoundingBox bbox;
94 Geometry::BoundingBox
bbox;
101 uint32_t vertexCount = 0;
107 typedef size_t CellMapKey;
108 typedef size_t CellIndex;
113 glm::uvec3 dimensions;
117 CellMapKey cellMapKey(
const size_t i,
const size_t j,
const size_t k)
const {
118 assert(i < dimensions.x && j < dimensions.y && k < dimensions.z);
119 return ((k * dimensions.y) + j) * dimensions.x + i;
122 std::unordered_map<CellMapKey, CellIndex> cellMap;
125 std::vector<Cell> cellStore;
129 enum struct LevelReducer
131 RationalReducerVertexCount,
132 MeshOptimizerVertexCount,
133 MeshOptimizerSloppyVertexCount
146 std::string absolute;
147 std::string directory;
148 std::string layerDirectory;
149 std::string filesDirectory;
150 std::string assetFileNameStem;
151 std::string layerAndName;
152 std::string skipPattern;
156 LevelReducer levelReducer = LevelReducer::RationalReducerVertexCount;
158 bool discardOutliers =
false;
159 bool outputOutliers =
false;
186 int outlierMinVertexCount = 10'000;
187 float outlierMaxVolume = 1.0f;
188 float outlierMinVertexDensity = 10'000'000;
190 int dropReductionLevelThreshold = 4;
191 int dropReductionThreshold = 1000;
192 int minReductionThreshold = 500;
194 float edgeLengthWeight = 1.0f;
198 bool useMinBounds =
false;
199 bool useMaxBounds =
false;
201 bool isEmpty =
false;
203 bool useCompression =
false;
204 bool prettyPrint =
false;
205 int compressionLevel = 0;
229 std::string filter_rootIncludes;
230 std::string filter_rootPattern;
231 std::string filter_attributeName;
232 std::string filter_attributeValue;
233 std::vector<std::string> filter_excludeNodes;
242 uint32_t numLevels = 0;
243 float minCellSize = 1.0f;
248 std::vector<SceneInfo> scenes;
249 std::vector<LevelInput> inputs;
250 std::vector<Grid> grids;
253 void distributeGeometryWithIds(
Octree & octree,
PropertyStore& properties,
const size_t level);
255 uint32_t clipTriangle(
float* V_dst,
float *N_dst,
float *T_dst,
const float (&clipBox)[6],
const float *V_in,
const float * N_in,
const float *T_in);
256 uint32_t clipTriangle(
float* V_dst,
float *N_dst,
const float(&clipBox)[6],
const float *V_in,
const float * N_in);
A Context instance contains all the services, systems and runtime components needed to use Cogs.
std::vector< uint32_t > touches
Entity index of parts that touches the cell.
uint32_t sizeEstimate
Estimated filesize of cell geometry, used to determine if geometry of multiple cells should be packed...
std::vector< MeshRef > meshRefs
Meshes written to disc.
Geometry::BoundingBox bbox
Initially the full bounds of the cell, but shrinked to bounds of geometry after cell has been populat...
std::vector< MeshRec > meshRecs
Meshes not yet written to disc.
std::string fileName
File name of cogsbin file with processed geometry.
uint32_t part
Part index of this cell's geometry in cogsbin file with processed geometry, -1 means that the entire ...
std::string filter_rootEndsWith
Individual Task: filter settings - for compatibility.
bool embedMeshBounds
Add mesh bounds where appropriate.
bool colorizeLevels
Add material to output colorized dependent on lod level, intended as a debug tool.
std::string keepList
("rvm.tagSimplify.keepList")
bool statistics
Calculate statistics for resulting hierarchy.
std::vector< Parameterization > sources
int remeshVolumeBlur
("rvm.tessellate.remeshVolumeBlur") The number of blur iterations to run on the volumetric scalar fie...
float simplificationFactor
("rvm.tessellate.simplificationFactor") If greater than zero, simplify non-parametric shapes within s...
float remeshSimplification
("rvm.tessellate.remeshSimplification") The simplification tolerance to use after remesh surface extr...
float cullLeaf
("rvm.tessellate.cullLeafThreshold") Cull leaves in the hierarchy where the combined geometry is smal...
float cullGeometry
("rvm.tessellate.cullGeometryThreshold") Cull geometries smaller than this value. Value is relative t...
float tolerance
("rvm.tessellate.tolerance") Tolerance used by rvmparser tessellator, in world space units.
bool isLoaded
Set to true when parameterization has been loaded.
float cullDiameter
("rvm.tessellate.cullDiameter") Cull round shapes with a diameter less than this value....
int simplificationMode
("rvm.tessellate.simplificationMode") Specifies which algorithm to use when simplifying.
float featureAngle
("rvm.tessellate.featureAngle") Minimum angle in radians between normals of two abutting triangles be...
int remeshTriSoupBlur
("rvm.tessellate.remeshTriSoupBlur") The number of blur iterations on 2D rasterized triangle soup bef...
float remeshGridSpacing
("rvm.tessellate.remeshGridSpacing") Specifies the remesh grid spacing relative to tolerance.
ModelHandle model
The imported model.
float remesh
("rvm.tessellate.remesh") Shapes with bbox cross-section diameter less than this value gets remeshed....
uint32_t geometries
The number of non-culled geometries in the scene.
float maxGeometrySize
Largest bounding box side length of an object in the scene.