Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
Public Member Functions | Friends | List of all members
Engine::ModelComponent Class Reference

This component is used to keep track of the meshes and textures to render. NOTE: only the Entity class is allowed to create this component. More...

#include <ModelComponent.hpp>

Inheritance diagram for Engine::ModelComponent:
Engine::Component

Public Member Functions

virtual ~ModelComponent ()
 
void SetModel (eastl::shared_ptr< Model > newModel)
 This method allows you to change the model to render of this model component. More...
 
void SetModel (const eastl::string &path)
 This method allows you to change the model to render of this model component. More...
 
eastl::weak_ptr< ModelGetModel () const
 This method will return the current model of this model component. More...
 
template<typename archive >
void SaveComponent (archive ar)
 Saves the data of this component to a archive More...
 
template<typename archive >
void LoadComponent (archive ar)
 loads the data from the archive to this component More...
 
- Public Member Functions inherited from Engine::Component
virtual ~Component ()=default
 
eastl::weak_ptr< EntityGetOwner () const
 This method allows you to get the entity holding this component. More...
 

Friends

class Entity
 

Additional Inherited Members

- Public Attributes inherited from Engine::Component
bool isEnabled
 
- Protected Member Functions inherited from Engine::Component
 Component ()
 
template<typename ComponentType >
eastl::weak_ptr< ComponentType > GetComponent ()
 This method allows you to get the first component of the given type. More...
 
template<typename ComponentType >
eastl::vector< eastl::weak_ptr< ComponentType > > GetComponents ()
 This method allows you to get all of the components of the given type. More...
 
eastl::vector< eastl::shared_ptr< Component > > GetAllComponents () const
 Returns all the components of this entity. More...
 
template<class ComponentType , class... Args>
eastl::weak_ptr< ComponentType > AddComponent (Args &&...args)
 Allows you to create a component of the given type. More...
 
template<class ComponentType , class... Args>
eastl::vector< eastl::weak_ptr< ComponentType > > AddComponents (size_t count, Args &&...args)
 Allows you to create X amount of components of the given type. More...
 
template<typename ComponentType >
void RemoveComponent (size_t amountToRemove=1) const
 Allows X amount of components of the given type. More...
 
template<typename ComponentType >
void RemoveAllComponents () const
 Deletes all the components of the given type. More...
 
template<typename archive >
void SaveBaseComponent (archive ar)
 Saves the data of this component to a archive (all derived classes have their own version, but if needed they can call this one as a failsafe/default version) More...
 
template<typename archive >
void LoadBaseComponent (archive ar)
 loads the data from the archive to this component (all derived classes have their own version, but if needed they can call this one as a failsafe/default version) More...
 
virtual void OnBeginContact (eastl::weak_ptr< Entity > entity)
 
virtual void OnEndContact (eastl::weak_ptr< Entity > entity)
 
eastl::weak_ptr< ComponentGetPointerRefence () const
 This method allows you to get a direct refence to the weak pointer of this component. More...
 
template<typename ComponentType >
eastl::weak_ptr< ComponentType > GetPointerRefence ()
 This method allows you to get a direct refence to the weak pointer of this component. More...
 

Detailed Description

This component is used to keep track of the meshes and textures to render. NOTE: only the Entity class is allowed to create this component.

Definition at line 13 of file ModelComponent.hpp.

Constructor & Destructor Documentation

Engine::ModelComponent::~ModelComponent ( )
virtual

Definition at line 26 of file ModelComponent.cpp.

Member Function Documentation

eastl::weak_ptr< Model > Engine::ModelComponent::GetModel ( ) const

This method will return the current model of this model component.

Returns

Definition at line 51 of file ModelComponent.cpp.

template<typename archive >
void Engine::ModelComponent::LoadComponent ( archive  ar)

loads the data from the archive to this component

Parameters
arthe archive that you want to load from

Definition at line 102 of file ModelComponent.cpp.

template<typename archive >
void Engine::ModelComponent::SaveComponent ( archive  ar)

Saves the data of this component to a archive

Parameters
arthe archive that you want to save to

Definition at line 96 of file ModelComponent.cpp.

void Engine::ModelComponent::SetModel ( eastl::shared_ptr< Model newModel)

This method allows you to change the model to render of this model component.

Parameters
newModelThe new model to use.

Definition at line 31 of file ModelComponent.cpp.

void Engine::ModelComponent::SetModel ( const eastl::string &  path)

This method allows you to change the model to render of this model component.

Parameters
pathThe path of the new model to use.

Definition at line 36 of file ModelComponent.cpp.

Friends And Related Function Documentation

friend class Entity
friend

Definition at line 16 of file ModelComponent.hpp.


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