sim.checkProximitySensorEx2

Checks whether the proximity sensor detects the indicated points, segments or triangles. Detection is silent (no visual feedback)

Synopsis

int res, float dist, list point, list n = sim.checkProximitySensorEx2(int sensorHandle, list vertices, int itemType, int itemCount, int mode, float threshold, float maxAngle) int res, float dist, float[3] point, float[3] n = sim.checkProximitySensorEx2(int sensorHandle, float[] vertices, int itemType, int itemCount, int mode, float threshold, float maxAngle)

Arguments

  • sensorHandle: handle of the proximity sensor object
  • vertices: an array containing vertices
  • itemType: 0 for points, 1 for segments and 2 for triangles
  • itemCount: the number of items that the 'vertices' array contains
  • For the other parameters, see the description in sim.checkProximitySensorEx. (sim.checkProximitySensorEx2 doesn't support occlusion checking)

Return values

  • res: 0 (not detected) or 1 (detected)
  • dist: distance from the sensor origin to the detected point. None/nil if res is different from 1
  • point: position of the detected point relative to the sensor origin. None/nil if res is different from 1
  • n: normal vector of the surface where the point was detected. Normalized. Relative to the sensor reference frame. None/nil if res is different from 1


See also: