| 203 | } |
| 204 | |
| 205 | ISPCTriangleMesh::ISPCTriangleMesh (RTCDevice device, unsigned int numTriangles, unsigned int numVertices, bool hasNormals, bool hasTexcoords, unsigned int numTimeSteps) |
| 206 | : geom(TRIANGLE_MESH), |
| 207 | positions(nullptr), normals(nullptr), texcoords(nullptr), triangles(nullptr), startTime(0.0f), endTime(1.0f), |
| 208 | numTimeSteps(numTimeSteps), numVertices(numVertices), numTriangles(numTriangles) |
| 209 | { |
| 210 | assert(numTimeSteps); |
| 211 | |
| 212 | geom.geometry = rtcNewGeometry (device, RTC_GEOMETRY_TYPE_TRIANGLE); |
| 213 | |
| 214 | positions = (Vec3fa**) alignedUSMMalloc(sizeof(Vec3fa*)*numTimeSteps); |
| 215 | for (size_t i=0; i<numTimeSteps; i++) |
| 216 | positions[i] = (Vec3fa*) alignedUSMMalloc(sizeof(Vec3fa)*numVertices); |
| 217 | |
| 218 | if (hasNormals) { |
| 219 | normals = (Vec3fa**) alignedUSMMalloc(sizeof(Vec3fa*)*numTimeSteps); |
| 220 | for (size_t i=0; i<numTimeSteps; i++) |
| 221 | normals[i] = (Vec3fa*) alignedUSMMalloc(sizeof(Vec3fa)*numVertices); |
| 222 | } |
| 223 | |
| 224 | if (hasTexcoords) |
| 225 | texcoords = (Vec2f*) alignedUSMMalloc(sizeof(Vec2f)*numVertices); |
| 226 | |
| 227 | triangles = (ISPCTriangle*) alignedUSMMalloc(sizeof(ISPCTriangle)*numTriangles); |
| 228 | } |
| 229 | |
| 230 | ISPCTriangleMesh::ISPCTriangleMesh (RTCDevice device, TutorialScene* scene_in, Ref<SceneGraph::TriangleMeshNode> in) |
| 231 | : geom(TRIANGLE_MESH), positions(nullptr), normals(nullptr) |
nothing calls this directly
no test coverage detected