|
| Scene (Context *context) |
| Construct.
|
|
| ~Scene () override |
| Destruct.
|
|
void | SetManualUpdate (bool enabled) |
| Set whether the scene is updated manually by external code.
|
|
bool | CreateComponentIndex (StringHash componentType) |
| Create component index. Scene must be empty.
|
|
template<class T > |
void | CreateComponentIndex () |
| Create component index for template type. Scene must be empty.
|
|
const SceneComponentIndex & | GetComponentIndex (StringHash componentType) |
| Return component index. Iterable. Invalidated when indexed component is added or removed!
|
|
template<class T > |
const SceneComponentIndex & | GetComponentIndex () |
| Return component index for template type. Invalidated when indexed component is added or removed!
|
|
void | SerializeInBlock (Archive &archive) override |
| Serialize object. May throw ArchiveException.
|
|
void | SerializeInBlock (Archive &archive, bool serializeTemporary, PrefabSaveFlags saveFlags, PrefabLoadFlags loadFlags) |
|
bool | Load (Deserializer &source) override |
| Load from binary data. Removes all existing child nodes and components first. Return true if successful.
|
|
bool | Save (Serializer &dest) const override |
| Save to binary data. Return true if successful.
|
|
bool | LoadXML (const XMLElement &source) override |
| Load from XML data. Removes all existing child nodes and components first. Return true if successful.
|
|
bool | LoadJSON (const JSONValue &source) override |
| Load from JSON data. Removes all existing child nodes and components first. Return true if successful.
|
|
unsigned | GetNumLightmaps () const |
| Return number of lightmaps.
|
|
void | ResetLightmaps () |
| Reset lightmaps.
|
|
void | AddLightmap (const ea::string &lightmapTextureName) |
| Add lightmap texture.
|
|
Texture2D * | GetLightmapTexture (unsigned index) const |
| Return lightmap texture.
|
|
void | SetUpdateEvents (const StringVector &events) |
| Set update events.
|
|
const StringVector & | GetUpdateEvents () const |
| Return update events.
|
|
bool | LoadXML (Deserializer &source) |
| Load from an XML file. Return true if successful.
|
|
bool | LoadJSON (Deserializer &source) |
| Load from a JSON file. Return true if successful.
|
|
bool | SaveXML (Serializer &dest, const ea::string &indentation="\t") const |
| Save to an XML file. Return true if successful.
|
|
bool | SaveJSON (Serializer &dest, const ea::string &indentation="\t") const |
| Save to a JSON file. Return true if successful.
|
|
bool | LoadAsync (AbstractFilePtr file, LoadMode mode=LOAD_SCENE_AND_RESOURCES) |
| Load from a binary file asynchronously. Return true if started successfully. The LOAD_RESOURCES_ONLY mode can also be used to preload resources from object prefab files.
|
|
bool | LoadAsyncXML (AbstractFilePtr file, LoadMode mode=LOAD_SCENE_AND_RESOURCES) |
| Load from an XML file asynchronously. Return true if started successfully. The LOAD_RESOURCES_ONLY mode can also be used to preload resources from object prefab files.
|
|
bool | LoadAsyncJSON (AbstractFilePtr file, LoadMode mode=LOAD_SCENE_AND_RESOURCES) |
| Load from a JSON file asynchronously. Return true if started successfully. The LOAD_RESOURCES_ONLY mode can also be used to preload resources from object prefab files.
|
|
void | StopAsyncLoading () |
| Stop asynchronous loading.
|
|
Node * | Instantiate (Deserializer &source, const Vector3 &position, const Quaternion &rotation) |
| Instantiate scene content from binary data. Return root node if successful.
|
|
Node * | InstantiateXML (const XMLElement &source, const Vector3 &position, const Quaternion &rotation) |
| Instantiate scene content from XML data. Return root node if successful.
|
|
Node * | InstantiateXML (Deserializer &source, const Vector3 &position, const Quaternion &rotation) |
| Instantiate scene content from XML data. Return root node if successful.
|
|
Node * | InstantiateJSON (const JSONValue &source, const Vector3 &position, const Quaternion &rotation) |
| Instantiate scene content from JSON data. Return root node if successful.
|
|
Node * | InstantiateJSON (Deserializer &source, const Vector3 &position, const Quaternion &rotation) |
| Instantiate scene content from JSON data. Return root node if successful.
|
|
void | Clear () |
| Clear scene completely.
|
|
void | SetUpdateEnabled (bool enable) |
|
void | SetTimeScale (float scale) |
|
void | SetElapsedTime (float time) |
|
void | SetAsyncLoadingMs (int ms) |
|
void | AddRequiredPackageFile (PackageFile *package) |
| Add a required package file for networking. To be called on the server.
|
|
void | ClearRequiredPackageFiles () |
| Clear required package files.
|
|
void | SetFileName (const ea::string_view fileName) |
| Set source file name.
|
|
bool | IsEmpty (bool ignoreComponents=false) const |
| Return whether the Scene is empty.
|
|
Node * | GetNode (unsigned id) const |
| Return node from the whole scene by ID, or null if not found.
|
|
Component * | GetComponent (unsigned id) const |
| Return component from the whole scene by ID, or null if not found.
|
|
bool | GetNodesWithTag (ea::vector< Node * > &dest, const ea::string &tag) const |
| Get nodes with specific tag from the whole scene, return false if empty.
|
|
bool | IsUpdateEnabled () const |
|
bool | IsAsyncLoading () const |
|
float | GetAsyncProgress () const |
|
LoadMode | GetAsyncLoadMode () const |
|
const ea::string & | GetFileName () const |
|
unsigned | GetChecksum () const |
|
float | GetTimeScale () const |
|
float | GetEffectiveTimeScale () const |
|
float | GetElapsedTime () const |
|
int | GetAsyncLoadingMs () const |
|
const ea::vector< SharedPtr< PackageFile > > & | GetRequiredPackageFiles () const |
|
const ea::unordered_map< unsigned, Node * > & | GetAllNodes () const |
| Return all nodes parented by this Scene.
|
|
const ea::unordered_map< unsigned, Component * > & | GetAllComponents () const |
| Return all components parented by this Scene.
|
|
void | Update (float timeStep) |
| Update scene. Called by HandleUpdate.
|
|
void | BeginThreadedUpdate () |
| Begin a threaded update. During threaded update components can choose to delay dirty processing.
|
|
void | EndThreadedUpdate () |
| End a threaded update. Notify components that marked themselves for delayed dirty processing.
|
|
void | DelayedMarkedDirty (Component *component) |
| Add a component to the delayed dirty notify queue. Is thread-safe.
|
|
bool | IsThreadedUpdate () const |
| Return threaded update flag.
|
|
unsigned | GetFreeNodeID () |
| Get free node ID.
|
|
unsigned | GetFreeComponentID () |
| Get free component ID.
|
|
void | NodeTagAdded (Node *node, const ea::string &tag) |
| Cache node by tag if tag not zero, no checking if already added. Used internaly in Node::AddTag.
|
|
void | NodeTagRemoved (Node *node, const ea::string &tag) |
| Cache node by tag if tag not zero.
|
|
void | NodeAdded (Node *node) |
| Node added. Assign scene pointer and add to ID map.
|
|
void | NodeRemoved (Node *node) |
| Node removed. Remove from ID map.
|
|
void | ComponentAdded (Component *component) |
| Component added. Add to ID map.
|
|
void | ComponentRemoved (Component *component) |
| Component removed. Remove from ID map.
|
|
|
| URHO3D_OBJECT (Scene, Node) |
|
void | HandleUpdate (StringHash eventType, VariantMap &eventData) |
| Handle the logic update event to update the scene, if active.
|
|
void | HandleResourceBackgroundLoaded (StringHash eventType, VariantMap &eventData) |
| Handle a background loaded resource completing.
|
|
void | UpdateAsyncLoading () |
| Update asynchronous loading.
|
|
void | FinishAsyncLoading () |
| Finish asynchronous loading.
|
|
void | FinishLoading (Deserializer *source) |
| Finish loading. Sets the scene filename and checksum.
|
|
void | FinishSaving (Serializer *dest) const |
| Finish saving. Sets the scene filename and checksum.
|
|
void | PreloadResources (AbstractFilePtr file, bool isSceneFile) |
| Preload resources from a binary scene or object prefab file.
|
|
void | PreloadResourcesXML (const XMLElement &element) |
| Preload resources from an XML scene or object prefab file.
|
|
void | PreloadResourcesJSON (const JSONValue &value) |
| Preload resources from a JSON scene or object prefab file.
|
|
SceneComponentIndex * | GetMutableComponentIndex (StringHash componentType) |
| Return component index storage for given type.
|
|
void | ReloadLightmaps () |
| Reload lightmap textures.
|
|
|
ea::vector< StringHash > | indexedComponentTypes_ |
| Types of components that should be indexed.
|
|
ea::vector< SceneComponentIndex > | componentIndexes_ |
| Indexes of components.
|
|
ea::unordered_map< unsigned, Node * > | replicatedNodes_ |
| Replicated scene nodes by ID.
|
|
ea::unordered_map< unsigned, Component * > | replicatedComponents_ |
| Replicated components by ID.
|
|
ea::unordered_map< StringHash, ea::vector< Node * > > | taggedNodes_ |
| Cached tagged nodes by tag.
|
|
AsyncProgress | asyncProgress_ |
| Asynchronous loading progress.
|
|
SceneResolver | resolver_ |
| Node and component ID resolver for asynchronous loading.
|
|
ea::string | fileName_ |
| Source file name.
|
|
ea::vector< SharedPtr< PackageFile > > | requiredPackageFiles_ |
| Required package files for networking.
|
|
ea::vector< Component * > | delayedDirtyComponents_ |
| Delayed dirty notification queue for components.
|
|
Mutex | sceneMutex_ |
| Mutex for the delayed dirty notification queue.
|
|
unsigned | replicatedNodeID_ |
| Next free non-local node ID.
|
|
unsigned | replicatedComponentID_ |
| Next free non-local component ID.
|
|
unsigned | checksum_ |
| Scene source file checksum.
|
|
int | asyncLoadingMs_ |
| Maximum milliseconds per frame to spend on async scene loading.
|
|
float | timeScale_ |
| Scene update time scale.
|
|
float | elapsedTime_ |
| Elapsed time accumulator.
|
|
bool | updateEnabled_ |
| Update enabled flag.
|
|
bool | manualUpdate_ {} |
| Whether update is invoked manually.
|
|
bool | asyncLoading_ |
| Asynchronous loading flag.
|
|
bool | threadedUpdate_ |
| Threaded update flag.
|
|
ResourceRefList | lightmaps_ |
| Lightmap textures names.
|
|
ea::vector< SharedPtr< Texture2D > > | lightmapTextures_ |
| Loaded lightmap textures.
|
|
StringVector | updateEvents_ |
| Update events to be sent on every update.
|
|
ea::vector< ea::pair< StringHash, bool > > | cookedUpdateEvents_ |
|
Root scene node, represents the whole scene.