Nebula
Loading...
Searching...
No Matches
instanceserverbase.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
12//------------------------------------------------------------------------------
13#include "core/refcounted.h"
14#include "core/singleton.h"
15#include "models/modelnodeinstance.h"
16#include "models/modelnode.h"
17
18namespace Instancing
19{
20 class InstanceRenderer;
21}
22namespace Base
23{
60
61//------------------------------------------------------------------------------
64inline bool
66{
67 return this->isOpen;
68}
69
70} // namespace Instancing
71//------------------------------------------------------------------------------
Definition instanceserverbase.h:25
InstanceServerBase()
constructor
Definition instanceserverbase.cc:19
bool isOpen
Definition instanceserverbase.h:57
Ptr< Instancing::InstanceRenderer > renderer
Definition instanceserverbase.h:53
void AddInstance(const IndexT &instanceCode, const Ptr< Models::ModelNodeInstance > &instance)
adds instance to current model
Definition instanceserverbase.cc:84
IndexT pass
Definition instanceserverbase.h:51
SizeT multiplier
Definition instanceserverbase.h:58
__DeclareSingleton(InstanceServerBase)
Util::Dictionary< IndexT, Util::Array< Ptr< Models::ModelNodeInstance > > > instancesByCode
Definition instanceserverbase.h:55
__DeclareClass(InstanceServerBase)
virtual void Close()
close the InstanceServerBase
Definition instanceserverbase.cc:54
virtual void Render(IndexT frameIndex)
updates instance server (call from batch)
Definition instanceserverbase.cc:107
virtual bool Open()
open the InstanceServerBase
Definition instanceserverbase.cc:43
bool IsOpen() const
return if InstanceServerBase is open
Definition instanceserverbase.h:65
Ptr< CoreGraphics::Shader > shader
Definition instanceserverbase.h:52
virtual ~InstanceServerBase()
destructor
Definition instanceserverbase.cc:34
void BeginInstancing(const Ptr< Models::ModelNode > &modelNode, const SizeT multiplier, const Ptr< CoreGraphics::Shader > &shader, const IndexT &pass)
begins adding model instances to server
Definition instanceserverbase.cc:67
Ptr< Models::ModelNode > modelNode
Definition instanceserverbase.h:54
void EndInstancing()
ends adding model instances
Definition instanceserverbase.cc:117
bool isBeginInstancing
Definition instanceserverbase.h:56
The common base class of Nebula.
Definition refcounted.h:38
The instance renderer performs actual rendering and updating of shader variables for transforms.
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
A collection of key/value pairs with quick value retrieval by key at roughly O(log n).
Definition dictionary.h:34
Definition gamecontentserverbase.cc:10
Definition instanceserverbase.h:19
int SizeT
Definition types.h:49
int IndexT
Definition types.h:48