Hymn to Beauty
C++ 3D Engine
Video::Geometry::Geometry3D Class Reference

Renderable 3D geometry. More...

#include <Geometry3D.hpp>

Inheritance diagram for Video::Geometry::Geometry3D:
Geometry::Cube Geometry::Model

Public Member Functions

 Geometry3D (LowLevelRenderer *lowLevelRenderer)
 Create new 3D geometry. More...
 
virtual ~Geometry3D ()
 Destructor. More...
 
GeometryBindingGetGeometryBinding ()
 Get the geometry binding. More...
 
unsigned int GetIndexCount () const
 Get number of indices. More...
 
const AxisAlignedBoundingBoxGetAxisAlignedBoundingBox () const
 Get the axis-aligned bounding box around the geometry. More...
 
const std::vector< glm::vec3 > & GetVertexPositionData () const
 Get vertex position vector. More...
 
const std::vector< uint32_t > & GetVertexIndexData () const
 Get vertex index vector. More...
 

Protected Member Functions

void GenerateIndexBuffer (uint32_t *indexData, unsigned int indexCount)
 Generate index buffer. More...
 
void GenerateGeometryBinding ()
 Generate geometry binding. More...
 
void CreateAxisAlignedBoundingBox (const std::vector< glm::vec3 * > &positions)
 Create local space axis-aligned bounding box around the geometry. More...
 
void CreateAxisAlignedBoundingBox (glm::vec3 dim, glm::vec3 origin, glm::vec3 minValues, glm::vec3 maxValues)
 Create local space axis-aligned bounding box around the geometry. More...
 

Protected Attributes

BuffervertexBuffer = nullptr
 Vertex buffer. More...
 
BufferindexBuffer = nullptr
 Index buffer. More...
 
VertexDescriptionvertexDescription = nullptr
 Vertex description. More...
 
std::vector< glm::vec3 > vertexPositionData
 Vertex position data. More...
 
std::vector< uint32_t > vertexIndexData
 Vertex index data. More...
 
LowLevelRendererlowLevelRenderer
 The low-level renderer used to create buffers and the vertex description. More...
 

Detailed Description

Renderable 3D geometry.

Constructor & Destructor Documentation

◆ Geometry3D()

Geometry3D::Geometry3D ( LowLevelRenderer lowLevelRenderer)
explicit

Create new 3D geometry.

Parameters
lowLevelRendererThe low-level renderer to use.

◆ ~Geometry3D()

Geometry3D::~Geometry3D ( )
virtual

Destructor.

Member Function Documentation

◆ CreateAxisAlignedBoundingBox() [1/2]

void Geometry3D::CreateAxisAlignedBoundingBox ( const std::vector< glm::vec3 * > &  positions)
protected

Create local space axis-aligned bounding box around the geometry.

Parameters
positionsVector of vertex positions.

◆ CreateAxisAlignedBoundingBox() [2/2]

void Geometry3D::CreateAxisAlignedBoundingBox ( glm::vec3  dim,
glm::vec3  origin,
glm::vec3  minValues,
glm::vec3  maxValues 
)
protected

Create local space axis-aligned bounding box around the geometry.

Parameters
dimVector of vertex positions.
originVector of vertex positions.
minValuesVector of vertex positions.
maxValuesVector of vertex positions.

◆ GenerateGeometryBinding()

void Geometry3D::GenerateGeometryBinding ( )
protected

Generate geometry binding.

◆ GenerateIndexBuffer()

void Geometry3D::GenerateIndexBuffer ( uint32_t *  indexData,
unsigned int  indexCount 
)
protected

Generate index buffer.

Parameters
indexDataPointer to array of indices.
indexCountNumber of indices.

◆ GetAxisAlignedBoundingBox()

const Video::AxisAlignedBoundingBox & Geometry3D::GetAxisAlignedBoundingBox ( ) const

Get the axis-aligned bounding box around the geometry.

Returns
Local space axis-aligned bounding box around the geometry.

◆ GetGeometryBinding()

GeometryBinding * Geometry3D::GetGeometryBinding ( )

Get the geometry binding.

Returns
The geometry binding.

◆ GetIndexCount()

unsigned int Geometry3D::GetIndexCount ( ) const

Get number of indices.

Returns
Index count.

◆ GetVertexIndexData()

const std::vector< uint32_t > & Geometry3D::GetVertexIndexData ( ) const

Get vertex index vector.

Returns
Indices.

◆ GetVertexPositionData()

const std::vector< glm::vec3 > & Geometry3D::GetVertexPositionData ( ) const

Get vertex position vector.

Returns
Vertex positions.

Member Data Documentation

◆ indexBuffer

Buffer* Video::Geometry::Geometry3D::indexBuffer = nullptr
protected

Index buffer.

◆ lowLevelRenderer

LowLevelRenderer* Video::Geometry::Geometry3D::lowLevelRenderer
protected

The low-level renderer used to create buffers and the vertex description.

◆ vertexBuffer

Buffer* Video::Geometry::Geometry3D::vertexBuffer = nullptr
protected

Vertex buffer.

◆ vertexDescription

VertexDescription* Video::Geometry::Geometry3D::vertexDescription = nullptr
protected

Vertex description.

◆ vertexIndexData

std::vector<uint32_t> Video::Geometry::Geometry3D::vertexIndexData
protected

Vertex index data.

◆ vertexPositionData

std::vector<glm::vec3> Video::Geometry::Geometry3D::vertexPositionData
protected

Vertex position data.


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