Regular API function

simCheckCollisionEx / sim.checkCollisionEx

Description Checks whether two entities are colliding, and will return all intersections between the two entities. The collidable flags of the entities are overridden if the entities are objects. See also sim.checkCollision.
C/C++
synopsis
simInt simCheckCollisionEx(simInt entity1Handle,simInt entity2Handle,simFloat** intersectionSegments)
C/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 collidable objects
intersectionSegments: pointer to an array of simFloat values that represent the intersections (segments) between the two entities (pt1(x,y,z), pt2(x,y,z), pt1(x,y,z), etc). This can be nullptr. The user should use simReleaseBuffer to delete the returned data. That data is only valid if return value is >0
C/C++
return value
-1 in case of an error, otherwise the number of segments returned
Lua
synopsis
int result,float[] intersections=sim.checkCollisionEx(int entity1Handle,int entity2Handle)
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 collidable objects
Lua
return values
result: the number of segments returned
intersections: a table that contains the intersection segments between the two entities.
Python
synopsis
int result,list intersections=sim.checkCollisionEx(int entity1Handle,int entity2Handle)