disk/rectangle shape: be less paranoid about shear

metadata
Wenzel Jakob 2013-10-15 15:02:29 +02:00
parent f831e0ba99
commit 6baac6fb73
2 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ public:
Vector dpdu = trafo(Vector(1, 0, 0));
Vector dpdv = trafo(Vector(0, 1, 0));
if (std::abs(dot(dpdu, dpdv)) > 1e-3f)
if (std::abs(dot(normalize(dpdu), normalize(dpdv))) > 1e-3f)
Log(EError, "Error: 'toWorld' transformation contains shear!");
if (std::abs(dpdu.length() / dpdv.length() - 1) > 1e-3f)

View File

@ -105,7 +105,7 @@ public:
m_frame = Frame(normalize(m_dpdu), normalize(m_dpdv), normal);
m_invSurfaceArea = 1.0f / getSurfaceArea();
if (std::abs(dot(m_dpdu, m_dpdv)) > Epsilon)
if (std::abs(dot(normalize(m_dpdu), normalize(m_dpdv))) > Epsilon)
Log(EError, "Error: 'toWorld' transformation contains shear!");
}