vOOlkan
An object oriented approach to Vulkan
Vulkan::Objects::Model< Vertex, Structs > Class Template Reference

#include <Model.h>

Inheritance diagram for Vulkan::Objects::Model< Vertex, Structs >:
Vulkan::Utilities::KeyboardObserver

Public Member Functions

 Model (std::unique_ptr< Vulkan::Physics::Hitbox > hitbox, glm::vec3 rotationEuler, Vertex, std::string pathToModel, Structs... uniforms)
 
 Model (glm::vec3 rotationEuler, float scale, Physics::Position position, std::vector< Vertex > vertices, std::vector< uint32_t > indexes, Structs... uniforms)
 
void setKeyPressResponse (std::function< void(Model &, int)> reactToKeyPress)
 
const std::vector< Vertex > & getVertices () const
 
void setVertices (std::vector< Vertex > vertices)
 
const std::vector< uint32_t > & getIndexes () const
 
ModelrotateModel (float angle, glm::vec3 axis)
 
const glm::mat4 & calculateModelMatrix () const
 
const glm::mat4 & calculateNormalModelMatrix () const
 
const glm::mat4 & calculateMvpMatrix (const glm::mat4 &viewMatrix, const glm::mat4 &projectionMatrix) const
 
std::tuple< Matrices, Structs... > & getUniforms (const glm::mat4 &viewMatrix, const glm::mat4 &projectionMatrix)
 
template<unsigned int I>
auto & getUniform (const glm::mat4 &viewMatrix=glm::mat4{}, const glm::mat4 &projectionMatrix=glm::mat4{})
 
template<>
auto & getUniform (const glm::mat4 &viewMatrix, const glm::mat4 &projectionMatrix)
 
Vulkan::Physics::Hitboxoperator+ ()
 
void onKeyPress (int keyPressed) override
 
virtual void onKeyPress (int keyPressed)=0
 

Constructor & Destructor Documentation

◆ Model() [1/2]

template<IsVertex Vertex, typename... Structs>
Vulkan::Objects::Model< Vertex, Structs >::Model ( std::unique_ptr< Vulkan::Physics::Hitbox hitbox,
glm::vec3  rotationEuler,
Vertex  ,
std::string  pathToModel,
Structs...  uniforms 
)
inline

◆ Model() [2/2]

template<IsVertex Vertex, typename... Structs>
Vulkan::Objects::Model< Vertex, Structs >::Model ( glm::vec3  rotationEuler,
float  scale,
Physics::Position  position,
std::vector< Vertex >  vertices,
std::vector< uint32_t >  indexes,
Structs...  uniforms 
)
inline

Member Function Documentation

◆ calculateModelMatrix()

template<IsVertex Vertex, typename... Structs>
const glm::mat4 & Vulkan::Objects::Model< Vertex, Structs >::calculateModelMatrix ( ) const
inline

◆ calculateMvpMatrix()

template<IsVertex Vertex, typename... Structs>
const glm::mat4 & Vulkan::Objects::Model< Vertex, Structs >::calculateMvpMatrix ( const glm::mat4 &  viewMatrix,
const glm::mat4 &  projectionMatrix 
) const
inline

◆ calculateNormalModelMatrix()

template<IsVertex Vertex, typename... Structs>
const glm::mat4 & Vulkan::Objects::Model< Vertex, Structs >::calculateNormalModelMatrix ( ) const
inline

◆ getIndexes()

template<IsVertex Vertex, typename... Structs>
const std::vector< uint32_t > & Vulkan::Objects::Model< Vertex, Structs >::getIndexes ( ) const
inline

◆ getUniform() [1/2]

template<IsVertex Vertex, typename... Structs>
template<>
auto & Vulkan::Objects::Model< Vertex, Structs >::getUniform ( const glm::mat4 &  viewMatrix,
const glm::mat4 &  projectionMatrix 
)
inline

◆ getUniform() [2/2]

template<IsVertex Vertex, typename... Structs>
template<unsigned int I>
auto & Vulkan::Objects::Model< Vertex, Structs >::getUniform ( const glm::mat4 &  viewMatrix = glm::mat4{},
const glm::mat4 &  projectionMatrix = glm::mat4{} 
)
inline

◆ getUniforms()

template<IsVertex Vertex, typename... Structs>
std::tuple< Matrices, Structs... > & Vulkan::Objects::Model< Vertex, Structs >::getUniforms ( const glm::mat4 &  viewMatrix,
const glm::mat4 &  projectionMatrix 
)
inline

◆ getVertices()

template<IsVertex Vertex, typename... Structs>
const std::vector< Vertex > & Vulkan::Objects::Model< Vertex, Structs >::getVertices ( ) const
inline

◆ onKeyPress()

template<IsVertex Vertex, typename... Structs>
void Vulkan::Objects::Model< Vertex, Structs >::onKeyPress ( int  keyPressed)
inlineoverridevirtual

◆ operator+()

template<IsVertex Vertex, typename... Structs>
Vulkan::Physics::Hitbox & Vulkan::Objects::Model< Vertex, Structs >::operator+ ( )
inline

◆ rotateModel()

template<IsVertex Vertex, typename... Structs>
Model & Vulkan::Objects::Model< Vertex, Structs >::rotateModel ( float  angle,
glm::vec3  axis 
)
inline

◆ setKeyPressResponse()

template<IsVertex Vertex, typename... Structs>
void Vulkan::Objects::Model< Vertex, Structs >::setKeyPressResponse ( std::function< void(Model< Vertex, Structs > &, int)>  reactToKeyPress)
inline

◆ setVertices()

template<IsVertex Vertex, typename... Structs>
void Vulkan::Objects::Model< Vertex, Structs >::setVertices ( std::vector< Vertex >  vertices)
inline

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