Conversion Functions

Functions to assist with coordinate system conversions.

MTK_BlockModel_ModelToWorld()

Converts a block model coordinate to a world coordinate.

Signature
int MTK_BlockModel_ModelToWorld(
    MTK_BlockModel* bmodel,
    const double& mx,
    const double& my,
    const double& mz,
    double* wx, double* wy, double* wz
    );
Parameters
  • bmodel: Pointer to an MTK_BlockModel struct.

  • mx: A block model x-coordinate.

  • my: A block model y-coordinate.

  • mz: A block model z-coordinate.

  • wx: The world x-coordinate.

  • wy: The world y-coordinate.

  • wz: The world z-coordinate.

Returns

0 on success; any other value indicates failure.

MTK_BlockModel_WorldToModel()

Converts a world coordinate to a block model coordinate.

Signature
int MTK_BlockModel_WorldToModel( 
    MTK_BlockModel* bmodel,
    const double& wx,
    const double& wy,
    const double& wz,
    double* mx, double* my, double* mz
    );
Parameters
  • bmodel: Pointer to an MTK_BlockModel struct.

  • wx: A world x-coordinate.

  • wy: A world y-coordinate.

  • wz: A world z-coordinate.

  • mx: The block model x-coordinate.

  • my: The block model y-coordinate.

  • mz: The block model z-coordinate.

Returns

0 on success; any other value indicates failure.