| 533 | |
| 534 | /* called by the C++ code for initialization */ |
| 535 | extern "C" void device_init (char* cfg) |
| 536 | { |
| 537 | /* create scene */ |
| 538 | TutorialData_Constructor(&data); |
| 539 | g_scene = data.g_scene = rtcNewScene(g_device); |
| 540 | rtcSetSceneFlags(data.g_scene,RTC_SCENE_FLAG_ROBUST); |
| 541 | |
| 542 | addGroundPlane(data.g_scene); |
| 543 | |
| 544 | createGridGeometry(data.gmesh); |
| 545 | rtcAttachGeometry(data.g_scene,data.gmesh.geom); |
| 546 | //rtcAttachGeometry(g_scene,gmesh.geomNormals); |
| 547 | |
| 548 | /* commit changes to scene */ |
| 549 | rtcCommitScene (data.g_scene); |
| 550 | data.g_traversable = rtcGetSceneTraversable(data.g_scene); |
| 551 | } |
| 552 | |
| 553 | Vec3fa mylerp(float f, const Vec3fa& a, const Vec3fa& b) { // FIXME: use lerpr, need to make ISPC lerpr and C++ lerpr compatible first |
| 554 | return (1.0f-f)*a + f*b; |
nothing calls this directly
no test coverage detected