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

Method Instantiator

tutorials/convert/convert.cpp:90–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88 struct Instantiator : public RefCount
89 {
90 Instantiator(const Ref<HeightField>& heightField,
91 const Ref<SceneGraph::Node>& object, const Ref<Image>& distribution, float minDistance, size_t N)
92 : heightField(heightField), object(object), /*minDistance(minDistance),*/ N(N)
93 {
94 /* create distribution */
95 size_t width = distribution->width;
96 size_t height = distribution->height;
97 std::vector<float> values(width*height);
98 for (size_t y=0; y<height; y++)
99 for (size_t x=0; x<width; x++)
100 values[y*width+x] = luminance(distribution->get(x,y));
101 dist = std::make_shared<Distribution2D>(values.data(),width,height);
102 }
103
104 void instantiate(Ref<SceneGraph::GroupNode>& group)
105 {

Callers

nothing calls this directly

Calls 3

luminanceFunction · 0.50
getMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected