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

Function CoordinateSystem

include/luxrays/core/geometry/vector.h:169–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169inline void CoordinateSystem(const Vector &v1, Vector *v2, Vector *v3) {
170 if (fabsf(v1.x) > fabsf(v1.y)) {
171 float invLen = 1.f / sqrtf(v1.x * v1.x + v1.z * v1.z);
172 *v2 = Vector(-v1.z * invLen, 0.f, v1.x * invLen);
173 } else {
174 float invLen = 1.f / sqrtf(v1.y * v1.y + v1.z * v1.z);
175 *v2 = Vector(0.f, v1.z * invLen, -v1.y * invLen);
176 }
177 *v3 = Cross(v1, *v2);
178}
179
180inline Vector SphericalDirection(float sintheta, float costheta, float phi) {
181 return Vector(sintheta * cosf(phi), sintheta * sinf(phi), costheta);

Callers 14

SampleHGFunction · 0.85
GetDifferentialsMethod · 0.85
SampleMethod · 0.85
PreprocessMethod · 0.85
EmitMethod · 0.85
PreprocessMethod · 0.85
PreprocessMethod · 0.85
EmitMethod · 0.85
PreprocessMethod · 0.85
PreprocessMethod · 0.85
PreprocessMethod · 0.85
InitMethod · 0.85

Calls 2

VectorClass · 0.70
CrossFunction · 0.70

Tested by

no test coverage detected