Regular API function

simCreateProximitySensor / sim.createProximitySensor

Description Creates a proximity sensor.
C/C++
synopsis
simInt simCreateProximitySensor(simInt sensorType,simInt subType,simInt options,const simInt* intParams,const simFloat* floatParams,const simFloat* reserved)
C/C++
parameters
sensorType: the desired proximity sensor type (e.g. sim.proximitysensor_cone_subtype)
subType: deprecated. Set to 16
options: bit-coded options:
bit 0 set (1): the sensor will be explicitely handled
bit 1 set (2): reserved. Set to 0
bit 2 set (4): the detection volume is not shown
bit 3 set (8): front faces are not detected
bit 4 set (16): back faces are not detected
bit 5 set (32): fast detection (i.e. not exact detection)
bit 6 set (64): the normal of the detected surface with the detection ray will have to lie below a specified threshold angle
bit 8 set (256): smallest distance threshold will be active
bit 9 set (512): randomized detection (only with ray-type proximity sensors)
intParams (input): 8 integer parameters:
intParams[0]: face count (volume description)
intParams[1]: face count far (volume description)
intParams[2]: subdivisions (volume description)
intParams[3]: subdivisions far (volume description)
intParams[4]: randomized detection, sample count per reading
intParams[5]: randomized detection, individual ray detection count for triggering
intParams[6]: reserved. Set to 0
intParams[7]: reserved. Set to 0
floatParams (input): 15 floating point parameters:
floatParams[0]: offset (volume description)
floatParams[1]: range (volume description)
floatParams[2]: x size (volume description)
floatParams[3]: y size (volume description)
floatParams[4]: x size far (volume description)
floatParams[5]: y size far (volume description)
floatParams[6]: inside gap (volume description)
floatParams[7]: radius (volume description)
floatParams[8]: radius far (volume description)
floatParams[9]: angle (volume description)
floatParams[10]: threshold angle for limited angle detection (see bit 6 above)
floatParams[11]: smallest detection distance (see bit 8 above)
floatParams[12]: sensing point size
floatParams[13]: reserved. Set to 0.0
floatParams[14]: reserved. Set to 0.0
reserved: set to nullptr
C/C++
return value
-1 if operation was not successful, otherwise the handle of the force sensor
Lua
synopsis
int sensorHandle=sim.createProximitySensor(int sensorType,int subType,int options,int[8] intParams,float[15] floatParams)
Lua
parameters
Similar to the C-function counterpart
Lua
return values
Similar to the C-function counterpart
Python
synopsis
int sensorHandle=sim.createProximitySensor(int sensorType,int subType,int options,list intParams,list floatParams)