Scene Methods |
The Scene type exposes the following members.
Name | Description | |
---|---|---|
AddAnimation | Adds the specified animation to the list of animations that are updated in each update phase. | |
AddRenderingLayerAfter | Adds the newRenderLayer after the already registered afterRenderLayer. If rendering layer is MaterialSortedRenderingLayer or CameraDistanceSortedRenderingLayer, then also its IsSortingEnabled property is set according to the current settings. | |
AddRenderingLayerBefore | Adds the newRenderLayer before the already registered afterRenderLayer | |
CacheObject | CacheObject sets the specified objectToCache to the specified key in the cache. The value can be retrieved by GetCachedObjectT(String) or removed by RemoveCachedObject(String) method. When a Mesh object is cached, this will set IsSceneCached to true and prevent disposing the mesh (by calling Dispose method) before the Scene is disposed or before the mesh is removed from the cache. Mesh and GpuImage objects can be cached only in one Scene object. This method is thread safe and can be called from any thread. | |
Cleanup | Cleanup method can perform various cleanup actions. It can dispose the SceneNodes (and their meshes and materials) that were removed from the RootNode. It can dispose GPU resources that were scheduled to be disposed after a frame has been rendered. It can also check all memory blocks and free those that are empty (if freeEmptyMemoryBlocks is true or when it empty for at least EngineRuntimeOptions.FramesCountToReleaseEmptyMemoryBlock frames). | |
CollectAmbientLightColor | CollectAmbientLightColor returns a Color3 that specifies the ambient color (can be combined by multiple AmbientLight objects). | |
CreateBackgroundSpriteBatch | Creates a SpriteBatch that will be rendered before the objects in this Scene are rendered. SpriteBatch that is created from Scene object can use only relative coordinates. To use absolute coordinates, call SceneView.CreateBackgroundSpriteBatch(String) or SceneView.CreateOverlaySpriteBatch(String) methods. To remove the created SpriteBatch call the RemoveSpriteBatch(SpriteBatch, Boolean) or RemoveAllSpriteBatches(Boolean) methods. It is also possible to add sprites that are rendered only with a specific SceneView - in this case call SceneView.CreateBackgroundSpriteBatch(String) or SceneView.CreateOverlaySpriteBatch(String) methods. | |
CreateOverlaySpriteBatch | Creates a SpriteBatch that will be rendered after the objects in this Scene are rendered. SpriteBatch that is created from Scene object can use only relative coordinates. To use absolute coordinates, call SceneView.CreateBackgroundSpriteBatch(String) or SceneView.CreateOverlaySpriteBatch(String) methods. To remove the created SpriteBatch call the RemoveSpriteBatch(SpriteBatch, Boolean) or RemoveAllSpriteBatches(Boolean) methods. It is also possible to add sprites that are rendered only with a specific SceneView - in this case call SceneView.CreateBackgroundSpriteBatch(String) or SceneView.CreateOverlaySpriteBatch(String) methods. | |
Dispose | Dispose | |
Dispose(Boolean) |
Releases unmanaged and managed resources (when disposing is true).
This method may be called only from the CheckAndDispose(Boolean) method and must not be called manually by the user.
(Overrides ComponentBaseDispose(Boolean)) | |
DumpFullMemoryUsage | Writes string that shows full memory usage for this Scene, its GpuDevice and all used effects to the console (when the application is debugged in Visual Studio the result is written to Output window or Immediate Window if started from there; in Rider the result is written to Debug Output window). | |
DumpRenderingLayers | Writes string that contains details about each RenderingItem in all RenderingLayers to the console (when the application is debugged in Visual Studio the result is written to Output window or Immediate Window if started from there; in Rider the result is written to Debug Output window). | |
DumpSceneNodes | Writes string that contains details about all SceneNodes and their hierarchy to the console (when the application is debugged in Visual Studio the result is written to Output window or Immediate Window if started from there; in Rider the result is written to Debug Output window). | |
DumpUsedMaterials | Writes string that provides details about used materials to the console (when the application is debugged in Visual Studio the result is written to Output window or Immediate Window if started from there; in Rider the result is written to Debug Output window). | |
GetAllHitObjects | GetAllHitObjects method executes a hit testing on the SceneNodes in this Scene (or when specified on rootSceneNode and its children) and returns a list of RayHitTestResult objects sorted from the closest to the farthest object. When no object is hit, an empty list is returned. | |
GetAmbientLightColor | Returns the Color3 of the ambient light that is used in this scene. When Black is returned, then no ambient light is used. When multiple AmbientLight objects are added to the Light collection, then their colors are summed. | |
GetAmbientLightIntensity | Returns the float that represents the intensity of the ambient light that is used in this scene. The returned value is between 0 (no ambient light) and 1 (full ambient light). When multiple AmbientLight objects are added to the Light collection, then their intensities are summed. | |
GetCachedObjectT | GetCachedObject gets the object that was previously stored by the CacheObject(String, Object) method. If the key is not found a default value of T (null for reference types) is returned. This method is thread safe and can be called from any thread. | |
GetCachedObjectsReportString | Returns a string that shows which objects are cached by this Scene. | |
GetClosestHitObject | GetClosestHitObject method executes a hit testing on the SceneNodes in this Scene (or when specified on rootSceneNode and its children) and returns a RayHitTestResult object with the closest triangle hit by the specified ray. When no triangle is hit, null is returned. | |
GetCoordinateSystem | Gets the currently selected coordinate system. | |
GetCoordinateSystemInvertedTransform | Get null when YUpRightHanded coordinate system is used. Otherwise a MatrixTransform that has an inverted global transform matrix is returned. | |
GetCoordinateSystemTransform | Get null when YUpRightHanded coordinate system is used. Otherwise a MatrixTransform is assigned to RootNode.Transform is returned. That MatrixTransform converts all the positions in the Scene from the selected coordinate system to YUpRightHanded is returned. Note that it is not allowed to change the returned MatrixTransform. | |
GetFullMemoryUsageInfo | Returns a string that shows full memory usage for this Scene, its GpuDevice and all used effects. | |
GetHitSceneNodeBounds | GetHitSceneNodeBounds returns a List of SceneNode objects where the ray intersects the BoundingBox of the SceneNode. | |
GetIntoTheScreenVector | Returns the vector that points into the screen. This vector is based on the current coordinate system. When using default (YUpRightHanded) then (0, 0, -1) is returned. | |
GetRegisteredEffectsInfo | Returns a string that contains details about all registered effects. | |
GetRenderingLayersInfo | Returns string that describes each RenderingItem in all RenderingLayers. | |
GetRightDirectionVector | Returns the vector that points to the right in the current coordinate system. (1, 0, 0) is returned for all coordinate systems. | |
GetSceneMemoryInfo | Returns string that shows memory usage for MatricesMemoryBlocks that are used in this Scene. | |
GetSceneNodesInfo | Returns string that contains details about all SceneNodes and their hierarchy. | |
GetUpVector | Returns the vector that points up. This vector is based on the current coordinate system. When using default (YUpRightHanded) then (0, 1, 0) is returned. | |
GetUsedMaterialsInfo | Returns a string that provides details about used materials | |
HitTestSceneNode | Returns RayHitTestResult if the specified ray hits the specified sceneNode. Otherwise, null is returned. Child SceneNodes are not tested. | |
Initialize | Initialized the Scene by using the specified VulkanDevice. | |
NotifyChange | NotifyChange method adds the specified ChangeNotifications to the changes flags of this Scene. | |
OnSceneInitialized | OnSceneInitialized | |
RemoveAllSpriteBatches | Removes all SpriteBatches. | |
RemoveAnimation | Remove the specified animation from the list of animations. | |
RemoveCachedObject | RemoveCachedObject removes the specified key from the cache. When a Mesh object is removed from the cache, this will set IsSceneCached to false and allow disposing the mesh by calling the Dispose method. This method is thread safe and can be called from any thread. | |
RemoveRenderingLayer | Removes the renderingLayer that was added before by the AddRenderingLayerAfter(RenderingLayer, RenderingLayer) or AddRenderingLayerBefore(RenderingLayer, RenderingLayer) methods. | |
RemoveSpriteBatch | Removes the specified SpriteBatch from the list of SpriteBatches associated to this Scene (created by CreateBackgroundSpriteBatch(String) or CreateOverlaySpriteBatch(String) methods). | |
SetAmbientLight(Color3) | Sets the ambient light for this scene to the specified color. | |
SetAmbientLight(Single) | Sets the ambient light for this scene to the specified intensity (from 0 to 1). | |
SetCoordinateSystem | SetCoordinateSystem method can be used to change the coordinate system from the default YUpRightHanded coordinate system (y up, x to the right, z out of the screen) to some other coordinate system, for example to ZUpRightHanded that is usually used for CAD applications. | |
SortRenderingLayers | SortRenderingLayers method performs sorting of items in the rendering layers that support sorting | |
ToString | (Overrides ObjectToString) | |
Update | Update method can be called to update the changed materials and SceneNodes that are attached to the RootNode. This method also clears the DirtyFlags. This method is usually called from SceneView's Render(Boolean, Boolean, Boolean) method. It can be also called before hit-testing to update the scene. | |
UpdateAnimations | Update all animations that are added by calling the AddAnimation(IAnimation) (this is done automatically by the animation classes). | |
UpdateGpuBuffers | UpdateGpuBuffers method checks if the scene, camera, lights or matrices data were changed and in this case updates the appropriate buffer based on the swapChainImageIndex parameter. This method must be called before each rendering (especially when swapChainImageIndex is changing). | |
UpdateSceneAndLightsData | UpdateSceneAndLightsData method updated the scene, camera and lights data structures and marks scene and lights buffers as dirty. This method can be called only when there are any camera or light changed. The actual buffers are updated in the UpdateGpuBuffers(RenderingContext) method. | |
UpdateSceneNodeWorldMatrixData | UpdateSceneNodeWorldMatrixData method get the World matrix from the specified SceneNode and updates the matrix data in the GPU buffers. |