Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::SceneNode Class Reference

#include <SceneNode.h>

+ Inheritance diagram for Divide::SceneNode:

Public Member Functions

 SceneNode (const ResourceDescriptorBase &descriptor, SceneNodeType type, U32 requiredComponentMask)
 
virtual ~SceneNode () override
 
virtual void prepareRender (SceneGraphNode *sgn, RenderingComponent &rComp, RenderPackage &pkg, GFX::MemoryBarrierCommand &postDrawMemCmd, RenderStagePass renderStagePass, const CameraSnapshot &cameraSnapshot, bool refreshData)
 
virtual void buildDrawCommands (SceneGraphNode *sgn, GenericDrawCommandContainer &cmdsOut)
 
bool load (PlatformContext &context) override
 Loading and unloading interface.
 
bool postLoad () override
 
bool unload () override
 
virtual void setMaterialTpl (Handle< Material > material)
 
Handle< MaterialgetMaterialTpl () const
 
SceneNodeRenderStaterenderState () noexcept
 
const SceneNodeRenderStaterenderState () const noexcept
 
const BoundingBoxgetBounds () const noexcept
 
const vec3< F32 > & getWorldOffset () const noexcept
 
U32 requiredComponentMask () const noexcept
 
virtual bool saveCache (ByteBuffer &outputBuffer) const
 
virtual bool loadCache (ByteBuffer &inputBuffer)
 
virtual void saveToXML (boost::property_tree::ptree &pt) const
 
virtual void loadFromXML (const boost::property_tree::ptree &pt)
 
EditorComponenteditorComponent () const noexcept
 
- Public Member Functions inherited from Divide::CachedResource
 CachedResource (const ResourceDescriptorBase &descriptor, std::string_view typeName)
 
virtual bool load (PlatformContext &context)
 Loading and unloading interface.
 
virtual bool postLoad ()
 
virtual bool unload ()
 
void setState (ResourceState currentState) final
 
- Public Member Functions inherited from Divide::Resource
 Resource (std::string_view resourceName, std::string_view typeName)
 
ResourceState getState () const noexcept
 
 PROPERTY_R (Str< 32 >, typeName)
 
 PROPERTY_R (Str< 256 >, resourceName)
 
- Public Member Functions inherited from Divide::GUIDWrapper
 GUIDWrapper () noexcept
 
 GUIDWrapper (const GUIDWrapper &old) noexcept
 
 GUIDWrapper (GUIDWrapper &&old) noexcept
 
virtual ~GUIDWrapper ()=default
 
FORCE_INLINE I64 getGUID () const noexcept
 
GUIDWrapperoperator= (const GUIDWrapper &old)=delete
 
GUIDWrapperoperator= (GUIDWrapper &&other)=delete
 

Protected Member Functions

virtual void sceneUpdate (U64 deltaTimeUS, SceneGraphNode *sgn, SceneState &sceneState)
 Called from SceneGraph "sceneUpdate".
 
virtual void postLoad (SceneGraphNode *sgn)
 
void setBounds (const BoundingBox &aabb, const vec3< F32 > &worldOffset={})
 
void registerEditorComponent (PlatformContext &context)
 
 PROPERTY_R (SceneNodeType, type, SceneNodeType::COUNT)
 
 PROPERTY_RW (bool, rebuildDrawCommands, false)
 
virtual void onNetworkSend (SceneGraphNode *sgn, WorldPacket &dataOut) const
 
virtual void onNetworkReceive (SceneGraphNode *sgn, WorldPacket &dataIn) const
 
- Protected Member Functions inherited from Divide::CachedResource
 PROPERTY_RW (ResourcePath, assetLocation)
 
 PROPERTY_RW (Str< 256 >, assetName)
 
 PROPERTY_R (size_t, descriptorHash)
 
virtual void setState (ResourceState currentState)
 

Protected Attributes

std::unique_ptr< EditorComponent_editorComponent
 
Handle< Material_materialTemplate = INVALID_HANDLE<Material>
 
SceneNodeRenderState _renderState
 The various states needed for rendering.
 
BoundingBox _boundingBox {}
 The initial bounding box as it was at object's creation (i.e. no transforms applied)
 
vec3< F32_worldOffset {}
 
bool _boundsChanged = false
 
- Protected Attributes inherited from Divide::CachedResource
Mutex _callbackLock {}
 
- Protected Attributes inherited from Divide::Resource
std::atomic< ResourceState_resourceState
 
- Protected Attributes inherited from Divide::GUIDWrapper
const I64 _guid
 

Private Attributes

U32 _requiredComponentMask = to_U32(ComponentType::TRANSFORM)
 

Friends

class Attorney::SceneNodePlayer
 
class Attorney::SceneNodeSceneGraph
 
class Attorney::SceneNodeLightComponent
 
class Attorney::SceneNodeBoundsSystem
 
class Attorney::SceneNodeNetworkComponent
 

Additional Inherited Members

- Static Public Member Functions inherited from Divide::GUIDWrapper
static I64 generateGUID () noexcept
 

Detailed Description

Definition at line 86 of file SceneNode.h.

Constructor & Destructor Documentation

◆ SceneNode()

Divide::SceneNode::SceneNode ( const ResourceDescriptorBase descriptor,
SceneNodeType  type,
U32  requiredComponentMask 
)
explicit

Definition at line 27 of file SceneNode.cpp.

◆ ~SceneNode()

Divide::SceneNode::~SceneNode ( )
overridevirtual

Definition at line 34 of file SceneNode.cpp.

Member Function Documentation

◆ buildDrawCommands()

void Divide::SceneNode::buildDrawCommands ( SceneGraphNode sgn,
GenericDrawCommandContainer cmdsOut 
)
virtual

Definition at line 115 of file SceneNode.cpp.

◆ editorComponent()

EditorComponent * Divide::SceneNode::editorComponent ( ) const
inlinenoexcept

Definition at line 131 of file SceneNode.h.

◆ getBounds()

const BoundingBox & Divide::SceneNode::getBounds ( ) const
inlinenoexcept

Definition at line 120 of file SceneNode.h.

◆ getMaterialTpl()

Handle< Material > Divide::SceneNode::getMaterialTpl ( ) const

Definition at line 73 of file SceneNode.cpp.

◆ getWorldOffset()

const vec3< F32 > & Divide::SceneNode::getWorldOffset ( ) const
inlinenoexcept

Definition at line 121 of file SceneNode.h.

◆ load()

bool Divide::SceneNode::load ( PlatformContext context)
overridevirtual

Loading and unloading interface.

Reimplemented from Divide::CachedResource.

Definition at line 98 of file SceneNode.cpp.

◆ loadCache()

bool Divide::SceneNode::loadCache ( ByteBuffer inputBuffer)
virtual

Definition at line 139 of file SceneNode.cpp.

◆ loadFromXML()

void Divide::SceneNode::loadFromXML ( const boost::property_tree::ptree &  pt)
virtual

Definition at line 164 of file SceneNode.cpp.

◆ onNetworkReceive()

void Divide::SceneNode::onNetworkReceive ( SceneGraphNode sgn,
WorldPacket dataIn 
) const
protectedvirtual

Definition at line 124 of file SceneNode.cpp.

◆ onNetworkSend()

void Divide::SceneNode::onNetworkSend ( SceneGraphNode sgn,
WorldPacket dataOut 
) const
protectedvirtual

Definition at line 120 of file SceneNode.cpp.

◆ postLoad() [1/2]

bool Divide::SceneNode::postLoad ( )
overridevirtual

Reimplemented from Divide::CachedResource.

Definition at line 103 of file SceneNode.cpp.

◆ postLoad() [2/2]

void Divide::SceneNode::postLoad ( SceneGraphNode sgn)
protectedvirtual

Definition at line 61 of file SceneNode.cpp.

◆ prepareRender()

void Divide::SceneNode::prepareRender ( SceneGraphNode sgn,
RenderingComponent rComp,
RenderPackage pkg,
GFX::MemoryBarrierCommand postDrawMemCmd,
RenderStagePass  renderStagePass,
const CameraSnapshot cameraSnapshot,
bool  refreshData 
)
virtual

Perform any pre-draw operations POST-command build If the node isn't ready for rendering and should be skipped this frame, the return value is false

Definition at line 50 of file SceneNode.cpp.

◆ PROPERTY_R()

Divide::SceneNode::PROPERTY_R ( SceneNodeType  ,
type  ,
SceneNodeType::COUNT   
)
protected

◆ PROPERTY_RW()

Divide::SceneNode::PROPERTY_RW ( bool  ,
rebuildDrawCommands  ,
false   
)
protected

◆ registerEditorComponent()

void Divide::SceneNode::registerEditorComponent ( PlatformContext context)
protected

Definition at line 39 of file SceneNode.cpp.

◆ renderState() [1/2]

const SceneNodeRenderState & Divide::SceneNode::renderState ( ) const
inlinenoexcept

Definition at line 118 of file SceneNode.h.

◆ renderState() [2/2]

SceneNodeRenderState & Divide::SceneNode::renderState ( )
inlinenoexcept

Definition at line 117 of file SceneNode.h.

◆ requiredComponentMask()

U32 Divide::SceneNode::requiredComponentMask ( ) const
inlinenoexcept

Definition at line 123 of file SceneNode.h.

◆ saveCache()

bool Divide::SceneNode::saveCache ( ByteBuffer outputBuffer) const
virtual

Definition at line 128 of file SceneNode.cpp.

◆ saveToXML()

void Divide::SceneNode::saveToXML ( boost::property_tree::ptree &  pt) const
virtual

Definition at line 156 of file SceneNode.cpp.

◆ sceneUpdate()

void Divide::SceneNode::sceneUpdate ( U64  deltaTimeUS,
SceneGraphNode sgn,
SceneState sceneState 
)
protectedvirtual

Called from SceneGraph "sceneUpdate".

Definition at line 44 of file SceneNode.cpp.

◆ setBounds()

void Divide::SceneNode::setBounds ( const BoundingBox aabb,
const vec3< F32 > &  worldOffset = {} 
)
protected

Definition at line 66 of file SceneNode.cpp.

◆ setMaterialTpl()

void Divide::SceneNode::setMaterialTpl ( Handle< Material material)
virtual

Definition at line 78 of file SceneNode.cpp.

◆ unload()

bool Divide::SceneNode::unload ( )
overridevirtual

Reimplemented from Divide::CachedResource.

Definition at line 108 of file SceneNode.cpp.

Friends And Related Function Documentation

◆ Attorney::SceneNodeBoundsSystem

friend class Attorney::SceneNodeBoundsSystem
friend

Definition at line 91 of file SceneNode.h.

◆ Attorney::SceneNodeLightComponent

friend class Attorney::SceneNodeLightComponent
friend

Definition at line 90 of file SceneNode.h.

◆ Attorney::SceneNodeNetworkComponent

Definition at line 92 of file SceneNode.h.

◆ Attorney::SceneNodePlayer

friend class Attorney::SceneNodePlayer
friend

Definition at line 88 of file SceneNode.h.

◆ Attorney::SceneNodeSceneGraph

friend class Attorney::SceneNodeSceneGraph
friend

Definition at line 89 of file SceneNode.h.

Member Data Documentation

◆ _boundingBox

BoundingBox Divide::SceneNode::_boundingBox {}
protected

The initial bounding box as it was at object's creation (i.e. no transforms applied)

Definition at line 159 of file SceneNode.h.

◆ _boundsChanged

bool Divide::SceneNode::_boundsChanged = false
protected

Definition at line 161 of file SceneNode.h.

◆ _editorComponent

std::unique_ptr<EditorComponent> Divide::SceneNode::_editorComponent
protected

Definition at line 152 of file SceneNode.h.

◆ _materialTemplate

Handle<Material> Divide::SceneNode::_materialTemplate = INVALID_HANDLE<Material>
protected

Definition at line 153 of file SceneNode.h.

◆ _renderState

SceneNodeRenderState Divide::SceneNode::_renderState
protected

The various states needed for rendering.

Definition at line 156 of file SceneNode.h.

◆ _requiredComponentMask

U32 Divide::SceneNode::_requiredComponentMask = to_U32(ComponentType::TRANSFORM)
private

Definition at line 164 of file SceneNode.h.

◆ _worldOffset

vec3<F32> Divide::SceneNode::_worldOffset {}
protected

Definition at line 160 of file SceneNode.h.


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