Regular API function

simCheckProximitySensor / sim.checkProximitySensor

Description Checks whether the proximity sensor detects the indicated entity. Detection is silent (no visual feedback) compared to sim.handleProximitySensor. Also, the detectable flags of the entity are overridden if the entity is an object. See also sim.readProximitySensor and sim.checkProximitySensorEx.
C/C++
synopsis
simInt simCheckProximitySensor(simInt sensorHandle,simInt entityHandle,simFloat* detectedPoint)
C/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 nullptr
C/C++
return value
-1 if operation was not successful, otherwise 0 (no detection) or 1 (detection)
Lua
synopsis
int result,float distance,float[3] detectedPoint,int detectedObjectHandle,float[3] surfaceNormalVector=sim.checkProximitySensor(int sensorHandle,int 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: 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
detectedObjectHandle: handle of detected object. Is nil if result is different from 1
surfaceNormalVector: normal vector of the surface where the point was detected. Normalized. Relative to the sensor reference frame. Is nil if result is different from 1
Python
synopsis
int result,float distance,list detectedPoint,int detectedObjectHandle,list surfaceNormalVector=sim.checkProximitySensor(int sensorHandle,int entityHandle)