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

Represents a static collection of 3D triangles and associated vertex/UV data. More...

#include <StaticTriangleGroup.h>

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

Public Member Functions

 StaticTriangleGroup (Vector3D *vertices, const IndexGroup *indexGroup)
 Constructor for a group without UV data.
 
 StaticTriangleGroup (Vector3D *vertices, const IndexGroup *indexGroup, const IndexGroup *uvIndexGroup, const Vector2D *uvVertices)
 Constructor for a group with UV data.
 
const bool HasUV () override
 Checks if the group has UV data.
 
const IndexGroupGetIndexGroup () override
 Retrieves the triangle index group.
 
const int GetTriangleCount () override
 Gets the total number of triangles in the group.
 
Vector3DGetVertices () override
 Retrieves the array of vertex positions.
 
const int GetVertexCount () override
 Gets the total number of vertices in the group.
 
Triangle3DGetTriangles () override
 Retrieves the array of triangles in the group.
 
const Vector2DGetUVVertices () override
 Retrieves the array of UV coordinates.
 
const IndexGroupGetUVIndexGroup () override
 Retrieves the UV index group.
 

Private Attributes

Triangle3D triangles [triangleCount]
 Array of 3D triangles in the group.
 
Vector3Dvertices
 Array of vertex positions.
 
const IndexGroupindexGroup
 Index group defining triangle vertex indices.
 
const IndexGroupuvIndexGroup
 Index group for UV coordinates (if available).
 
const Vector2DuvVertices
 Array of UV coordinates for texture mapping.
 
const bool hasUVB
 Indicates whether the group contains UV data.
 

Detailed Description

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

Represents a static collection of 3D triangles and associated vertex/UV data.

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

Definition at line 29 of file StaticTriangleGroup.h.

Constructor & Destructor Documentation

◆ StaticTriangleGroup() [1/2]

template<int vertexCount, int triangleCount>
StaticTriangleGroup ( Vector3D vertices,
const IndexGroup indexGroup 
)

Constructor for a group without UV data.

Parameters
verticesArray of vertex positions.
indexGroupIndex group defining triangle vertex indices.

◆ StaticTriangleGroup() [2/2]

template<int vertexCount, int triangleCount>
StaticTriangleGroup ( Vector3D vertices,
const IndexGroup indexGroup,
const IndexGroup uvIndexGroup,
const Vector2D uvVertices 
)

Constructor for a group with UV data.

Parameters
verticesArray of vertex positions.
indexGroupIndex group defining triangle vertex indices.
uvIndexGroupIndex group for UV coordinates.
uvVerticesArray of UV coordinates for texture mapping.

Member Function Documentation

◆ GetIndexGroup()

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

Retrieves the triangle index group.

Returns
Pointer to the IndexGroup defining triangle vertex indices.

Implements IStaticTriangleGroup.

◆ GetTriangleCount()

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

Gets the total number of triangles in the group.

Returns
The number of triangles.

Implements IStaticTriangleGroup.

◆ GetTriangles()

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

Retrieves the array of triangles in the group.

Returns
Pointer to the array of triangles.

Implements IStaticTriangleGroup.

◆ GetUVIndexGroup()

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

Retrieves the UV index group.

Returns
Pointer to the UV IndexGroup, or nullptr if not available.

Implements IStaticTriangleGroup.

◆ GetUVVertices()

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

Retrieves the array of UV coordinates.

Returns
Pointer to the array of UV coordinates, or nullptr if not available.

Implements IStaticTriangleGroup.

◆ GetVertexCount()

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

Gets the total number of vertices in the group.

Returns
The number of vertices.

Implements IStaticTriangleGroup.

◆ GetVertices()

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

Retrieves the array of vertex positions.

Returns
Pointer to the array of vertices.

Implements IStaticTriangleGroup.

◆ HasUV()

template<int vertexCount, int triangleCount>
const bool HasUV ( )
overridevirtual

Checks if the group has UV data.

Returns
True if UV data is present, otherwise false.

Implements IStaticTriangleGroup.

Member Data Documentation

◆ hasUVB

template<int vertexCount, int triangleCount>
const bool hasUVB
private

Indicates whether the group contains UV data.

Definition at line 36 of file StaticTriangleGroup.h.

◆ indexGroup

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

Index group defining triangle vertex indices.

Definition at line 33 of file StaticTriangleGroup.h.

◆ triangles

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

Array of 3D triangles in the group.

Definition at line 31 of file StaticTriangleGroup.h.

◆ uvIndexGroup

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

Index group for UV coordinates (if available).

Definition at line 34 of file StaticTriangleGroup.h.

◆ uvVertices

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

Array of UV coordinates for texture mapping.

Definition at line 35 of file StaticTriangleGroup.h.

◆ vertices

template<int vertexCount, int triangleCount>
Vector3D* vertices
private

Array of vertex positions.

Definition at line 32 of file StaticTriangleGroup.h.


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