Path Tracer
|
#include <SGSpatialSort.h>
Classes | |
struct | Entry |
Public Member Functions | |
SGSpatialSort (const std::vector< aiVector3D > &vPositions) | |
void | Add (const aiVector3D &vPosition, unsigned int index, unsigned int smoothingGroup) |
void | Prepare () |
~SGSpatialSort () | |
void | FindPositions (const aiVector3D &pPosition, uint32_t pSG, float pRadius, std::vector< unsigned int > &poResults, bool exactMatch=false) const |
Protected Attributes | |
aiVector3D | mPlaneNormal |
std::vector< Entry > | mPositions |
Specialized version of SpatialSort to support smoothing groups This is used in by the 3DS, ASE and LWO loaders. 3DS and ASE share their normal computation code in SmoothingGroups.inl, the LWO loader has its own implementation to handle all details of its file format correctly.
|
explicit |
Construction from a given face array, handling smoothing groups properly
Assimp::SGSpatialSort::~SGSpatialSort | ( | ) |
Destructor
void Assimp::SGSpatialSort::Add | ( | const aiVector3D & | vPosition, |
unsigned int | index, | ||
unsigned int | smoothingGroup | ||
) |
Add a vertex to the spatial sort
vPosition | Vertex position to be added |
index | Index of the vrtex |
smoothingGroup | SmoothingGroup for this vertex |
void Assimp::SGSpatialSort::FindPositions | ( | const aiVector3D & | pPosition, |
uint32_t | pSG, | ||
float | pRadius, | ||
std::vector< unsigned int > & | poResults, | ||
bool | exactMatch = false |
||
) | const |
Returns an iterator for all positions close to the given position.
pPosition | The position to look for vertices. |
pSG | Only included vertices with at least one shared smooth group |
pRadius | Maximal distance from the position a vertex may have to be counted in. |
poResults | The container to store the indices of the found positions. Will be emptied by the call so it may contain anything. |
exactMatch | Specifies whether smoothing groups are bit masks (false) or integral values (true). In the latter case, a vertex cannot belong to more than one smoothing group. |
void Assimp::SGSpatialSort::Prepare | ( | ) |
Prepare the spatial sorter for use. This step runs in O(logn)
|
protected |
Normal of the sorting plane, normalized. The center is always at (0, 0, 0)