Group |
public void DisposeAllChildren( bool disposeMeshes, bool disposeMaterials, bool disposeTextures = true, bool runSceneCleanup = false )
DisposeAllChildren method disposes all child SceneNodes objects. If child is a GroupNode, then its children will be also disposed.
This method does not dispose this GroupNode. Therefore it is allowed to call this method on RootNode. To also dispose this GroupNode, call the DisposeWithAllChildren(Boolean, Boolean, Boolean, Boolean) method instead.
When disposeMeshes and disposeMaterials parameters are true, then also all meshes and materials are disposed.
When disposeThisGroupNode is true (false by default), then this GroupNode is also disposed. When GroupNode does not have any children it does not have any resources and therefore in this case it is not needed to dispose the GroupNode. Note that RootNode must not be disposed.
When runSceneCleanup parameter is true (false by default), this method also calls the Cleanup(Boolean, Boolean, Boolean, Boolean, Boolean) method with default parameters to clean the released objects.
To dispose only some children call DisposeChildren(Int32, Int32, Boolean, Boolean, Boolean, Boolean) method that takes startIndex and count as parameters.
The difference between this method and the standard Dispose(Boolean) method is that with standard dispose method you cannot force mesh and material disposal. In this case the mesh is disposed only when it is created by the SceneNode (for example in PyramidModelNode or LineNode) and not when it is set to the MeshModelNode (for example with ReaderObj or Assimp importer). Also Material and BackMaterial are disposed only when they are created by the SceneNode (for example when LineNode is created by specifying the line color) and not when new StandardMaterial is created and set to ModelNode's Material property.