Regular API function

simCheckProximitySensor

Description Checks whether the proximity sensor detects the indicated entity. Detection is silent (no visual feedback) compared to simHandleProximitySensor. Also, the detectable flags of the entity are overridden if the entity is an object. See also simReadProximitySensor and simCheckProximitySensorEx.
C synopsis simInt simCheckProximitySensor(simInt sensorHandle,simInt entityHandle,simFloat* detectedPoint)
C parameters
sensorHandle: handle of the proximity sensor object
entityHandle: handle of entity to detect (object or collection), or sim_handle_all to detect all detectable objects
detectedPoint: coordinates of detected point relative to the sensor origin (detectedPoint[0]-detectedPoint[2]), and distance of detected point to the sensor origin (detectedPoint[3]). Can be NULL
C return value
-1 if operation was not successful, otherwise 0 (no detection) or 1 (detection)
Lua synopsis number result,number distance,table_3 detectedPoint=simCheckProximitySensor(number sensorHandle,number entityHandle)
Lua parameters
sensorHandle: handle of the proximity sensor object
entityHandle: handle of entity to detect (object or collection), or sim_handle_all to detect all detectable objects
Lua return values
result: -1 (error), 0 (not detected) or 1 (detected)
distance: distance from the sensor origin to the detected point. Is nil if result is different from 1
detectedPoint: position of the detected point relative to the sensor origin. Is nil if result is different from 1

All regular API functions on one page