Click or drag to resize
AB4D logo

InstancedMeshNodeSetInstanceData Method

Updates the InstanceData and InstancesCount. This method must be called after the instance data is changed. If data size is changed the method also sets the StartInstanceIndex to 0.

Namespace: Ab3d.DirectX
Assembly: Ab3d.DXEngine.Wpf (in Ab3d.DXEngine.Wpf.dll) Version: 7.0.8865.1045
Syntax
C#
public void SetInstanceData(
	InstanceData[] instancesData,
	bool updateBounds = true
)

Parameters

instancesData  InstanceData
array of InstanceData
updateBounds  Boolean  (Optional)
when true the BoundingBox of this Node is recalculated. Can be set to false to skip this calculation that can take some time.
Remarks

SetInstanceData Updates the InstanceData and InstancesCount.

This method must be called after the instance data is changed.

If data size is changed the method also sets the StartInstanceIndex to 0.

When the instanceData is changed, usually the BoundingBox of this SceneNode should be also changed. Because it can take some time to calculate the new bounding box, it is possible to prevent updating BoundingBox with specifying updateBounds property to false.

You can also manually set the instance buffer to this InstancedMeshNode with using SetInstanceBuffer(Buffer, Int32, Int32, InstanceData, Boolean) method.

See Also