Leviathan  0.8.0.0
Leviathan game engine
Leviathan::RenderNode Class Reference

Entity has an Ogre scene node. More...

#include <Components.h>

+ Inheritance diagram for Leviathan::RenderNode:

Public Member Functions

DLLEXPORT RenderNode (Ogre::SceneManager *scene)
 
DLLEXPORT RenderNode (const Test::TestComponentCreation &test)
 Test version that doesn't need a valid scene manager. More...
 
DLLEXPORT void Release (Ogre::SceneManager *worldsscene)
 Gracefully releases while world is still valid. More...
 
 REFERENCE_HANDLE_UNCOUNTED_TYPE (RenderNode)
 
- Public Member Functions inherited from Leviathan::Component
 Component (COMPONENT_TYPE type)
 
 Component (const Component &)=delete
 
Componentoperator= (const Component &)=delete
 

Public Attributes

Ogre::SceneNode * Node = nullptr
 
bool Hidden = false
 Sets objects attached to the node to be hidden or visible. More...
 
Float3 Scale = Float3(1, 1, 1)
 Sets the scale of the node. More...
 
- 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::RenderNode
 

Detailed Description

Entity has an Ogre scene node.

Note
By default this is not marked. If you change Hidden set as marked to update Node state

Definition at line 83 of file Components.h.

Constructor & Destructor Documentation

◆ RenderNode() [1/2]

DLLEXPORT RenderNode::RenderNode ( Ogre::SceneManager *  scene)

Definition at line 33 of file Components.cpp.

33  : Component(TYPE)
34 {
35  Marked = false;
36 
37  // Skip if no graphics
38  if(!Ogre::Root::getSingletonPtr())
39  return;
40 
41  // TODO: allow for static render nodes
42  Node = scene->getRootSceneNode(Ogre::SCENE_DYNAMIC)
43  ->createChildSceneNode(Ogre::SCENE_DYNAMIC);
44 
45  // Node = scene->createSceneNode();
46 }
Component(COMPONENT_TYPE type)
Definition: Component.h:54
Ogre::SceneNode * Node
Definition: Components.h:95
static constexpr auto TYPE
Definition: Components.h:103

◆ RenderNode() [2/2]

DLLEXPORT RenderNode::RenderNode ( const Test::TestComponentCreation &  test)

Test version that doesn't need a valid scene manager.

Definition at line 55 of file Components.cpp.

55  : Component(TYPE)
56 {
57  Marked = false;
58  Node = nullptr;
59 }
Component(COMPONENT_TYPE type)
Definition: Component.h:54
Ogre::SceneNode * Node
Definition: Components.h:95
static constexpr auto TYPE
Definition: Components.h:103

Member Function Documentation

◆ REFERENCE_HANDLE_UNCOUNTED_TYPE()

Leviathan::RenderNode::REFERENCE_HANDLE_UNCOUNTED_TYPE ( RenderNode  )

◆ Release()

DLLEXPORT void RenderNode::Release ( Ogre::SceneManager *  worldsscene)

Gracefully releases while world is still valid.

Definition at line 48 of file Components.cpp.

49 {
50  if(Node)
51  worldsscene->destroySceneNode(Node);
52  Node = nullptr;
53 }
Ogre::SceneNode * Node
Definition: Components.h:95

Member Data Documentation

◆ Hidden

bool Leviathan::RenderNode::Hidden = false

Sets objects attached to the node to be hidden or visible.

Definition at line 98 of file Components.h.

◆ Node

Ogre::SceneNode* Leviathan::RenderNode::Node = nullptr

Definition at line 95 of file Components.h.

◆ Scale

Float3 Leviathan::RenderNode::Scale = Float3(1, 1, 1)

Sets the scale of the node.

Definition at line 101 of file Components.h.

◆ TYPE

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

Definition at line 103 of file Components.h.


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