Model |
public abstract class ModelNode : RenderedNode, IRayHitTestedObject, IMaterialNode, IBackMaterialNode
The ModelNode type exposes the following members.
Name | Description | |
---|---|---|
ModelNode(String) | Initializes a new instance of the ModelNode class | |
ModelNode(Material, String) | Initializes a new instance of the ModelNode class |
Name | Description | |
---|---|---|
BackMaterial | Gets or sets the material that is used to render the back side of this 3D model. | |
Material | Gets or sets the material that is used to render the front side of this 3D model. |
Name | Description | |
---|---|---|
ClearMesh | ClearMesh method sets mesh to null. This method calls SetMesh(Mesh, Boolean, Transform, Boolean, Boolean) method with null as a mesh parameter. | |
CollectRenderingItems |
CollectRenderingItems
(Overrides SceneNodeCollectRenderingItems(RenderingContext)) | |
DisconnectBackMaterial | DisconnectBackMaterial | |
DisconnectMaterial | DisconnectMaterial | |
DisconnectMesh | DisconnectMesh | |
Dispose |
Dispose
(Overrides SceneNodeDispose(Boolean)) | |
DisposeRenderingItems |
DisposeRenderingItems
(Overrides SceneNodeDisposeRenderingItems) | |
DisposeWithMaterial | DisposeWithMaterial disposes this SceneNode and also disposes the Material and BackMaterial even if the materials were created by the user and then set to the Material or BackMaterial properties. (in this case the standard Dispose method does not dispose the materials). | |
Dump | ||
DumpMesh | Dumps an overview of the mesh and values of individual vertices and triangle indices into the Visual Studio Output window. | |
GetCenterPosition |
Returns center position of this ModelNode.
Center position is calculated from the center position of the mesh that is
transformed by the Transform (when applyTransformation is true).
When mesh is not defined, then (0, 0, 0) is returned (regardless of the Transformation).
(Overrides RenderedNodeGetCenterPosition(Boolean, Boolean)) | |
GetClosestHitResult | GetClosestHitResult method returns a RayHitTestResult with the closest triangle hit by the specified ray. When no triangle is hit, null is returned. | |
GetLocalBoundingBox |
Gets the BoundingBox of this SceneNode in local coordinates.
The BoundingBox is transformed by transformation on this SceneNode but not by parent's transformations.
When updateIfDirty parameter is true (by default) and when SceneNode's DirtyFlags have MeshDirty set,
then this method will also call UpdateMesh method (this can regenerate the mesh).
When updateIfDirty parameter is false then the current value of protected localBoundingBox field is returned.
(Overrides SceneNodeGetLocalBoundingBox(Boolean)) | |
GetMesh | Returns the mesh that is used by this ModelNode. | |
GetMeshBoundingBox | Gets the BoundingBox of the Mesh that is used by this ModelNode. The BoundingBox is transformed by mesh transformation (for example this is used by the BoxModelNode when it is using a shared 1x1x1 mesh). | |
GetMeshTransform | Returns the transformation that is used to transform the mesh. Mesh is transformed before the transformation of this SceneNode is applied. The mesh transformation is set when calling SetMesh(Mesh, Boolean, Transform, Boolean, Boolean) method. | |
GetNextHitResult | GetNextHitResult method continues hit testing from the previously returned hit test and returns a RayHitTestResult with the next hit triangle (not necessary the next closest triangle) or null if no other triangle is hit. This method can be used to get all hit results. | |
GetOverviewText |
GetOverviewText adds string that writes details about this SceneNode into the specified StringBuilder.
(Overrides SceneNodeGetOverviewText(StringBuilder, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean)) | |
OnInitializeSceneResources |
Initializes resources with the specified Scene and GpuDevice.
This method can be override and is called from InitializeSceneResources(Scene) method.
(Overrides InitializedSceneComponentOnInitializeSceneResources(Scene, VulkanDevice)) | |
OnIsVisibleChanged |
OnIsVisibleChanged is called when the value of IsVisible property is changed.
Overridden implementations should update the IsVisible property of the RenderingItem objects that were already added to RenderingLayers.
(Overrides SceneNodeOnIsVisibleChanged(Boolean)) | |
OnUpdate |
OnUpdate
(Overrides SceneNodeOnUpdate) | |
OnWorldMatrixChanged |
OnWorldMatrixChanged
(Overrides SceneNodeOnWorldMatrixChanged) | |
SetMesh | SetMesh is a protected method that sets the mesh that is used for this SceneNode. If the previous mesh exists, then it is disposed (except when it was set by the user in MeshModelNode). If the new mesh was not yet initialized and if this scene node was, it calls InitializeDeviceResources method. The method can also set the meshTransform - a transformation that is applied before the SceneNode's Transform is used. This can be used by a derived class to use a shared mesh (for example for box) and then use meshTransform to position and scale the mesh for this instance. | |
SetMeshTransform(Matrix4x4) | ||
SetMeshTransform(Transform) | ||
UpdateLocalBoundingBox |
UpdateLocalBoundingBox
(Overrides SceneNodeUpdateLocalBoundingBox) | |
UpdateMesh | UpdateMesh method recreates the mesh based on the current object properties. The method should be overriden in the derived class that provides its own mesh generation. | |
UpdateRenderingItemMesh | ||
UpdateWorldBoundingBox |
UpdateWorldBoundingBox
(Overrides SceneNodeUpdateWorldBoundingBox) | |
UpdateWorldMatrix |
UpdateWorldMatrix
(Overrides SceneNodeUpdateWorldMatrix) | |
UseMeshBoundingBox | Sets LocalBoundingBox from the specified mesh's BoundingBox (taking Transform and _meshTransform into account). |
Name | Description | |
---|---|---|
backRenderingItem | RenderingItem that is used to render the model with the BackMaterial. | |
disposeTexture | disposeTexture is set from the DisposeWithMaterial(Boolean) or DisposeWithMeshAndMaterial(Boolean, Boolean) methods to store the value of the parameter. | |
frontRenderingItem | RenderingItem that is used to render the model with the Material. |