| 73 | } |
| 74 | |
| 75 | McInt32 main() |
| 76 | { |
| 77 | // |
| 78 | // Create meshes to intersect |
| 79 | // |
| 80 | |
| 81 | // the source-mesh (a cube) |
| 82 | |
| 83 | McFloat cubeVertices[] = { |
| 84 | -5, -5, 5, // 0 |
| 85 | 5, -5, 5, // 1 |
| 86 | 5, 5, 5, // 2 |
| 87 | -5, 5, 5, // 3 |
| 88 | -5, -5, -5, // 4 |
| 89 | 5, -5, -5, // 5 |
| 90 | 5, 5, -5, // 6 |
| 91 | -5, 5, -5 // 7 |
| 92 | }; |
| 93 | McUint32 cubeFaces[] = { |
| 94 | 0, 1, 2, 3, // 0 |
| 95 | 7, 6, 5, 4, // 1 |
| 96 | 1, 5, 6, 2, // 2 |
| 97 | 0, 3, 7, 4, // 3 |
| 98 | 3, 2, 6, 7, // 4 |
| 99 | 4, 5, 1, 0 // 5 |
| 100 | }; |
| 101 | McUint32 cubeFaceSizes[] = { |
| 102 | 4, 4, 4, 4, 4, 4 |
| 103 | }; |
| 104 | McUint32 numCubeVertices = 8; |
| 105 | McUint32 numCubeFaces = 6; |
| 106 | |
| 107 | // the cut mesh (a quad formed of two triangles) |
| 108 | McFloat cutMeshVertices[] = { |
| 109 | -20, -4, 0, // 0 |
| 110 | 0, 20, 20, // 1 |
| 111 | 20, -4, 0, // 2 |
| 112 | 0, 20, -20 // 3 |
| 113 | }; |
| 114 | McUint32 cutMeshFaces[] = { |
| 115 | 0, 1, 2, // 0 |
| 116 | 0, 2, 3 // 1 |
| 117 | }; |
| 118 | McUint32 cutMeshFaceSizes[] = { |
| 119 | 3, 3}; |
| 120 | McUint32 numCutMeshVertices = 4; |
| 121 | McUint32 numCutMeshFaces = 2; |
| 122 | |
| 123 | // 2. create a context |
| 124 | // ------------------- |
| 125 | McContext context = MC_NULL_HANDLE; |
| 126 | McResult status = mcCreateContext(&context, MC_NULL_HANDLE); |
| 127 | |
| 128 | if (status != MC_NO_ERROR) { |
| 129 | fprintf(stderr, "could not create context (status=%d)\n", (McInt32)status); |
| 130 | exit(1); |
| 131 | } |
| 132 |
nothing calls this directly
no test coverage detected