|
| Scene (Context *context) |
| Construct.
|
|
| ~Scene () override |
| Destruct.
|
|
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.
|
|
Root scene node, represents the whole scene.