Regular API function
simCheckOctreePointOccupancy / sim.checkOctreePointOccupancy
Description
|
Checks whether the provided points collide with the OC tree voxels. See also sim.insertVoxelsIntoOctree and the other OC tree related functions. |
C/C++ synopsis
|
simInt checkOctreePointOccupancy(simInt octreeHandle,simInt options,const simFloat* pts,simInt ptCnt,simUInt* tag,simUInt64* location,simVoid* reserved) |
C/C++ parameters |
options: bit-coded:
bit0 set (1): specified points are relative to the OC tree reference frame, otherwise they are relative to the world reference frame
pts: a pointer to the points specified as X/Y/Z coordinates
ptCnt: the number of points contained in pts
tag: a pointer to a tag value, receiving the tag value of the voxel that collides with a single point. If several points are tested, then this pointer is ignored. Can be nullptr.
location: a pointer to a uint64 value, which specifies the location of the voxel that collides with a single point. If several points are tested, then this pointer is ignored. Can be nullptr. The location value is coded in following way:
bit0 - bit5: the depth level of the voxel in the OC tree structure (1-63).
bit6 - bit63: a triple bit-value for each depth level. triple bit-values represent the node location relative to the parent node:
0: (-1,-1,-1)
1: (+1,-1,-1)
2: (-1,+1,-1)
3: (+1,+1,-1)
4: (-1,-1,+1)
5: (+1,-1,+1)
6: (-1,+1,+1)
7: (+1,+1,+1)
as an example, 0xE02 would indicate a depth level 2, with coordinates: (+1,+1,+1)*voxelSize*2+(-1,-1,-1)*voxelSize.
reserved: reserved for future extensions. Set to nullptr
|
C/C++ return value
|
-1 if operation was not successful, 0 if the points do not collide with the voxels, 1 if the points collide with the voxels
|
Lua synopsis
|
int result,int tag,int locationLow,int locationHigh=sim.checkOctreePointOccupancy(int octreeHandle,int options,float[] points) |
Lua parameters |
Similar to the C-function counterpart
|
Lua return values
|
if a single point is specified and collides with a voxel, 4 values are returned, otherwise only result will be returned. The location value is divided into a low- and high-value (i.e. first 32 bits and last 32 bits of location).
|
Python synopsis |
int result,int tag,int locationLow,int locationHigh=sim.checkOctreePointOccupancy(int octreeHandle,int options,list points) |
|