Skip to main content

TensorMath.findMinDistancesBetween

Function

Finds minimum distances between each 2D point from one array, to 2D points in another array.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

findMinDistancesBetween(from, fromShape, to, toShape, output): void

Finds minimum distances between each 2D point from one array, to 2D points in another array.

from - Float32Array of size ("from" point count * 2). 2D points from which min distances should be found

fromShape - Should be {2, "from" point count, 1}

to - Float32Array of size ("to" point count * 2). 2D points to which min distances should be found

toShape - Should be {2, "to" point count, 1}

output - Float32Array of size ("from" point count). For each point in the from array, the minimum distance to points from the to array will be written to this array.

Parameters

ParameterType
fromFloat32Array
fromShapevec3
toFloat32Array
toShapevec3
outputFloat32Array

Returns

void