NAP
Public Member Functions | List of all members
TriangleIterator Class Referencefinal

#include <triangleiterator.h>

Public Member Functions

 TriangleIterator (const MeshInstance &meshInstance)
 
 ~TriangleIterator ()
 
bool isDone () const
 
const Triangle next ()
 

Description

While the various ShapeTriangleIterators can be used to iterate through the triangles of a specific MeshShape, quite often you want to iterate through all the triangles in all MeshShapes in a particular MeshInstance. TriangleIterator provides this functionality.

This iterator will internally use the right type of ShapeTriangleIterator for a specific MeshShape and retrieve triangles through that. Note that only triangles are returned; MeshShapes of a different type will be skipped.

Constructor & Destructor Documentation

◆ TriangleIterator()

TriangleIterator ( const MeshInstance meshInstance)

◆ ~TriangleIterator()

Member Function Documentation

◆ isDone()

bool isDone ( ) const

Checks whether this iterator is done iterating. next() should only be called while this function returns false.

Returns
true if done iterating, false if not

◆ next()

const Triangle next ( )

Retrieves the indices of the next triangle. Should only be called while isDone() returns false.

Returns
the 3 indices of the next triangle in a glm::ivec3