KiCad PCB EDA Suite
Loading...
Searching...
No Matches
c3dmodel.h File Reference

define an internal structure to be used by the 3D renders More...

Go to the source code of this file.

Classes

struct  SMATERIAL
 
struct  SMESH
 Per-vertex normal/color/texcoors structure. More...
 
struct  S3DMODEL
 Store the a model based on meshes and materials. More...
 

Functions

bool IsTriangleInRange (const unsigned int *aFaceIdx, unsigned int aTriangleIdx, unsigned int aVertexCount)
 Test whether the three face indices of a triangle all reference valid vertices.
 

Detailed Description

define an internal structure to be used by the 3D renders

Definition in file c3dmodel.h.

Function Documentation

◆ IsTriangleInRange()

bool IsTriangleInRange ( const unsigned int * aFaceIdx,
unsigned int aTriangleIdx,
unsigned int aVertexCount )
inline

Test whether the three face indices of a triangle all reference valid vertices.

Malformed mesh data can carry indices past the end of the vertex array; consuming them would read out of bounds and produce corrupt geometry, so callers skip any triangle this rejects.

Parameters
aFaceIdxFace index array (SMESH::m_FaceIdx).
aTriangleIdxOffset of the triangle's first index into aFaceIdx.
aVertexCountNumber of vertices available (SMESH::m_VertexSize).

Definition at line 100 of file c3dmodel.h.

Referenced by RENDER_3D_RAYTRACE_BASE::addModels(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and MODEL_3D::MODEL_3D().