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

Method ISPCPointSet

tutorials/common/tutorial/scene_device.cpp:616–636  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

614 }
615
616 ISPCPointSet::ISPCPointSet (RTCDevice device, TutorialScene* scene_in, RTCGeometryType type, Ref<SceneGraph::PointSetNode> in)
617 : geom(POINTS), positions(nullptr), normals(nullptr), type(type)
618 {
619 geom.geometry = rtcNewGeometry(device, type);
620
621 positions = (Vec3fa**) alignedUSMMalloc(sizeof(Vec3fa*)*in->numTimeSteps());
622 for (size_t i=0; i<in->numTimeSteps(); i++)
623 positions[i] = (Vec3fa*) copyArrayToUSM(in->positions[i]);
624
625 if (in->normals.size()) {
626 normals = (Vec3fa**) alignedUSMMalloc(sizeof(Vec3fa*)*in->numTimeSteps());
627 for (size_t i=0; i<in->numTimeSteps(); i++)
628 normals[i] = copyArrayToUSM(in->normals[i]);
629 }
630
631 startTime = in->time_range.lower;
632 endTime = in->time_range.upper;
633 numTimeSteps = (unsigned) in->numTimeSteps();
634 numVertices = (unsigned) in->numVertices();
635 geom.materialID = scene_in->materialID(in->material);
636 }
637
638 ISPCPointSet::~ISPCPointSet ()
639 {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected