Simplify assign_uvs_to_side error paths

This commit is contained in:
Kp 2015-02-03 00:37:07 +00:00
parent c6f95c5880
commit d38dd0aeef

View file

@ -374,11 +374,12 @@ static void assign_uvs_to_side(const vsegptridx_t segp, int sidenum, uvl *uva, u
const auto rotmat = [=]
{
const auto fvec = vm_vec_sub(Vertices[v1],Vertices[v0]);
if (fvec.x == 0 && fvec.y == 0 && fvec.z == 0)
return vmd_identity_matrix;
const auto rvec = vm_vec_sub(Vertices[v3],Vertices[v0]);
return (((fvec.x == 0) && (fvec.y == 0) && (fvec.z == 0)) || ((rvec.x == 0) && (rvec.y == 0) && (rvec.z == 0)))
? vmd_identity_matrix :
vm_vector_2_matrix(fvec,nullptr,&rvec);
if (rvec.x == 0 && rvec.y == 0 && rvec.z == 0)
return vmd_identity_matrix;
return vm_vector_2_matrix(fvec, nullptr, &rvec);
}();
const auto rvec = vm_vec_negated(rotmat.rvec);