3D City v-1.0
Computer Graphics Project
drawable< T > Class Template Reference

this class represents all drawable entities that has a material and vertices More...

#include <drawable.h>

Public Member Functions

 drawable ()=default
 
 drawable (const std::vector< T > &vertices, std::vector< unsigned > indices, const std::string &n)
 
void delpos (const vec3 &delta)
 
void setpos (const vec3 &delta)
 
mat4f getTranslation ()
 
void setScale (const vec3 &scale)
 
void setRotation (float angle, const vec3 &axis)
 
mat4f * refreshModel ()
 
virtual void userSpecificFunction ()
 

Public Attributes

std::vector< T > m_vertices
 
std::vector< uint32_t > m_indices
 
Material material
 
bool doLightCalculations = true
 
std::string name
 
bool draw = true
 
mat4f matModel = mat4f()
 

Protected Attributes

mat4f scaling = mat4f()
 
mat4f translation = mat4f()
 
mat4f rotation = mat4f()
 

Detailed Description

template<class T>
class drawable< T >

this class represents all drawable entities that has a material and vertices

Definition at line 12 of file drawable.h.

Constructor & Destructor Documentation

◆ drawable() [1/2]

template<class T >
drawable< T >::drawable ( )
default

◆ drawable() [2/2]

template<class T >
drawable< T >::drawable ( const std::vector< T > &  vertices,
std::vector< unsigned >  indices,
const std::string &  n 
)
inline

Definition at line 25 of file drawable.h.

Member Function Documentation

◆ delpos()

template<class T >
void drawable< T >::delpos ( const vec3 &  delta)
inline

Definition at line 28 of file drawable.h.

◆ getTranslation()

template<class T >
mat4f drawable< T >::getTranslation ( )
inline

Definition at line 38 of file drawable.h.

◆ refreshModel()

template<class T >
mat4f * drawable< T >::refreshModel ( )
inline

Definition at line 50 of file drawable.h.

◆ setpos()

template<class T >
void drawable< T >::setpos ( const vec3 &  delta)
inline

Definition at line 33 of file drawable.h.

◆ setRotation()

template<class T >
void drawable< T >::setRotation ( float  angle,
const vec3 &  axis 
)
inline

Definition at line 45 of file drawable.h.

◆ setScale()

template<class T >
void drawable< T >::setScale ( const vec3 &  scale)
inline

Definition at line 40 of file drawable.h.

◆ userSpecificFunction()

template<class T >
virtual void drawable< T >::userSpecificFunction ( )
inlinevirtual

Definition at line 55 of file drawable.h.

Member Data Documentation

◆ doLightCalculations

template<class T >
bool drawable< T >::doLightCalculations = true

Definition at line 17 of file drawable.h.

◆ draw

template<class T >
bool drawable< T >::draw = true

Definition at line 19 of file drawable.h.

◆ m_indices

template<class T >
std::vector<uint32_t> drawable< T >::m_indices

Definition at line 15 of file drawable.h.

◆ m_vertices

template<class T >
std::vector<T> drawable< T >::m_vertices

Definition at line 14 of file drawable.h.

◆ material

template<class T >
Material drawable< T >::material

Definition at line 16 of file drawable.h.

◆ matModel

template<class T >
mat4f drawable< T >::matModel = mat4f()

Definition at line 21 of file drawable.h.

◆ name

template<class T >
std::string drawable< T >::name

Definition at line 18 of file drawable.h.

◆ rotation

template<class T >
mat4f drawable< T >::rotation = mat4f()
protected

Definition at line 60 of file drawable.h.

◆ scaling

template<class T >
mat4f drawable< T >::scaling = mat4f()
protected

Definition at line 58 of file drawable.h.

◆ translation

template<class T >
mat4f drawable< T >::translation = mat4f()
protected

Definition at line 59 of file drawable.h.