Diligent Engine
Loading...
Searching...
No Matches
Diligent::IRadientSceneWriter Struct Referenceabstract

#include <RadientSceneWriter.h>

Inheritance diagram for Diligent::IRadientSceneWriter:
Diligent.IObject

Public Member Functions

virtual IRadientScene *DILIGENT_CALL_TYPE GetScene () const =0
virtual RADIENT_STATUS DILIGENT_CALL_TYPE CreateEntity (const RadientEntityDesc &Desc, RadientEntityID &Entity)=0
virtual RADIENT_STATUS DILIGENT_CALL_TYPE DestroyEntity (RadientEntityID Entity)=0
virtual RADIENT_STATUS DILIGENT_CALL_TYPE SetEntityName (RadientEntityID Entity, const Char *Name)=0
virtual RADIENT_STATUS DILIGENT_CALL_TYPE SetEntityFlags (RadientEntityID Entity, RADIENT_ENTITY_FLAGS Flags)=0
 Sets entity flags.
virtual RADIENT_STATUS DILIGENT_CALL_TYPE SetEntityOwnVisibility (RadientEntityID Entity, Bool Visible)=0
 Sets entity's own visibility flag.
virtual RADIENT_STATUS DILIGENT_CALL_TYPE SetParent (RadientEntityID Entity, RadientEntityID Parent, Bool KeepWorldTransform=True)=0
virtual RADIENT_STATUS DILIGENT_CALL_TYPE SetLocalTransform (RadientEntityID Entity, const RadientTransform &Transform)=0
virtual RADIENT_STATUS DILIGENT_CALL_TYPE SetCamera (RadientEntityID Entity, const RadientCameraComponent &Camera)=0
 Adds or updates a camera component.
virtual RADIENT_STATUS DILIGENT_CALL_TYPE SetMesh (RadientEntityID Entity, const RadientMeshComponent &Mesh)=0
virtual RADIENT_STATUS DILIGENT_CALL_TYPE SetSkin (RadientEntityID Entity, const RadientSkinComponent &Skin)=0
 Adds or updates a skin component.
virtual RADIENT_STATUS DILIGENT_CALL_TYPE SetMorph (RadientEntityID Entity, const RadientMorphComponent &Morph)=0
virtual RADIENT_STATUS DILIGENT_CALL_TYPE SetMeshRenderer (RadientEntityID Entity, const RadientMeshRendererComponent &Renderer)=0
 Adds or updates a mesh renderer component.
virtual RADIENT_STATUS DILIGENT_CALL_TYPE SetMaterialBindings (RadientEntityID Entity, const RadientMaterialBindingsComponent &Bindings)=0
 Adds or updates per-primitive material overrides.
virtual RADIENT_STATUS DILIGENT_CALL_TYPE SetLight (RadientEntityID Entity, const RadientLightComponent &Light)=0
 Adds or updates a light component.
virtual RADIENT_STATUS DILIGENT_CALL_TYPE SetCustomComponentData (RadientEntityID Entity, const RadientCustomComponentData &Component)=0
 Adds or updates a custom serialized component.
virtual RADIENT_STATUS DILIGENT_CALL_TYPE RemoveComponent (RadientEntityID Entity, RadientComponentTypeID ComponentType)=0
virtual RADIENT_STATUS DILIGENT_CALL_TYPE CommitChanges ()=0
Public Member Functions inherited from Diligent.IObject
virtual void DILIGENT_CALL_TYPE QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0
 Queries the specific interface.
template<typename DerivedType, typename = typename std::enable_if<std::is_base_of<IObject, DerivedType>::value>::type>
void QueryInterface (const INTERFACE_ID &IID, DerivedType **ppInterface)
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE AddRef ()=0
 Increments the number of strong references by 1.
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE Release ()=0
virtual IReferenceCounters *DILIGENT_CALL_TYPE GetReferenceCounters () const =0

Detailed Description

Scene graph mutation interface.

Entity and component edits immediately modify the shared scene state and update the relevant revisions. All writers for a scene operate on that same state; they do not keep isolated copies or pending transactions. Access follows the external synchronization requirements documented by IRadientScene.

Radient-created writers expose IID_RadientAnimationDestination through QueryInterface() for batched scene node, light-component, and camera-component animation. Each RadientAnimationPropertyBindingDesc::DestinationElement is a RadientEntityID. No method on any writer for the same scene may be called between a successful animation destination binding BeginUpdate() and its matching EndUpdate().

Member Function Documentation

◆ CommitChanges()

virtual RADIENT_STATUS DILIGENT_CALL_TYPE Diligent::IRadientSceneWriter::CommitChanges ( )
pure virtual

Updates dirty world transforms and effective visibility, including affected descendants, for changes made through any writer for this scene. Entity and component edits and their revision updates are already visible before this call. This method does not submit work to the backend, publish a transaction, or synchronize concurrent scene access. Call after a batch of edits and before rendering or reading cached derived state to ensure that world transforms and effective visibility are current.

◆ CreateEntity()

virtual RADIENT_STATUS DILIGENT_CALL_TYPE Diligent::IRadientSceneWriter::CreateEntity ( const RadientEntityDesc & Desc,
RadientEntityID & Entity )
pure virtual

Creates an entity. All position, rotation, and scale components in Desc.Transform must be finite. Otherwise, returns RADIENT_STATUS_INVALID_ARGUMENT, sets Entity to InvalidRadientEntityID, and leaves the scene unchanged.

◆ DestroyEntity()

virtual RADIENT_STATUS DILIGENT_CALL_TYPE Diligent::IRadientSceneWriter::DestroyEntity ( RadientEntityID Entity)
pure virtual

Destroys the entity, its entire descendant subtree, and all their components. All entity IDs in the subtree become invalid immediately. Returns RADIENT_STATUS_NOT_FOUND if Entity is not alive.

◆ GetScene()

virtual IRadientScene *DILIGENT_CALL_TYPE Diligent::IRadientSceneWriter::GetScene ( ) const
pure virtual

Returns the scene modified by this writer. The returned pointer is borrowed and remains valid for the writer lifetime.

◆ RemoveComponent()

virtual RADIENT_STATUS DILIGENT_CALL_TYPE Diligent::IRadientSceneWriter::RemoveComponent ( RadientEntityID Entity,
RadientComponentTypeID ComponentType )
pure virtual

Removes a component from the entity. Removing RADIENT_COMPONENT_TYPE_MESH also removes the entity's morph component. The transform is mandatory: requesting removal of RADIENT_COMPONENT_TYPE_TRANSFORM from a live entity returns RADIENT_STATUS_INVALID_OPERATION.

◆ SetEntityName()

virtual RADIENT_STATUS DILIGENT_CALL_TYPE Diligent::IRadientSceneWriter::SetEntityName ( RadientEntityID Entity,
const Char * Name )
pure virtual

Sets the entity name, copying the string during the call. Null and empty names are stored as an empty string. Names need not be unique. Returns RADIENT_STATUS_NOT_FOUND if Entity is not alive, RADIENT_STATUS_NO_CHANGE if the name is unchanged, or RADIENT_STATUS_OK if it changed. The new name is visible through GetEntityName() immediately, without requiring CommitChanges().

◆ SetLocalTransform()

virtual RADIENT_STATUS DILIGENT_CALL_TYPE Diligent::IRadientSceneWriter::SetLocalTransform ( RadientEntityID Entity,
const RadientTransform & Transform )
pure virtual

Sets the local transform. Returns RADIENT_STATUS_NOT_FOUND if Entity is not alive. All position, rotation, and scale components must be finite. Otherwise, returns RADIENT_STATUS_INVALID_ARGUMENT without changing the scene.

◆ SetMesh()

virtual RADIENT_STATUS DILIGENT_CALL_TYPE Diligent::IRadientSceneWriter::SetMesh ( RadientEntityID Entity,
const RadientMeshComponent & Mesh )
pure virtual

Adds or updates a mesh component. Replacing the mesh removes an existing morph component if its weights belong to a different mesh.

◆ SetMorph()

virtual RADIENT_STATUS DILIGENT_CALL_TYPE Diligent::IRadientSceneWriter::SetMorph ( RadientEntityID Entity,
const RadientMorphComponent & Morph )
pure virtual

Adds or updates a morph component. The weights must belong to the mesh currently assigned to the entity.

◆ SetParent()

virtual RADIENT_STATUS DILIGENT_CALL_TYPE Diligent::IRadientSceneWriter::SetParent ( RadientEntityID Entity,
RadientEntityID Parent,
Bool KeepWorldTransform = True )
pure virtual

Sets the entity parent. If KeepWorldTransform is true, the world transform is preserved exactly only when the resulting local matrix can be represented as translation, rotation, and scale.