Plasma Engine  2.0
Loading...
Searching...
No Matches
plSceneContext Class Reference
Inheritance diagram for plSceneContext:

Public Member Functions

virtual void HandleMessage (const plEditorEngineDocumentMsg *pMsg) override
 
const plDeque< plGameObjectHandle > & GetSelection () const
 
const plDeque< plGameObjectHandle > & GetSelectionWithChildren () const
 
bool GetRenderSelectionOverlay () const
 
bool GetRenderShapeIcons () const
 
bool GetRenderSelectionBoxes () const
 
float GetGridDensity () const
 
bool IsGridInGlobalSpace () const
 
plTransform GetGridTransform () const
 
plGameStateBaseGetGameState () const
 
bool IsPlayTheGameActive () const
 
plUInt32 RegisterLayer (plLayerContext *pLayer)
 
void UnregisterLayer (plLayerContext *pLayer)
 
void AddLayerIndexTag (const plEntityMsgToEngine &msg, plWorldRttiConverterContext &ref_context, const plTag &layerTag)
 
const plArrayPtr< const plTagGetInvisibleLayerTags () const
 
plEngineProcessDocumentContextGetActiveDocumentContext ()
 
const plEngineProcessDocumentContextGetActiveDocumentContext () const
 
plWorldRttiConverterContextGetActiveContext ()
 
const plWorldRttiConverterContextGetActiveContext () const
 
plWorldRttiConverterContextGetContextForLayer (const plUuid &layerGuid)
 
plArrayPtr< plWorldRttiConverterContext * > GetAllContexts ()
 
- Public Member Functions inherited from plEngineProcessDocumentContext
 plEngineProcessDocumentContext (plBitflags< plEngineProcessDocumentContextFlags > flags)
 
virtual void Initialize (const plUuid &documentGuid, const plVariant &metaData, plEngineProcessCommunicationChannel *pIPC, plStringView sDocumentType)
 
void Deinitialize ()
 
plStringView GetDocumentType () const
 Returns the document type for which this context was created. Useful in case a context may be used for multiple document types.
 
void SendProcessMessage (plProcessMessage *pMsg=nullptr)
 
plBoundingBoxSphere GetWorldBounds (plWorld *pWorld)
 
void ProcessEditorEngineSyncObjectMsg (const plEditorEngineSyncObjectMsg &msg)
 
const plUuidGetDocumentGuid () const
 
virtual void Reset ()
 
void ClearExistingObjects ()
 
virtual plWorldRttiConverterContextGetContext ()
 
virtual const plWorldRttiConverterContextGetContext () const
 
plWorldGetWorld () const
 
- Public Member Functions inherited from plReflectedClass
virtual const plRTTIGetDynamicRTTI () const
 
bool IsInstanceOf (const plRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
 
template<typename T >
PL_ALWAYS_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.
 

Protected Member Functions

virtual void OnInitialize () override
 
virtual void OnDeinitialize () override
 
virtual plEngineProcessViewContextCreateViewContext () override
 Needs to be implemented to create a view context used for windows and thumbnails rendering.
 
virtual void DestroyViewContext (plEngineProcessViewContext *pContext) override
 Needs to be implemented to destroy the view context created in CreateViewContext.
 
virtual plStatus ExportDocument (const plExportDocumentMsgToEngine *pMsg) override
 Exports to current document resource to file. Make sure to write plAssetFileHeader at the start of it.
 
void ExportExposedParameters (const plWorldWriter &ww, plDeferredFileWriter &file) const
 
virtual bool UpdateThumbnailViewContext (plEngineProcessViewContext *pThumbnailViewContext) override
 Overwrite this function to apply the thumbnail render settings to the given context.
 
virtual void OnThumbnailViewContextCreated () override
 Called after a thumbnail context was created. Allows to insert code before the thumbnail is generated.
 
virtual void OnDestroyThumbnailViewContext () override
 Called before a thumbnail context is destroyed. Used for cleanup of what was done in OnThumbnailViewContextCreated()
 
virtual void UpdateDocumentContext () override
 A tick functions that allows each document context to do processing that continues over multiple frames and can't be handled in HandleMessage directly.
 
virtual plGameObjectHandle ResolveStringToGameObjectHandle (const void *pString, plComponentHandle hThis, plStringView sProperty) const override
 Tries to resolve a 'reference' (given in pData) to an plGameObject.
 
- Protected Member Functions inherited from plEngineProcessDocumentContext
virtual bool PendingOperationInProgress () const
 Should return true if this context has any operation in progress like thumbnail rendering and thus needs to continue rendering even if no new messages from the editor come in.
 
void UpdateSyncObjects ()
 
void CreateThumbnailViewContext (const plCreateThumbnailMsgToEngine *pMsg)
 Creates the thumbnail view context. It uses 'CreateViewContext' in combination with an off-screen render target.
 
void DestroyThumbnailViewContext ()
 Once a thumbnail is successfully rendered, the thumbnail view context is destroyed again.
 
virtual void OnThumbnailViewContextRequested ()
 Called before a thumbnail context is created.
 
void SetTagOnObject (const plUuid &object, const char *szTag, bool bSet, bool recursive)
 Sets or removes the given tag on the object and optionally all children.
 
void SetTagRecursive (plGameObject *pObject, const plTag &tag)
 Sets the given tag on the object and all children.
 
void ClearTagRecursive (plGameObject *pObject, const plTag &tag)
 Clears the given tag on the object and all children.
 
const plEngineProcessViewContextGetViewContext (plUInt32 uiView) const
 

Additional Inherited Members

- Static Public Member Functions inherited from plEngineProcessDocumentContext
static plEngineProcessDocumentContextGetDocumentContext (plUuid guid)
 
static void AddDocumentContext (plUuid guid, const plVariant &metaData, plEngineProcessDocumentContext *pView, plEngineProcessCommunicationChannel *pIPC, plStringView sDocumentType)
 
static bool PendingOperationsInProgress ()
 
static void UpdateDocumentContexts ()
 
static void DestroyDocumentContext (plUuid guid)
 
- Static Public Member Functions inherited from plNoBase
static const plRTTIGetStaticRTTI ()
 
- Public Attributes inherited from plEngineProcessDocumentContext
plIPCObjectMirrorEngine m_Mirror
 
plWorldRttiConverterContext m_Context
 
- Protected Attributes inherited from plEngineProcessDocumentContext
plWorldm_pWorld = nullptr
 
plBitflags< plEngineProcessDocumentContextFlagsm_Flags
 
plUuid m_DocumentGuid
 
plVariant m_MetaData
 
plEngineProcessCommunicationChannelm_pIPC = nullptr
 
plHybridArray< plEngineProcessViewContext *, 4 > m_ViewContexts
 
plMap< plUuid, plEditorEngineSyncObject * > m_SyncObjects
 

Member Function Documentation

◆ CreateViewContext()

plEngineProcessViewContext * plSceneContext::CreateViewContext ( )
overrideprotectedvirtual

Needs to be implemented to create a view context used for windows and thumbnails rendering.

Implements plEngineProcessDocumentContext.

◆ DestroyViewContext()

void plSceneContext::DestroyViewContext ( plEngineProcessViewContext * pContext)
overrideprotectedvirtual

Needs to be implemented to destroy the view context created in CreateViewContext.

Implements plEngineProcessDocumentContext.

◆ ExportDocument()

plStatus plSceneContext::ExportDocument ( const plExportDocumentMsgToEngine * pMsg)
overrideprotectedvirtual

Exports to current document resource to file. Make sure to write plAssetFileHeader at the start of it.

Reimplemented from plEngineProcessDocumentContext.

◆ HandleMessage()

void plSceneContext::HandleMessage ( const plEditorEngineDocumentMsg * pMsg)
overridevirtual

Reimplemented from plEngineProcessDocumentContext.

◆ OnDeinitialize()

void plSceneContext::OnDeinitialize ( )
overrideprotectedvirtual

Reimplemented from plEngineProcessDocumentContext.

◆ OnDestroyThumbnailViewContext()

void plSceneContext::OnDestroyThumbnailViewContext ( )
overrideprotectedvirtual

Called before a thumbnail context is destroyed. Used for cleanup of what was done in OnThumbnailViewContextCreated()

Reimplemented from plEngineProcessDocumentContext.

◆ OnInitialize()

void plSceneContext::OnInitialize ( )
overrideprotectedvirtual

Reimplemented from plEngineProcessDocumentContext.

◆ OnThumbnailViewContextCreated()

void plSceneContext::OnThumbnailViewContextCreated ( )
overrideprotectedvirtual

Called after a thumbnail context was created. Allows to insert code before the thumbnail is generated.

Reimplemented from plEngineProcessDocumentContext.

◆ ResolveStringToGameObjectHandle()

plGameObjectHandle plSceneContext::ResolveStringToGameObjectHandle ( const void * pData,
plComponentHandle hThis,
plStringView sComponentProperty ) const
overrideprotectedvirtual

Tries to resolve a 'reference' (given in pData) to an plGameObject.

Tries to resolve a 'reference' (given in pData) to an plGameObject. hThis is the 'owner' of the reference and szComponentProperty is the name of the reference property in that component.

There are two different use cases:

1) hThis is invalid and szComponentProperty is null:

This is used by plPrefabReferenceComponent::SerializeComponent() to check whether a string represents a game object reference. It may be any arbitrary string and thus must not assert. In this case a reference is always a stringyfied GUID. Since this is only used for scene export, only the lookup shall be done and nothing else.

2) hThis and szComponentProperty represent a valid component+property combination:

This is called at edit time whenever a reference property is queried, which also happens whenever a reference is modified. In this case we need to maintain two maps: one that know which object references which other objects one that knows by which other objects an object is referenced These are needed to fix up references during undo/redo when objects get deleted and recreated. Ie. when an object that has references or is referenced gets deleted and then undo restores it, the references should appear as well.

Reimplemented from plEngineProcessDocumentContext.

◆ UpdateDocumentContext()

void plSceneContext::UpdateDocumentContext ( )
overrideprotectedvirtual

A tick functions that allows each document context to do processing that continues over multiple frames and can't be handled in HandleMessage directly.

Make sure to call the base implementation when overwriting as this handles the thumbnail rendering that takes multiple frames to complete.

Reimplemented from plEngineProcessDocumentContext.

◆ UpdateThumbnailViewContext()

bool plSceneContext::UpdateThumbnailViewContext ( plEngineProcessViewContext * pThumbnailViewContext)
overrideprotectedvirtual

Overwrite this function to apply the thumbnail render settings to the given context.

Return false if you need more frames to be rendered to setup everything correctly. If true is returned for 'ThumbnailConvergenceFramesTarget' frames in a row the thumbnail image is taken. This is to allow e.g. camera updates after more resources have been streamed in. The frame counter will start over to count to 'ThumbnailConvergenceFramesTarget' when a new resource is being loaded to make sure we do not make an image of half-streamed in data.

Reimplemented from plEngineProcessDocumentContext.


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