public static CopyAndTransformVInfo BMDVInfoTransformationByMat4(Mat4 mat) { return new CopyAndTransformVInfo( (VInfo basis, out VInfo result) => { BMDVInfo bmd = basis as BMDVInfo; if (bmd == null) throw new Exception("Can't treat some random VInfo as though it were a BMDVInfo when it isn't!"); result = new BMDVInfo { material = bmd.material, uv = bmd.uv, normal = Vec3.Normalize(mat.TransformVec3(bmd.normal, 0.0)) }; }); }
public static CopyAndTransformVInfo BMDVInfoTransformationByMat4(Mat4 mat) { return(new CopyAndTransformVInfo( (VInfo basis, out VInfo result) => { BMDVInfo bmd = basis as BMDVInfo; if (bmd == null) { throw new Exception("Can't treat some random VInfo as though it were a BMDVInfo when it isn't!"); } result = new BMDVInfo { material = bmd.material, uv = bmd.uv, normal = Vec3.Normalize(mat.TransformVec3(bmd.normal, 0.0)) }; })); }