Leviathan  0.8.0.0
Leviathan game engine
Leviathan::RenderNode Class Reference

Entity has a scene node. More...

#include <Components.h>

+ Inheritance diagram for Leviathan::RenderNode:

Public Member Functions

DLLEXPORT RenderNode (const Scene::pointer &scene)
 
DLLEXPORT RenderNode (const Test::TestComponentCreation &test)
 Test version that doesn't need a valid scene manager. More...
 
DLLEXPORT void Release (const Scene::pointer &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

SceneNode::pointer Node
 
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
 Attaches this node to this parent (if null entity then attached to the scene root) More...
 

Detailed Description

Entity has a scene node.

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

Definition at line 82 of file Components.h.

Constructor & Destructor Documentation

◆ RenderNode() [1/2]

DLLEXPORT RenderNode::RenderNode ( const Scene::pointer &  scene)

Definition at line 28 of file Components.cpp.

28  : Component(TYPE)
29 {
30  Marked = false;
31 
32  // Skip if no graphics
34  return;
35 
36  Node = scene->CreateSceneNode();
37 }
Component(COMPONENT_TYPE type)
Definition: Component.h:54
SceneNode::pointer Node
Definition: Components.h:94
bool IsInGraphicalMode()
static constexpr auto TYPE
Attaches this node to this parent (if null entity then attached to the scene root)
Definition: Components.h:106
static DLLEXPORT Engine * Get()
Definition: Engine.cpp:86

◆ RenderNode() [2/2]

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

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

Definition at line 46 of file Components.cpp.

46  : Component(TYPE)
47 {
48  Marked = false;
49  Node = nullptr;
50 }
Component(COMPONENT_TYPE type)
Definition: Component.h:54
SceneNode::pointer Node
Definition: Components.h:94
static constexpr auto TYPE
Attaches this node to this parent (if null entity then attached to the scene root)
Definition: Components.h:106

Member Function Documentation

◆ REFERENCE_HANDLE_UNCOUNTED_TYPE()

Leviathan::RenderNode::REFERENCE_HANDLE_UNCOUNTED_TYPE ( RenderNode  )

◆ Release()

DLLEXPORT void RenderNode::Release ( const Scene::pointer &  worldsscene)

Gracefully releases while world is still valid.

Definition at line 39 of file Components.cpp.

40 {
41  if(Node)
42  worldsscene->DestroySceneNode(Node);
43  Node = nullptr;
44 }
SceneNode::pointer Node
Definition: Components.h:94

Member Data Documentation

◆ Hidden

bool Leviathan::RenderNode::Hidden = false

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

Definition at line 97 of file Components.h.

◆ Node

SceneNode::pointer Leviathan::RenderNode::Node

Definition at line 94 of file Components.h.

◆ Scale

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

Sets the scale of the node.

Definition at line 100 of file Components.h.

◆ TYPE

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

Attaches this node to this parent (if null entity then attached to the scene root)

Definition at line 106 of file Components.h.


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