Leviathan  0.8.0.0
Leviathan game engine
Leviathan::Model Class Reference

Entity has a model. More...

#include <Components.h>

+ Inheritance diagram for Leviathan::Model:

Public Member Functions

DLLEXPORT Model (Ogre::SceneManager *scene, Ogre::SceneNode *parent, const std::string &meshname)
 
DLLEXPORT void Release (Ogre::SceneManager *scene)
 Destroys GraphicalObject. More...
 
 REFERENCE_HANDLE_UNCOUNTED_TYPE (Model)
 
- Public Member Functions inherited from Leviathan::Component
 Component (COMPONENT_TYPE type)
 
 Component (const Component &)=delete
 
Componentoperator= (const Component &)=delete
 

Public Attributes

Ogre::Item * GraphicalObject = nullptr
 The entity that has this model's mesh loaded. More...
 
std::string MeshName
 
- Public Attributes inherited from Leviathan::Component
bool Marked
 
const COMPONENT_TYPE Type
 Type of this component, used for network serialization. More...
 

Static Public Attributes

static constexpr auto TYPE = COMPONENT_TYPE::Model
 

Detailed Description

Entity has a model.

Definition at line 229 of file Components.h.

Constructor & Destructor Documentation

◆ Model()

DLLEXPORT Model::Model ( Ogre::SceneManager *  scene,
Ogre::SceneNode *  parent,
const std::string &  meshname 
)

Definition at line 295 of file Components.cpp.

296  :
297  Component(TYPE),
298  MeshName(meshname)
299 {
300  // Skip if no graphics
301  if(!Ogre::Root::getSingletonPtr())
302  return;
303 
304  GraphicalObject = scene->createItem(meshname);
305  GraphicalObject->setRenderQueueGroup(DEFAULT_RENDER_QUEUE);
306  parent->attachObject(GraphicalObject);
307 }
Component(COMPONENT_TYPE type)
Definition: Component.h:54
std::string MeshName
Definition: Components.h:243
constexpr auto DEFAULT_RENDER_QUEUE
Definition: EntityCommon.h:16
Ogre::Item * GraphicalObject
The entity that has this model&#39;s mesh loaded.
Definition: Components.h:240
static constexpr auto TYPE
Definition: Components.h:245

Member Function Documentation

◆ REFERENCE_HANDLE_UNCOUNTED_TYPE()

Leviathan::Model::REFERENCE_HANDLE_UNCOUNTED_TYPE ( Model  )

◆ Release()

DLLEXPORT void Model::Release ( Ogre::SceneManager *  scene)

Destroys GraphicalObject.

Definition at line 309 of file Components.cpp.

310 {
311  if(GraphicalObject)
312  scene->destroyItem(GraphicalObject);
313 }
Ogre::Item * GraphicalObject
The entity that has this model&#39;s mesh loaded.
Definition: Components.h:240

Member Data Documentation

◆ GraphicalObject

Ogre::Item* Leviathan::Model::GraphicalObject = nullptr

The entity that has this model's mesh loaded.

Definition at line 240 of file Components.h.

◆ MeshName

std::string Leviathan::Model::MeshName
Note
Changing this currently does nothing

Definition at line 243 of file Components.h.

◆ TYPE

constexpr auto Leviathan::Model::TYPE = COMPONENT_TYPE::Model
static

Definition at line 245 of file Components.h.


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