fileformat: set to 0. Fileformat is automatically detected
pathAndFilename: the location of the file to import.
options: bit-coded: bit0 set (1): keep identical vertices, bit7 set (128): ignore up-vector coded in fileformat
identicalVerticeTolerance: has no effect. set to zero
scalingFactor: the scaling factor to apply to the imported vertices
vertices: an array to vertice arrays. The import operation may generate several meshes depending on the fileformat. The user is in charge of releasing the memory. See the example below
verticesSizes: an array indicating the individual vertice array sizes. The user is in charge of releasing the memory. See the example below
indices: an array to indice arrays. The import operation may generate several meshes depending on the fileformat. The user is in charge of releasing the memory. Can be NULL. See the example below
indicesSizes: an array indicating the individual indice array sizes. The user is in charge of releasing the memory. Can be NULL if indices is also NULL. See the example below
reserved: reserved for future extensions. Keep at NULL.
names: not used anymore. Set to NULL
USAGE EXAMPLE:
simFloat** vertices;
simInt* verticesSizes;
simInt** indices;
simInt* indicesSizes;
simInt elementCount=simImportMesh(1,"d:\\example.dxf",0,0.0001f,1.0f,&vertices,
&verticesSizes,&indices,&indicesSizes,NULL,NULL);
if (elementCount>0)
{
const float grey[3]={0.5f,0.5f,0.5f};
for (int i=0;i<elementCount;i++)
{
simInt shapeHandle=simCreateMeshShape(2,20.0f*3.1415f/180.0f,vertices[i],
verticesSizes[i],indices[i],indicesSizes[i],NULL);
simSetShapeColor(shapeHandle,"",sim_colorcomponent_ambient,grey);
simReleaseBuffer((simChar*)indices[i]);
simReleaseBuffer((simChar*)vertices[i]);
}
simReleaseBuffer((simChar*)indicesSizes);
simReleaseBuffer((simChar*)indices);
simReleaseBuffer((simChar*)verticesSizes);
simReleaseBuffer((simChar*)vertices);
}
|