Skip to content

Instantly share code, notes, and snippets.

@ming4883
Last active February 17, 2017 07:14
Show Gist options
  • Save ming4883/55c0086db16e0186e13463d4caa042d2 to your computer and use it in GitHub Desktop.
Save ming4883/55c0086db16e0186e13463d4caa042d2 to your computer and use it in GitHub Desktop.
Unreal Engine 4 OrthoNormalize
struct FCustomUtils
{
static void OrthoNormalize(FVector& Normal, FVector& Tangent)
{
Normal = Normal.GetUnsafeNormal();
Tangent = Tangent - (Normal * FVector::DotProduct(Tangent, Normal));
Tangent = Tangent.GetUnsafeNormal();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment