MCPcopy Create free account
hub / github.com/LuxCoreRender/LuxCore / UniformSampleCone

Function UniformSampleCone

src/luxrays/utils/mc.cpp:154–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154Vector UniformSampleCone(const float u1, const float u2, float costhetamax) {
155 const float costheta = Lerp(u1, 1.f, costhetamax);
156 const float u1x = (1.f - costhetamax) * u1;
157 const float sintheta = sqrtf(Max(0.f, u1x * (2.f - u1x)));
158 const float phi = u2 * 2.f * M_PI;
159 return Vector(cosf(phi) * sintheta, sinf(phi) * sintheta, costheta);
160}
161
162Vector UniformSampleCone(const float u1, const float u2, float costhetamax,
163 const Vector &x, const Vector &y, const Vector &z) {

Callers 7

EmitMethod · 0.85
IlluminateMethod · 0.85
EmitMethod · 0.85
IlluminateMethod · 0.85
IlluminateMethod · 0.85
EmitMethod · 0.85
EmitMethod · 0.85

Calls 3

LerpFunction · 0.85
MaxFunction · 0.85
VectorClass · 0.50

Tested by

no test coverage detected