Skip to content

Instantly share code, notes, and snippets.

View Plimsky's full-sized avatar
🏳️‍🌈

Vincent Nicopolsky Plimsky

🏳️‍🌈
View GitHub Profile
@Plimsky
Plimsky / MotionCameraComponent.cpp
Last active January 8, 2025 20:40
Add rotation inertia to the camera of the UE Motion FPS plugin
void UMotionCameraComponent::GetCameraView(float DeltaTime, FMinimalViewInfo& DesiredView)
{
// ...
for (const TTuple<FString, UE::Math::TRotator<double>> & StaticRotationOffset: CameraStaticRotationOffsets)
{
UpdatedCameraRotation = FRotator(FQuat(UpdatedCameraRotation) * FQuat(StaticRotationOffset.Value));
}
UpdatedCameraRotation = FRotator(FQuat(UpdatedCameraRotation) * FQuat(CameraRotatorFromCurves));