Regular API function

simInsertVoxelsIntoOctree / sim.insertVoxelsIntoOctree

Description Inserts voxels into an octree. Each voxel will store a color and a tag value. See also sim.removeVoxelsFromOctree and the other octree related functions.
C synopsis simInt simInsertVoxelsIntoOctree(simInt octreeHandle,simInt options,const simFloat* pts,simInt ptCnt,const simUChar* color,const simUInt* tag,simVoid* reserved)
C parameters
octreeHandle: the handle of the octree. See also simGetObjectHandle
options: bit-coded:
bit0 set (1): specified points are relative to the octree reference frame, otherwise they are relative to the world reference frame
bit1 set (2): the color array contains one RGB triple per point, and the tag array contains one value per point. Otherwise it the color array contains a single RGB triple, and the tag array contains a single value.
pts: a pointer to the voxel positions specified as X/Y/Z coordinates
ptCnt: the number of point coordinates contained in pts
color: a pointer to one or several RGB triples, specifying the red, green and blue color components (0-255). Can be NULL.
tag: a pointer to one or several uint32 values, which are user-defined values. Can be NULL, and should be NULL if color is NULL.
reserved: reserved for future extensions. Set to NULL
C return value
-1 if operation was not successful, otherwise the total number of voxels in the octree
Lua synopsis number totalVoxelCnt=sim.insertVoxelsIntoOctree(number octreeHandle,number options,table points,table color=nil,table tag=nil)
Lua parameters
Same as C-function
Lua return values
Same as C-function

All regular API functions on one page