Accel* BVH4::BVH4Triangle4ObjectSplit(TriangleMesh* mesh) { BVH4* accel = new BVH4(Triangle4::type,mesh->parent,LeafMode); Builder* builder = BVH4Triangle4MeshBuilderSAH(accel,mesh,LeafMode); Accel::Intersectors intersectors = BVH4Triangle4IntersectorsHybrid(accel); return new AccelInstance(accel,builder,intersectors); }
void createTriangleMeshTriangle4(TriangleMesh* mesh, AccelData*& accel, Builder*& builder) { if (mesh->numTimeSteps != 1) THROW_RUNTIME_ERROR("internal error"); accel = new BVH4(Triangle4::type,mesh->parent,LeafMode); switch (mesh->flags) { case RTC_GEOMETRY_STATIC: builder = BVH4Triangle4MeshBuilderSAH(accel,mesh,LeafMode); break; case RTC_GEOMETRY_DEFORMABLE: builder = BVH4Triangle4MeshRefitSAH(accel,mesh,LeafMode); break; case RTC_GEOMETRY_DYNAMIC: builder = BVH4Triangle4MeshBuilderMortonGeneral(accel,mesh,LeafMode); break; default: THROW_RUNTIME_ERROR("internal error"); } }
Builder* BVH4Triangle4MeshRefitSAH (void* accel, TriangleMesh* mesh, size_t mode) { return new BVHNRefitT<4,TriangleMesh,Triangle4> ((BVH4*)accel,BVH4Triangle4MeshBuilderSAH (accel,mesh,mode),mesh,mode); }