Click or drag to resize
AB4D logo

MeshTrianglesSorterSortByCameraDistance Method

Sorts the triangle indices by distance to the specified camera position and sets the sorted indices into SortedIndicesArray. When the checkIfAlreadySorted parameter is true (by default), then the currently sorted positions are first checked if they are already sorted and in this case do not sort the array.

Namespace: Ab3d.DirectX
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.0.8865.1045
Syntax
C#
public bool SortByCameraDistance(
	Vector3 cameraPosition,
	bool checkIfAlreadySorted = true
)

Parameters

cameraPosition  Vector3
cameraPosition
checkIfAlreadySorted  Boolean  (Optional)
true (by default) to check if sorting is required

Return Value

Boolean
true when the order of the triangles was changed
See Also