ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
TriangleGroup< vertexCount, triangleCount > Class Template Reference

Represents a dynamic group of 3D triangles. More...

#include <TriangleGroup.h>

Inheritance diagram for TriangleGroup< vertexCount, triangleCount >:
Collaboration diagram for TriangleGroup< vertexCount, triangleCount >:

Public Member Functions

 TriangleGroup (IStaticTriangleGroup *triangleGroup)
 Constructs a TriangleGroup from a static triangle group.
 
const IndexGroupGetIndexGroup () override
 Gets the index group defining triangle vertices.
 
int GetTriangleCount () override
 Gets the number of triangles in the group.
 
Vector3DGetVertices () override
 Gets the array of vertices in the group.
 
int GetVertexCount () override
 Gets the number of vertices in the group.
 
Triangle3DGetTriangles () override
 Gets the array of triangles in the group.
 
const Vector2DGetUVVertices () override
 Gets the array of UV vertices in the group.
 
const IndexGroupGetUVIndexGroup () override
 Gets the UV index group defining texture coordinates.
 

Private Attributes

Triangle3D triangles [triangleCount]
 Array of triangles in the group.
 
Vector3D vertices [vertexCount]
 Array of vertices in the group.
 
const IndexGroupindexGroup
 Pointer to the index group defining triangle vertices.
 
const IndexGroupuvIndexGroup
 Pointer to the UV index group defining texture coordinates.
 
const Vector2DuvVertices
 Pointer to the array of UV coordinates.
 
bool hasUV = false
 Indicates whether UV mapping is enabled.
 

Detailed Description

template<int vertexCount, int triangleCount>
class TriangleGroup< vertexCount, triangleCount >

Represents a dynamic group of 3D triangles.

This class allows manipulation of a group of triangles based on a static triangle group. It supports optional UV mapping and provides methods to retrieve triangle and vertex data.

Template Parameters
vertexCountNumber of vertices in the group.
triangleCountNumber of triangles in the group.

Definition at line 31 of file TriangleGroup.h.

Constructor & Destructor Documentation

◆ TriangleGroup()

template<int vertexCount, int triangleCount>
TriangleGroup ( IStaticTriangleGroup< vertexCount, triangleCount > *  triangleGroup)

Constructs a TriangleGroup from a static triangle group.

Parameters
triangleGroupPointer to a static triangle group to initialize this group.

Member Function Documentation

◆ GetIndexGroup()

template<int vertexCount, int triangleCount>
const IndexGroup * GetIndexGroup ( )
overridevirtual

Gets the index group defining triangle vertices.

Returns
Pointer to the index group.

Implements ITriangleGroup.

◆ GetTriangleCount()

template<int vertexCount, int triangleCount>
int GetTriangleCount ( )
overridevirtual

Gets the number of triangles in the group.

Returns
Number of triangles.

Implements ITriangleGroup.

◆ GetTriangles()

template<int vertexCount, int triangleCount>
Triangle3D * GetTriangles ( )
overridevirtual

Gets the array of triangles in the group.

Returns
Pointer to the array of triangles.

Implements ITriangleGroup.

◆ GetUVIndexGroup()

template<int vertexCount, int triangleCount>
const IndexGroup * GetUVIndexGroup ( )
overridevirtual

Gets the UV index group defining texture coordinates.

Returns
Pointer to the UV index group.

Implements ITriangleGroup.

◆ GetUVVertices()

template<int vertexCount, int triangleCount>
const Vector2D * GetUVVertices ( )
overridevirtual

Gets the array of UV vertices in the group.

Returns
Pointer to the array of UV vertices.

Implements ITriangleGroup.

◆ GetVertexCount()

template<int vertexCount, int triangleCount>
int GetVertexCount ( )
overridevirtual

Gets the number of vertices in the group.

Returns
Number of vertices.

Implements ITriangleGroup.

◆ GetVertices()

template<int vertexCount, int triangleCount>
Vector3D * GetVertices ( )
overridevirtual

Gets the array of vertices in the group.

Returns
Pointer to the array of vertices.

Implements ITriangleGroup.

Member Data Documentation

◆ hasUV

template<int vertexCount, int triangleCount>
bool hasUV = false
private

Indicates whether UV mapping is enabled.

Definition at line 38 of file TriangleGroup.h.

◆ indexGroup

template<int vertexCount, int triangleCount>
const IndexGroup* indexGroup
private

Pointer to the index group defining triangle vertices.

Definition at line 35 of file TriangleGroup.h.

◆ triangles

template<int vertexCount, int triangleCount>
Triangle3D triangles[triangleCount]
private

Array of triangles in the group.

Definition at line 33 of file TriangleGroup.h.

◆ uvIndexGroup

template<int vertexCount, int triangleCount>
const IndexGroup* uvIndexGroup
private

Pointer to the UV index group defining texture coordinates.

Definition at line 36 of file TriangleGroup.h.

◆ uvVertices

template<int vertexCount, int triangleCount>
const Vector2D* uvVertices
private

Pointer to the array of UV coordinates.

Definition at line 37 of file TriangleGroup.h.

◆ vertices

template<int vertexCount, int triangleCount>
Vector3D vertices[vertexCount]
private

Array of vertices in the group.

Definition at line 34 of file TriangleGroup.h.


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