Assimp v5.2.2 (January 2022)
The Asset-Importer-Lib API documentation.
Assimp::SGSpatialSort Class Reference

Specialized version of SpatialSort to support smoothing groups This is used in by the 3DS, ASE and LWO loaders. More...

#include <SGSpatialSort.h>

Classes

struct  Entry
 An entry in a spatially sorted position array. More...
 

Public Member Functions

void Add (const aiVector3D &vPosition, unsigned int index, unsigned int smoothingGroup)
 Add a vertex to the spatial sort. More...
 
void 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. More...
 
void Prepare ()
 Prepare the spatial sorter for use. More...
 
 SGSpatialSort ()
 
 SGSpatialSort (const std::vector< aiVector3D > &vPositions)
 Construction from a given face array, handling smoothing groups properly. More...
 
 ~SGSpatialSort ()
 Destructor. More...
 

Protected Attributes

aiVector3D mPlaneNormal
 Normal of the sorting plane, normalized. More...
 
std::vector< EntrymPositions
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SGSpatialSort() [1/2]

Assimp::SGSpatialSort::SGSpatialSort ( )

◆ SGSpatialSort() [2/2]

Assimp::SGSpatialSort::SGSpatialSort ( const std::vector< aiVector3D > &  vPositions)
explicit

Construction from a given face array, handling smoothing groups properly.

◆ ~SGSpatialSort()

Assimp::SGSpatialSort::~SGSpatialSort ( )

Destructor.

Member Function Documentation

◆ Add()

void Assimp::SGSpatialSort::Add ( const aiVector3D vPosition,
unsigned int  index,
unsigned int  smoothingGroup 
)

Add a vertex to the spatial sort.

Parameters
vPositionVertex position to be added
indexIndex of the vrtex
smoothingGroupSmoothingGroup for this vertex

◆ FindPositions()

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.

Parameters
pPositionThe position to look for vertices.
pSGOnly included vertices with at least one shared smooth group
pRadiusMaximal distance from the position a vertex may have to be counted in.
poResultsThe container to store the indices of the found positions. Will be emptied by the call so it may contain anything.
exactMatchSpecifies 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.
Returns
An iterator to iterate over all vertices in the given area.

◆ Prepare()

void Assimp::SGSpatialSort::Prepare ( )

Prepare the spatial sorter for use.

This step runs in O(logn)

Member Data Documentation

◆ mPlaneNormal

aiVector3D Assimp::SGSpatialSort::mPlaneNormal
protected

Normal of the sorting plane, normalized.

The center is always at (0, 0, 0)

◆ mPositions

std::vector<Entry> Assimp::SGSpatialSort::mPositions
protected

The documentation for this class was generated from the following file: