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

Method createGarbagePointSet

tutorials/common/scenegraph/geometry_creation.cpp:666–692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

664
665
666 Ref<SceneGraph::Node> SceneGraph::createGarbagePointSet(int hash, size_t numPoints, bool mblur, Ref<MaterialNode> material)
667 {
668 RandomSampler sampler;
669 RandomSampler_init(sampler,hash);
670
671 Ref<SceneGraph::PointSetNode> mesh = new SceneGraph::PointSetNode(RTC_GEOMETRY_TYPE_SPHERE_POINT, material,BBox1f(0,1),mblur?2:1);
672
673 for (size_t i = 0; i < numPoints; i++)
674 {
675 const float x = cast_i2f(RandomSampler_getUInt(sampler));
676 const float y = cast_i2f(RandomSampler_getUInt(sampler));
677 const float z = cast_i2f(RandomSampler_getUInt(sampler));
678 const float r = cast_i2f(RandomSampler_getUInt(sampler));
679 mesh->positions[0].push_back(Vec3ff(x, y, z, r));
680
681 if (mblur)
682 {
683 const float x = cast_i2f(RandomSampler_getUInt(sampler));
684 const float y = cast_i2f(RandomSampler_getUInt(sampler));
685 const float z = cast_i2f(RandomSampler_getUInt(sampler));
686 const float r = cast_i2f(RandomSampler_getUInt(sampler));
687 mesh->positions[1].push_back(Vec3ff(x, y, z, r));
688 }
689 }
690
691 return mesh.dynamicCast<SceneGraph::Node>();
692 }
693}

Callers

nothing calls this directly

Calls 4

RandomSampler_initFunction · 0.85
RandomSampler_getUIntFunction · 0.85
cast_i2fFunction · 0.50
push_backMethod · 0.45

Tested by

no test coverage detected