Click or drag to resize
Ab4d.SharpEngine logo

MultiMaterialModelNode Class

MultiMaterialModelNode defines a SceneNode that can render 3D object that is defined by a single mesh and multiple materials. MultiMaterialModelNode uses SubMesh objecsts to define which triangles in the mesh are rendered with which material.
Inheritance Hierarchy

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

The MultiMaterialModelNode type exposes the following members.

Constructors
Properties
 NameDescription
Public propertyCalculateActualBoundingBox Gets or sets a Boolean that specifies if BoundingBox is calculated only from positions that are used by the SubMeshes. When false, then BoundingBox from the mesh is used and no actual bounding box is calculated. Default value is false because usually all the positions in the mesh are used by a single MultiMaterialModelNode but with different materials.
Top
Methods
 NameDescription
Public methodAddSubMesh(SubMesh) AddSubMesh method adds the specified SubMesh to this MultiMaterialModelNode.
Public methodAddSubMesh(Int32, Int32, Material, Material, String) AddSubMesh method adds a new SubMesh that will render triangles with the specified start index and index count. Note that index numbers are not triangle indexes but indexes in the IndexBuffer. For example to set start location to the second triangle, set startIndexLocation to 3 (indices from 0 to 2 define the first triangle).
Public methodAddSubMesh(Int32, Int32, BoundingBox, Material, Material, String) AddSubMesh method adds a new SubMesh that will render triangles with the specified start index and index count. Note that index numbers are not triangle indexes but indexes in the IndexBuffer. For example to set start location to the second triangle, set startIndexLocation to 3 (indices from 0 to 2 define the first triangle).
Public methodCollectRenderingItems CollectRenderingItems
(Overrides SceneNodeCollectRenderingItems(RenderingContext))
Protected methodDisconnectMaterial 
Protected methodDisconnectMesh 
Protected methodDispose Dispose
(Overrides SceneNodeDispose(Boolean))
Public methodDisposeRenderingItems DisposeRenderingItems
(Overrides SceneNodeDisposeRenderingItems)
Public methodDisposeWithMaterials DisposeWithMaterials disposes this MultiMaterialModelNode and also disposes all the materials that are used by this MultiMaterialModelNode.
Public methodGetCenterPosition Returns center position of this MultiMaterialModelNode. Center position is calculated from the center position of the bounding box that is transformed by the Transform (when applyTransformation parameter is true). When mesh is not defined or no sub meshes are added, then (0, 0, 0) is returned (regardless of the Transformation).
(Overrides RenderedNodeGetCenterPosition(Boolean, Boolean))
Public methodGetClosestHitResult 
Public methodGetMaterialIndex GetMaterialIndex can be called to get the MaterialIndex that is used in the SubMesh. If the material was already used by some other SubMesh, then existing index is returned, otherwise a new index is returned.
Public methodGetMesh Returns the mesh that is used by this MultiMaterialModelNode.
Public methodGetNextHitResult 
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)
Public methodRemoveSubMesh RemoveSubMesh removes the specified SubMesh.
Protected methodUpdateLocalBoundingBox UpdateLocalBoundingBox
(Overrides SceneNodeUpdateLocalBoundingBox)
Protected methodUpdateRenderingItemMesh 
Top
See Also