public override void ApplyLinearTransform(Matrix4x4 transform, bool enablePerspective = false) { base.ApplyLinearTransform(transform, enablePerspective); if (transform.IsTranslationOnly()) { return; } Matrix4x4 normalTransform = transform.CofactorMatrix(); foreach (Halfedge e in new List <Halfedge>(normals.Keys)) { normals[e] = normalTransform.MultiplyVector(normals[e]).normalized; } foreach (Halfedge e in new List <Halfedge>(tangents.Keys)) { tangents[e] = transform.MultiplyVector(tangents[e]).normalized; } }
public static Matrix4x4 Adjugate(this Matrix4x4 matrix) { return(matrix.CofactorMatrix().transpose); }