MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / update

Method update

Source/Falcor/Scene/Lights/Light.cpp:313–330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311 }
312
313 void DistantLight::update()
314 {
315 // Update transformation matrices
316 // Assumes that mData.dirW is normalized
317 const float3 up(0.f, 0.f, 1.f);
318 float3 vec = cross(up, -mData.dirW);
319 float sinTheta = length(vec);
320 if (sinTheta > 0.f)
321 {
322 float cosTheta = dot(up, -mData.dirW);
323 mData.transMat = math::matrixFromRotation(std::acos(cosTheta), vec);
324 }
325 else
326 {
327 mData.transMat = float4x4::identity();
328 }
329 mData.transMatIT = inverse(transpose(mData.transMat));
330 }
331
332 void DistantLight::updateFromAnimation(const float4x4& transform)
333 {

Callers

nothing calls this directly

Calls 12

matrixFromRotationFunction · 0.85
transposeFunction · 0.85
matrixFromScalingFunction · 0.85
crossFunction · 0.50
lengthFunction · 0.50
dotFunction · 0.50
acosFunction · 0.50
inverseFunction · 0.50
mulFunction · 0.50
updateFunction · 0.50
transformVectorFunction · 0.50
powFunction · 0.50

Tested by

no test coverage detected