IoObject *IoDrawStuff_dsSetCapsuleQuality(IoDrawStuff *self, IoObject *locals, IoMessage *m) { int n; n = IoMessage_locals_intArgAt_(m, locals, 0); dsSetCapsuleQuality(n); return self; }
/*** Setting of point of view and camera gaze ***/ void start() { #ifndef NOVIZ xyz[0] = 1.0f; xyz[1] = -1.2f; xyz[2] = 0.5f; // point of view[m] hpr[0] = 121.0f; hpr[1] = -10.0f; hpr[2] = 0.0f; // gaze[°] dsSetViewpoint(xyz,hpr); // set point of view and gaze dsSetSphereQuality(3); dsSetCapsuleQuality(7); // increase slows visualization #endif }
void do_tests (int argc, char **argv) { int i,j; // process command line arguments if (argc >= 2) { graphical_test = atoi (argv[1]); } if (graphical_test) { // do one test gaphically and interactively if (graphical_test < 1 || graphical_test >= MAX_TESTS || !testslot[graphical_test].name) { dError (0,"invalid test number"); } printf ("performing test: %s\n",testslot[graphical_test].name); // setup pointers to drawstuff callback functions dsFunctions fn; fn.version = DS_VERSION; fn.start = &start; fn.step = &simLoop; fn.command = &command; fn.stop = 0; fn.path_to_textures = DRAWSTUFF_TEXTURE_PATH; dsSetSphereQuality (3); dsSetCapsuleQuality (8); dsSimulationLoop (argc,argv,1280,900,&fn); } else { // do all tests noninteractively for (i=0; i<MAX_TESTS; i++) testslot[i].number = i; // first put the active tests into a separate array int n=0; for (i=0; i<MAX_TESTS; i++) if (testslot[i].name) n++; TestSlot **ts = (TestSlot**) malloc (n * sizeof(TestSlot*)); j = 0; for (i=0; i<MAX_TESTS; i++) if (testslot[i].name) ts[j++] = testslot+i; if (j != n) dDebug (0,"internal"); // do two test batches. the first test batch has far fewer reps and will // catch problems quickly. if all tests in the first batch passes, the // second batch is run. for (i=0; i<n; i++) ts[i]->failcount = 0; int total_reps=0; for (int batch=0; batch<2; batch++) { int reps = (batch==0) ? TEST_REPS1 : TEST_REPS2; total_reps += reps; printf ("testing batch %d (%d reps)...\n",batch+1,reps); // run tests for (j=0; j<reps; j++) { for (i=0; i<n; i++) { current_test = ts[i]->number; if (ts[i]->test_fn() != 1) ts[i]->failcount++; } } // check for failures int total_fail_count=0; for (i=0; i<n; i++) total_fail_count += ts[i]->failcount; if (total_fail_count) break; } // print results for (i=0; i<n; i++) { printf ("%3d: %-30s: ",ts[i]->number,ts[i]->name); if (ts[i]->failcount) { printf ("FAILED (%.2f%%) at line %d\n", double(ts[i]->failcount)/double(total_reps)*100.0, ts[i]->last_failed_line); } else { printf ("ok\n"); } } } }