Click or drag to resize
Ab4d.SharpEngine logo

ModelNode Class

ModelNode is an abstract class that is used by SceneNodes that are defined by a mesh and front and back materials.
Inheritance Hierarchy
SystemObject
  Ab4d.SharpEngine.CoreComponentBase
    Ab4d.SharpEngine.CoreInitializedSceneComponent
      Ab4d.SharpEngine.SceneNodesSceneNode
        Ab4d.SharpEngine.SceneNodesRenderedNode
          Ab4d.SharpEngine.SceneNodesModelNode
            More

Namespace: Ab4d.SharpEngine.SceneNodes
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public abstract class ModelNode : RenderedNode, 
	IRayHitTestedObject, IMaterialNode, IBackMaterialNode

The ModelNode type exposes the following members.

Constructors
 NameDescription
Public methodModelNode(String)Initializes a new instance of the ModelNode class
Public methodModelNode(Material, String)Initializes a new instance of the ModelNode class
Top
Properties
 NameDescription
Public propertyBackMaterial Gets or sets the material that is used to render the back side of this 3D model.
Public propertyMaterial Gets or sets the material that is used to render the front side of this 3D model.
Top
Methods
 NameDescription
Protected methodClearMesh ClearMesh method sets mesh to null. This method calls SetMesh(Mesh, Boolean, Transform, Boolean, Boolean) method with null as a mesh parameter.
Public methodCollectRenderingItems CollectRenderingItems
(Overrides SceneNodeCollectRenderingItems(RenderingContext))
Protected methodDisconnectBackMaterial DisconnectBackMaterial
Protected methodDisconnectMaterial DisconnectMaterial
Protected methodDisconnectMesh DisconnectMesh
Protected methodDispose Dispose
(Overrides SceneNodeDispose(Boolean))
Public methodDisposeRenderingItems DisposeRenderingItems
(Overrides SceneNodeDisposeRenderingItems)
Public methodDisposeWithMaterial 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).
Public methodDump 
Public methodDumpMesh Dumps an overview of the mesh and values of individual vertices and triangle indices into the Visual Studio Output window.
Public methodGetCenterPosition 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))
Public methodGetClosestHitResult GetClosestHitResult method returns a RayHitTestResult with the closest triangle hit by the specified ray. When no triangle is hit, null is returned.
Public methodGetLocalBoundingBox 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))
Public methodGetMesh Returns the mesh that is used by this ModelNode.
Public methodGetMeshBoundingBox 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).
Public methodGetMeshTransform 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.
Public methodGetNextHitResult 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.
Public methodGetOverviewText 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))
Protected methodOnInitializeSceneResources Initializes resources with the specified Scene and GpuDevice. This method can be override and is called from InitializeSceneResources(Scene) method.
(Overrides InitializedSceneComponentOnInitializeSceneResources(Scene, VulkanDevice))
Protected methodOnIsVisibleChanged 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))
Protected methodOnUpdate OnUpdate
(Overrides SceneNodeOnUpdate)
Protected methodOnWorldMatrixChanged OnWorldMatrixChanged
(Overrides SceneNodeOnWorldMatrixChanged)
Protected methodSetMesh 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.
Protected methodSetMeshTransform(Matrix4x4) 
Protected methodSetMeshTransform(Transform) 
Protected methodUpdateLocalBoundingBox UpdateLocalBoundingBox
(Overrides SceneNodeUpdateLocalBoundingBox)
Protected methodUpdateMesh 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.
Protected methodUpdateRenderingItemMesh 
Protected methodUpdateWorldBoundingBox UpdateWorldBoundingBox
(Overrides SceneNodeUpdateWorldBoundingBox)
Protected methodUpdateWorldMatrix UpdateWorldMatrix
(Overrides SceneNodeUpdateWorldMatrix)
Protected methodUseMeshBoundingBox Sets LocalBoundingBox from the specified mesh's BoundingBox (taking Transform and _meshTransform into account).
Top
Fields
 NameDescription
Protected fieldbackRenderingItem RenderingItem that is used to render the model with the BackMaterial.
Protected fielddisposeTexture disposeTexture is set from the DisposeWithMaterial(Boolean) or DisposeWithMeshAndMaterial(Boolean, Boolean) methods to store the value of the parameter.
Protected fieldfrontRenderingItem RenderingItem that is used to render the model with the Material.
Top
See Also
Inheritance Hierarchy