Skip to main content

TensorMath.isInRectangle

Function

Checks for each 2D point whether it is inside of a rectangle.

  • 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.

isInRectangle(points, pointsShape, rect, output): void

Checks for each 2D point whether it is inside of a rectangle.

points - Float32Array of size (point count * 2). 2D points to check

pointsShape - Should be {2, point count, 1}

rect - 2D rectangle points will be checked against

output - Uint8Array of size (point count). For each point, this will be filled with 1 if the point is inside the rectangle, or 0 otherwise.

Parameters

ParameterType
pointsFloat32Array
pointsShapevec3
rectRect
outputUint8Array

Returns

void