Skip to main content
Skip to main content

raycastClosest

raycastClosest

Description

Raycast closest rigid body object synchronously/blocking Callbacks will be performed before the function returns If the callback function returns true any possible following callbacks will be omitted

Definition

raycastClosest(float x, float y, float z, float nx, float ny, float nz, float maxDistance, string callbackFunctionName, object? callbackTargetObject, integer? collisionMask)

Arguments

floatxx
floatyy
floatzz
floatnxnx
floatnyny
floatnznz
floatmaxDistancemaxDistance
stringcallbackFunctionNameraycastClosestCallback (nodeId, x,y,z, distance, nx,ny,nz, subShapeIndex, shapeId, isLast) -> boolean continueReporting
object?callbackTargetObjecttargetObject [optional]
integer?collisionMaskcollisionMask [optional, default=ALL_BITS]

Return Values

integernumShapesnumber of hit shapes, equal to number of performed callbacks