第一次提交

This commit is contained in:
不明不惑
2026-03-03 01:23:02 +08:00
commit 3e434877e8
1053 changed files with 102411 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
// Copyright 2025 https://yuewu.dev/en All Rights Reserved.
#include "Utility/GMS_Vector.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(GMS_Vector)
FVector UGMS_Vector::SlerpSkipNormalization(const FVector& From, const FVector& To, const float Ratio)
{
// http://number-none.com/product/Understanding%20Slerp,%20Then%20Not%20Using%20It/
auto Dot{From | To};
if (Dot > 0.9995f)
{
return FMath::Lerp(From, To, Ratio).GetSafeNormal();
}
Dot = FMath::Max(-1.0f, Dot);
const auto Theta{UE_REAL_TO_FLOAT(FMath::Acos(Dot)) * Ratio};
float Sin, Cos;
FMath::SinCos(&Sin, &Cos, Theta);
auto FromPerpendicular{To - From * Dot};
FromPerpendicular.Normalize();
return From * Cos + FromPerpendicular * Sin;
}