MCPcopy Create free account
hub / github.com/RenderKit/embree / ISPCQuadMesh

Method ISPCQuadMesh

tutorials/common/tutorial/scene_device.cpp:288–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 7

alignedUSMMallocFunction · 0.85
copyArrayToUSMFunction · 0.85
materialIDMethod · 0.80
numTimeStepsMethod · 0.45
sizeMethod · 0.45
numVerticesMethod · 0.45
numPrimitivesMethod · 0.45

Tested by

no test coverage detected