Last active
February 17, 2017 07:14
-
-
Save ming4883/55c0086db16e0186e13463d4caa042d2 to your computer and use it in GitHub Desktop.
Unreal Engine 4 OrthoNormalize
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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