| 286 | } |
| 287 | |
| 288 | ISPCQuadMesh::ISPCQuadMesh (RTCDevice device, TutorialScene* scene_in, Ref<SceneGraph::QuadMeshNode> in) |
| 289 | : geom(QUAD_MESH), positions(nullptr), normals(nullptr) |
| 290 | { |
| 291 | geom.geometry = rtcNewGeometry (device, RTC_GEOMETRY_TYPE_QUAD); |
| 292 | |
| 293 | positions = (Vec3fa**) alignedUSMMalloc(sizeof(Vec3fa*)*in->numTimeSteps()); |
| 294 | for (size_t i=0; i<in->numTimeSteps(); i++) |
| 295 | positions[i] = copyArrayToUSM(in->positions[i]); |
| 296 | |
| 297 | if (in->normals.size()) { |
| 298 | normals = (Vec3fa**) alignedUSMMalloc(sizeof(Vec3fa*)*in->numTimeSteps()); |
| 299 | for (size_t i=0; i<in->numTimeSteps(); i++) |
| 300 | normals[i] = copyArrayToUSM(in->normals[i]); |
| 301 | } |
| 302 | |
| 303 | texcoords = copyArrayToUSM(in->texcoords); |
| 304 | quads = (ISPCQuad*) copyArrayToUSM(in->quads); |
| 305 | startTime = in->time_range.lower; |
| 306 | endTime = in->time_range.upper; |
| 307 | numTimeSteps = (unsigned) in->numTimeSteps(); |
| 308 | numVertices = (unsigned) in->numVertices(); |
| 309 | numQuads = (unsigned) in->numPrimitives(); |
| 310 | geom.materialID = scene_in->materialID(in->material); |
| 311 | } |
| 312 | |
| 313 | ISPCQuadMesh::~ISPCQuadMesh () |
| 314 | { |
nothing calls this directly
no test coverage detected