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

Method get

tutorials/convert/convert.cpp:42–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40 }
41
42 const AffineSpace3fa get(Vec2f p)
43 {
44 const size_t width = texture->width;
45 const size_t height = texture->height;
46 const size_t x = clamp((size_t)(p.x*(width-1)),(size_t)0,width-1);
47 const size_t y = clamp((size_t)(p.y*(height-1)),(size_t)0,height-1);
48 const Color4 c = texture->get(x,y);
49 const float px = p.x*(bounds.upper.x-bounds.lower.x) + bounds.lower.x;
50 const float py = c.r*(bounds.upper.y-bounds.lower.y) + bounds.lower.y;
51 const float pz = p.y*(bounds.upper.z-bounds.lower.z) + bounds.lower.z;
52 return AffineSpace3fa::translate(Vec3fa(px,py,pz));
53 }
54
55 Ref<SceneGraph::Node> geometry()
56 {

Callers 4

atMethod · 0.45
InstantiatorMethod · 0.45
instantiateMethod · 0.45
parseCommandLineFunction · 0.45

Calls 2

clampFunction · 0.50
Vec3faClass · 0.50

Tested by

no test coverage detected