C# Class open3mod.Scene

Represents a 3D scene/asset loaded through assimp. This class contains the aiScene plus some auxiliary structures for drawing. Since assimp is the only source for model data and this is only a viewer, we ignore the recommendation of the assimp docs and use its data structures (almost) directly for rendering.
Inheritance: IDisposable
Afficher le fichier Open project: acgessler/open3mod Class Usage Examples

Méthodes publiques

Méthode Description
Dispose ( ) : void

Dispose

GetOverrideMesh ( Mesh mesh ) : Mesh
RecreateRenderingBackend ( ) : void

Recreates the rendering backend if needed. This is called after the global rendering backend setting is changed.

Render ( open3mod.UiState state, ICameraController cam, open3mod.Renderer target ) : void

Call once per frame to render the scene to the current viewport.

RequestReconfigureTextures ( ) : void

Requests that texture filters be re-configured as soon as possible. This is called when the texture settings are changed. This method may only be called from the UI thread.

RequestRenderRefresh ( ) : void

Requests the renderer to update next frame even if it seems as if nothing changed. This method may only be called from the UI thread.

RequestReuploadTextures ( ) : void

Requests that all textures be re-uploaded as soon as possible. This is called when the texture settings are changed. This method may only be called from the UI thread.

Scene ( string file ) : System

Construct a scene given a file name, throw if loading fails

SetOverrideMesh ( Mesh mesh, Mesh overrideMesh ) : void

Replace a given mesh with another when drawing. This has immediate effect. Editing tools use this to temporarily replace the mesh being rendered with a preview of the action. Pass null to revert to the original mesh.

SetPivot ( Assimp.Node node, bool realCenter = true ) : void

Set the pivot point for the scene to be at the world position of a given node.

SetSkeletonVisibleOverride ( bool overrideSkeleton ) : void

Turns skeleton visualization on even if it is off in the UI.

SetVisibleNodes ( Dictionary meshFilter ) : void

Sets which parts of the scene are visible. See ISceneRenderer.Render (visibleNodesByMesh parameters) for a description of how the visible set is determined.

Update ( double delta, bool silent = false ) : void

To be called once per frame to do non-rendering jobs such as updating animations.

Private Methods

Méthode Description
ComputeBoundingBox ( Assimp.Node node, Vector3 &min, Vector3 &max, Matrix4 &trafo ) : void

Helper for ComputeBoundingBox(out Vector3 sceneMin, out Vector3 sceneMax)

ComputeBoundingBox ( Vector3 &sceneMin, Vector3 &sceneMax, Vector3 &sceneCenter, Assimp.Node node = null, bool omitRootNodeTrafo = false ) : void

Calculates the smallest AABB that encloses the scene.

CountVertsAndFaces ( int &totalVertexCount, int &totalTriangleCount, int &totalLineCount, int &totalPointCount ) : void

Counts vertices, points, lines and triangles in the scene.

CreateRenderingBackend ( ) : void
GetPostProcessStepsFlags ( ) : PostProcessSteps
LoadTextures ( ) : void

Populates the TextureSet with all the textures required for the scene.

SetTexturesChangedFlag ( ) : void

Sets a flag for the renderer that at least one of the textures in the scene was changed and needs to be updated. This method may be called from any thread.

Method Details

Dispose() public méthode

Dispose
public Dispose ( ) : void
Résultat void

GetOverrideMesh() public méthode

public GetOverrideMesh ( Mesh mesh ) : Mesh
mesh Assimp.Mesh
Résultat Assimp.Mesh

RecreateRenderingBackend() public méthode

Recreates the rendering backend if needed. This is called after the global rendering backend setting is changed.
public RecreateRenderingBackend ( ) : void
Résultat void

Render() public méthode

Call once per frame to render the scene to the current viewport.
public Render ( open3mod.UiState state, ICameraController cam, open3mod.Renderer target ) : void
state open3mod.UiState
cam ICameraController
target open3mod.Renderer
Résultat void

RequestReconfigureTextures() public méthode

Requests that texture filters be re-configured as soon as possible. This is called when the texture settings are changed. This method may only be called from the UI thread.
public RequestReconfigureTextures ( ) : void
Résultat void

RequestRenderRefresh() public méthode

Requests the renderer to update next frame even if it seems as if nothing changed. This method may only be called from the UI thread.
public RequestRenderRefresh ( ) : void
Résultat void

RequestReuploadTextures() public méthode

Requests that all textures be re-uploaded as soon as possible. This is called when the texture settings are changed. This method may only be called from the UI thread.
public RequestReuploadTextures ( ) : void
Résultat void

Scene() public méthode

Construct a scene given a file name, throw if loading fails
public Scene ( string file ) : System
file string File name to be loaded
Résultat System

SetOverrideMesh() public méthode

Replace a given mesh with another when drawing. This has immediate effect. Editing tools use this to temporarily replace the mesh being rendered with a preview of the action. Pass null to revert to the original mesh.
public SetOverrideMesh ( Mesh mesh, Mesh overrideMesh ) : void
mesh Assimp.Mesh
overrideMesh Assimp.Mesh
Résultat void

SetPivot() public méthode

Set the pivot point for the scene to be at the world position of a given node.
public SetPivot ( Assimp.Node node, bool realCenter = true ) : void
node Assimp.Node Node to place the pivot at. Pass null to reset the /// pivot to be the (natural) center of the scene
realCenter bool Whether to compute the real center of the node (by getting /// the mid point of the geometric bounds or whether the origin of the local coordinate /// space is used.
Résultat void

SetSkeletonVisibleOverride() public méthode

Turns skeleton visualization on even if it is off in the UI.
public SetSkeletonVisibleOverride ( bool overrideSkeleton ) : void
overrideSkeleton bool true to always show skeleton /// visualization, false to take the UI's settings
Résultat void

SetVisibleNodes() public méthode

Sets which parts of the scene are visible. See ISceneRenderer.Render (visibleNodesByMesh parameters) for a description of how the visible set is determined.
public SetVisibleNodes ( Dictionary meshFilter ) : void
meshFilter Dictionary See ISceneRenderer.Render (visibleNodesByMesh parameter)
Résultat void

Update() public méthode

To be called once per frame to do non-rendering jobs such as updating animations.
public Update ( double delta, bool silent = false ) : void
delta double Real-world time delta in seconds
silent bool True if the scene is in background and won't /// be rendered this frame. It may then be possible to implement /// a cheaper update.
Résultat void