| 154 | } |
| 155 | |
| 156 | struct Tutorial : public TutorialApplication |
| 157 | { |
| 158 | Tutorial() |
| 159 | : TutorialApplication("collide",FEATURE_RTCORE) |
| 160 | { |
| 161 | registerOption("benchmark-collision", [] (Ref<ParseStream> cin, const FileName& path) { |
| 162 | benchmark = true; |
| 163 | }, "--benchmark-collision: benchmarks collision detection"); |
| 164 | |
| 165 | registerOption("complexity", [] (Ref<ParseStream> cin, const FileName& path) { |
| 166 | int N = cin->getInt(); |
| 167 | numPhi = N; |
| 168 | numTheta = 2*numPhi; |
| 169 | NX = N; |
| 170 | NZ = N; |
| 171 | }, "--complexity: sets grid and sphere geometric complexity"); |
| 172 | |
| 173 | camera.from = Vec3fa(-2.5f,2.5f,-2.5f); |
| 174 | camera.to = Vec3fa(0.0f,0.0f,0.0f); |
| 175 | } |
| 176 | |
| 177 | #if defined(USE_GLFW) |
| 178 | |
| 179 | void keypressed(int key) override |
| 180 | { |
| 181 | if (key == 32 /* */) initializeClothPositions ((collide2::ClothModel &) (*meshes[clothID])); |
| 182 | if (key == 80 /*p*/) { pause = !pause; } |
| 183 | if (pause == true && key == 78 /*n*/) { updateScene (); } |
| 184 | else TutorialApplication::keypressed(key); |
| 185 | } |
| 186 | #endif |
| 187 | |
| 188 | }; |
| 189 | } |
| 190 | |
| 191 | int main(int argc, char** argv) { |