| Fling Engine 0.00.1 Fling Engine is a game engine written in Vulkan

Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
Fling::Model Class Reference

A model represents a 3D model (.obj files for now) with vertices and indecies. More...

`#include <Model.h>`

Inherits Fling::Resource.

## Public Member Functions
| Model (Guid t_ID)
| Construct a new model object. More...
| Model (Guid t_ID, std::vector< Vertex > &t_Verts, std::vector< UINT32 > t_Indecies)
| ~Model ()
FORCEINLINE Buffer * | GetVertexBuffer () const
FORCEINLINE Buffer * | GetIndexBuffer () const
FORCEINLINE const std::vector< Vertex > & | GetVerts () const
FORCEINLINE const std::vector< UINT32 > & | GetIndices () const
FORCEINLINE UINT32 | GetIndexCount () const
FORCEINLINE UINT32 | GetVertexCount () const
Public Member Functions inherited from Fling::Resource
| Resource (Fling::Guid t_ID)
virtual | ~Resource ()=default
Fling::Guid_Handle | GetGuidHandle () const
| Get GUID handle (just an int) for this resources guid. More...
const std::string & | GetGuidString () const
| Get the human-readable string representation of this GUID. More...
std::string | GetFilepathReleativeToAssets () const
| Returns the full file path that is relative to the assets path based on the GUID of this resource. More...

## Static Public Member Functions
static std::shared_ptr< Fling::Model > | Create (Guid t_ID)
static std::shared_ptr< Fling::Model > | Quad ()
| Creates a quad primitive model. More...
static constexpr VkIndexType | GetIndexType ()

## Private Member Functions
void | CreateBuffers ()
void | LoadModel ()
| Load this model from Tiny Obj loader. More...

## Static Private Member Functions
static void | CalculateVertexTangents (Vertex *verts, UINT32 numVerts, UINT32 *indices, UINT32 numIndices)

## Private Attributes
std::vector< Vertex > | m_Verts
std::vector< UINT32 > | m_Indices
Buffer * | m_VertexBuffer = nullptr
Buffer * | m_IndexBuffer = nullptr

## Additional Inherited Members
Protected Attributes inherited from Fling::Resource
Fling::Guid | m_Guid
std::string | m_HumanReadableName

## Detailed Description

A model represents a 3D model (.obj files for now) with vertices and indecies.

A model has a vertex and index buffer and can be bound to a command buffer.

## Constructor & Destructor Documentation

## ◆ Model() [1/2]

Fling::Model::Model | ( | Guid | t_ID | ) |

Construct a new model object.

Parameters

  t_ID | The GUID that represents the file path to this model

## ◆ Model() [2/2]

Fling::Model::Model | ( | Guid | t_ID,
|  | std::vector< Vertex > & | t_Verts,
|  | std::vector< UINT32 > | t_Indecies
| ) |  |

Parameters

  t_ID | The GUID that represents a unique name for this model. It's up to the user to ensure uniqueness

## ◆ ~Model()

Fling::Model::~Model | ( |  | ) |

## Member Function Documentation

## ◆ CalculateVertexTangents()

void Fling::Model::CalculateVertexTangents | ( | Vertex * | verts,
|  | UINT32 | numVerts,
|  | UINT32 * | indices,
|  | UINT32 | numIndices
| ) |  |
| static private

## ◆ Create()

std::shared_ptr< Fling::Model > Fling::Model::Create | ( | Guid | t_ID | ) |
| static

## ◆ CreateBuffers()

void Fling::Model::CreateBuffers | ( |  | ) |
| private

## ◆ GetIndexBuffer()

FORCEINLINE Buffer* Fling::Model::GetIndexBuffer | ( |  | ) | const
| inline

## ◆ GetIndexCount()

FORCEINLINE UINT32 Fling::Model::GetIndexCount | ( |  | ) | const
| inline

## ◆ GetIndexType()

static constexpr VkIndexType Fling::Model::GetIndexType | ( |  | ) |
| inline static

## ◆ GetIndices()

FORCEINLINE const std::vector<UINT32>& Fling::Model::GetIndices | ( |  | ) | const
| inline

## ◆ GetVertexBuffer()

FORCEINLINE Buffer* Fling::Model::GetVertexBuffer | ( |  | ) | const
| inline

## ◆ GetVertexCount()

FORCEINLINE UINT32 Fling::Model::GetVertexCount | ( |  | ) | const
| inline

## ◆ GetVerts()

FORCEINLINE const std::vector<Vertex>& Fling::Model::GetVerts | ( |  | ) | const
| inline

## ◆ LoadModel()

void Fling::Model::LoadModel | ( |  | ) |
| private

Load this model from Tiny Obj loader.

## ◆ Quad()

std::shared_ptr< Fling::Model > Fling::Model::Quad | ( |  | ) |
| static

Creates a quad primitive model.

## Field Documentation

## ◆ m_IndexBuffer

Buffer* Fling::Model::m_IndexBuffer = nullptr
| private

## ◆ m_Indices

std::vector<UINT32> Fling::Model::m_Indices
| private

## ◆ m_VertexBuffer

Buffer* Fling::Model::m_VertexBuffer = nullptr
| private

## ◆ m_Verts

std::vector<Vertex> Fling::Model::m_Verts
| private

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

- FlingEngine/Graphics/inc/Model.h
- FlingEngine/Graphics/src/Model.cpp