
simCheckDistance
Description
|
Checks the minimum distance between two entities. Detection is silent (no visual feedback) compared to simHandleDistance. Also, the measurable flags of the entities are overridden if the entities are objects. See also simReadDistance.
|
C synopsis
|
simInt simCheckDistance(simInt entity1Handle,simInt entity2Handle,simFloat threshold,simFloat* distanceData)
|
C parameters |
entity1Handle: handle of entity 1 (can be an object handle or a collection handle)
entity2Handle: handle of entity 2 (can be an object handle or a collection handle), or sim_handle_all to check entity1 against all other measurable objects
threshold: if distance is bigger than the threshold, the distance is not calculated and return value is 0. If threshold is 0 or negative, then no threshold is used.
distanceData: distanceData[0]-distanceData[5] represents the distance segment, distanceData[6] is the distance between the entities. This data is valid only if return value is 1
|
C return value
|
0 or 1 if operation was successful (1 if distance is smaller than threshold), -1 otherwise
|
Lua synopsis
|
number result,table_7 distanceData=simCheckDistance(number entity1Handle,number entity2Handle,number threshold)
|
Lua parameters |
entity1Handle: handle of entity 1 (can be an object handle or a collection handle)
entity2Handle: handle of entity 2 (can be an object handle or a collection handle), or sim_handle_all to check entity1 against all other measurable objects
threshold: if distance is bigger than the threshold, the distance is not calculated and result is 0. If threshold is 0 or negative, then no threshold is used.
|
Lua return values
|
result: 0 or 1 if operation was successful (1 if distance is smaller than threshold), -1 otherwise
distanceData: distanceData[1]-distanceData[6] represents the distance segment, distanceData[7] is the distance between the entities. distanceData is nil if result is different from 1
|
All regular API functions on one page
|