Skip to main content

TensorMath.getVectorsLength

Function

Calculates the length of all vectors in an 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.

getVectorsLength(vectors, vectorsShape, output): void

Calculates the length of all vectors in an array. Vectors can be of any dimension count.

vectors - Float32Array of size (vector dimension count * vector count). Vectors to measure the length of

vectorsShape - Should be {vector dimension count, vector count, 1}

output - Float32Array of size (vector count). For each vector in vectors, its length will be written to this array

Parameters

ParameterType
vectorsFloat32Array
vectorsShapevec3
outputFloat32Array

Returns

void