Skip to main content

WorldRaycast

Namespace

Namespace in the Lens Scripting API.

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

Functions

FunctionDescription
hitTestPlanesPerforms a raycast against native AR-tracked planes from a screen position. The ray starts at the camera's near plane and extends through the camera's far plane at the given screen coordinates. Works on both iOS (ARKit) and Android (ARCore).
hitTestWorldMeshPerforms a raycast against world meshes from a screen position. The ray starts at the camera's near plane and extends through the camera's far plane at the given screen coordinates.
raycastPlanesPerforms a raycast against native AR-tracked planes along a ray from world position from to world position to. Works on both iOS (ARKit) and Android (ARCore).
raycastWorldMeshPerforms a raycast against world meshes along a ray from world position from to world position to. Returns detailed intersection information for each mesh surface hit by the ray.