Ocular Engine
Ocular::Core::MeshRenderable Class Reference

#include <MeshRenderable.hpp>

Inheritance diagram for Ocular::Core::MeshRenderable:
Ocular::Core::ARenderable Ocular::Core::Object Ocular::Core::ObjectIO Ocular::Core::Exposable Ocular::Core::Buildable

Public Member Functions

 MeshRenderable (std::string const &name="MeshRenderable", SceneObject *parent=nullptr)
 
virtual bool initialize () override
 
virtual bool preRender () override
 
virtual void render () override
 
virtual void render (Graphics::Material *material) override
 
virtual void onLoad (BuilderNode const *node) override
 
virtual void onSave (BuilderNode *node) const override
 
virtual void buildBounds (Math::BoundsSphere *sphere, Math::BoundsAABB *aabb, Math::BoundsOBB *obb, Math::Matrix4x4 const &matrix=Math::Matrix4x4()) override
 
virtual uint32_t getRenderPriority () const override
 
bool setMesh (std::string const &name)
 
void setMesh (Graphics::Mesh *mesh)
 
Graphics::MeshgetMesh () const
 
uint32_t addMaterial (std::string const &name)
 
uint32_t addMaterial (Graphics::Material *material)
 
bool setMaterial (std::string const &name, uint32_t index=0, bool resize=false)
 
void setMaterial (Graphics::Material *material, uint32_t index=0, bool resize=false)
 
void removeMaterial (uint32_t index)
 
Graphics::MaterialgetMaterial (uint32_t index=0) const
 
uint32_t getNumMaterials () const
 
- Public Member Functions inherited from Ocular::Core::ARenderable
 ARenderable (std::string const &name="ARenderable", std::string const &type="ARenderable", SceneObject *parent=nullptr)
 
virtual void postRender ()
 
virtual bool preRenderDebug ()
 
virtual void renderDebug ()
 
virtual void postRenderDebug ()
 
SceneObjectgetParent () const
 
std::string const & getName () const
 
- Public Member Functions inherited from Ocular::Core::Object
 Object (std::string name, std::string className)
 Creates a new Object with the specified name and class. More...
 
 Object (std::string name)
 Creates a new Object with the specified name. More...
 
 Object ()
 Creates a new Object with the default name ('Name').
 
std::string const & getName () const
 
void setName (std::string name)
 Sets the name of the Object. More...
 
std::string const & getClass () const
 
void setUUID (std::string const &uuid)
 
UUID const & getUUID () const
 
int64_t getCreationTime () const
 
virtual std::string toString () const
 
template<class T >
bool isType ()
 
- Public Member Functions inherited from Ocular::Core::Exposable
void getAllExposedNames (std::vector< std::string > &names) const
 
bool getVariable (std::string const &name, ExposedVariable &var)
 
template<typename T >
bool getVariableValue (std::string const &name, T &var)
 
template<typename T >
bool setVariableValue (std::string const &name, T const &value)
 
virtual void onVariableModified (std::string const &varName)
 

Protected Member Functions

bool validateMaterialIndex (uint32_t index, bool resize)
 
Graphics::MaterialfindMaterial (std::string const &name)
 
- Protected Member Functions inherited from Ocular::Core::Exposable
void exposeVariable (std::string const &name, std::string const &type, bool isPointer, bool isExposed, void *data)
 

Protected Attributes

Graphics::Meshm_Mesh
 
std::vector< Graphics::Material * > m_Materials
 
- Protected Attributes inherited from Ocular::Core::ARenderable
SceneObjectm_Parent
 
- Protected Attributes inherited from Ocular::Core::Object
std::string m_Name
 
std::string m_Class
 
UUID m_UUID
 
const int64_t m_CreationTime
 
- Protected Attributes inherited from Ocular::Core::Exposable
std::unordered_map< std::string, ExposedVariablem_ExposedVariables
 

Detailed Description

Default generic renderable for simple mesh rendering.

A combination of a single Mesh with one or more Materials.

If the Mesh has multiple SubMeshes, then each SubMesh will be rendered with the associated Material (the first SubMesh will be rendered with material at index 0, second SubMesh with material at index 1, etc.).

If there are more SubMeshes than Materials, then the last bound Material will be used for any additional SubMeshes. If there are more Materials than SubMeshes, then the extra Materials will never be used.

Specifying NULL as a Material is valid for this renderable and it disables rendering of any associated SubMeshes.


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