Click or drag to resize
Ab4d.SharpEngine logo

InstancedMeshNode Methods

The InstancedMeshNode type exposes the following members.

Methods
 NameDescription
Public methodCollectRenderingItems CollectRenderingItems
(Overrides SceneNodeCollectRenderingItems(RenderingContext))
Protected methodDispose
(Overrides SceneNodeDispose(Boolean))
Public methodGetCenterPosition Returns center position of this InstancedMeshNode. When applyTransformation is true (by default), then center position is also transformed by Transform.
(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.
(Overrides SceneNodeGetLocalBoundingBox(Boolean))
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.
Protected methodGetRenderingLayer GetRenderingLayer
(Overrides RenderedNodeGetRenderingLayer(Material, Mesh))
Public methodGetWorldColorInstancesData Returns an array of WorldColorInstanceData structs that define the instances data that were set by calling the SetInstancesData(WorldColorInstanceData) method.
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 methodOnUpdate OnUpdate
(Overrides SceneNodeOnUpdate)
Protected methodOnWorldMatrixChanged OnWorldMatrixChanged
(Overrides SceneNodeOnWorldMatrixChanged)
Public methodSetInstancesData(WorldColorInstanceData) SetInstancesData method sets an array of WorldColorInstanceData structs that define the world transformations (positions, scales, rotations) and colors or instanced geometry objects. Calling this method sets StartInstanceIndex to zero and InstancesCount to the number of elements in the instancesData array. After each change of InstancesData user must call UpdateInstancesData(Boolean) or UpdateInstancesData(BoundingBox) methods. This method also calculates a new BoundingBox from the instancesData. If you know the BoundingBox of all mesh instances, call the SetInstancesData(WorldColorInstanceData, BoundingBox) method.
Public methodSetInstancesData(WorldColorInstanceData, BoundingBox) SetInstancesData method sets an array of WorldColorInstanceData structs that define the world transformations (positions, scales, rotations) and colors or instanced geometry objects. Calling this method sets StartInstanceIndex to zero and InstancesCount to the number of elements in the instancesData array. After each change of InstancesData user must call UpdateInstancesData(Boolean) or UpdateInstancesData(BoundingBox) methods. This method also gets the BoundingBox of all mesh instances. If you do not know the BoundingBox call the SetInstancesData(WorldColorInstanceData) method.
Public methodSetInstancesRange SetInstancesRange method sets both StartInstanceIndex and InstancesCount and provides the new bounding box to prevent recalculating bounding box by this class.
Public methodUpdateInstancesData(Boolean) UpdateInstancesData recreates the instances data buffer from the array of WorldColorInstanceData that was set by calling the SetInstancesData(WorldColorInstanceData) method. When the BoundingBox has changed and you know the new bounding box, call the UpdateInstancesData(BoundingBox) to prevent calculating it from the instances data.
Public methodUpdateInstancesData(BoundingBox) UpdateInstancesData recreates the instances data buffer from the array of WorldColorInstanceData that was set by calling the SetInstancesData(WorldColorInstanceData) method. This method also sets new bounding box of all mesh instances (without the transformation that is applied to this SceneNode).
Protected methodUpdateLocalBoundingBox UpdateLocalBoundingBox
(Overrides SceneNodeUpdateLocalBoundingBox)
Protected methodUpdateRenderingItemMesh 
Public methodUseInstanceObjectColor UseInstanceObjectColor method can be called after calling the UseSingleObjectColor(Color4). After calling this method, the object colors are get from diffuse color defined in instances data array.
Public methodUseSingleObjectColor When UseSingleObjectColor is called, the specified objectColor is used as diffuse color for all instances. This overrides the color defined in the instances data. When color's alpha value is less than 1, then alpha blending is used. To use instance color after calling UseSingleObjectColor, call the UseInstanceObjectColor method.
Top
See Also