NAP
Public Types | Public Member Functions | List of all members
ZComparer Class Reference

#include <depthsorter.h>

Public Types

enum  EMode { FrontToBack = 0, BackToFront }
 

Public Member Functions

 ZComparer (EMode mode)
 
bool operator() (const nap::ComponentInstance *objectA, const nap::ComponentInstance *objectB)
 

Description

Helper class that can sort a list of components back to front or front to back. The z-comparer sorts objects by the world space z component and ignores the view space transformation.

Member Enumeration Documentation

◆ EMode

enum EMode
strong
Enumerator
FrontToBack 

Sort front to back.

BackToFront 

Sort back to front.

Constructor & Destructor Documentation

◆ ZComparer()

ZComparer ( EMode  mode)

Default constructor

Parameters
modethe sort mode to use

Member Function Documentation

◆ operator()()

bool operator() ( const nap::ComponentInstance objectA,
const nap::ComponentInstance objectB 
)

Compares location of objectA to objectB based on the current sort mode

Parameters
objectAthe first object to compare against
objectBthe second object to compare against
Returns
if objectA is closer or further away than objectB based on the current sort mode