123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167 |
- /*******************************************************************************
- The content of this file includes portions of the proprietary AUDIOKINETIC Wwise
- Technology released in source code form as part of the game integration package.
- The content of this file may not be used without valid licenses to the
- AUDIOKINETIC Wwise Technology.
- Note that the use of the game engine is subject to the Unreal(R) Engine End User
- License Agreement at https://www.unrealengine.com/en-US/eula/unreal
-
- License Usage
-
- Licensees holding valid licenses to the AUDIOKINETIC Wwise Technology may use
- this file in accordance with the end user license agreement provided with the
- software or, alternatively, in accordance with the terms contained
- in a written agreement between you and Audiokinetic Inc.
- Copyright (c) 2023 Audiokinetic Inc.
- *******************************************************************************/
- #pragma once
- #include "AkInclude.h"
- #include "MovieSceneSection.h"
- #include "Channels/MovieSceneFloatChannel.h"
- #include "MovieSceneFloatChannelSerializationHelper.generated.h"
- USTRUCT()
- struct FMovieSceneTangentDataSerializationHelper
- {
- GENERATED_BODY()
- FMovieSceneTangentDataSerializationHelper() {}
- FMovieSceneTangentDataSerializationHelper(const FMovieSceneTangentData TangentData)
- : ArriveTangent(TangentData.ArriveTangent)
- , LeaveTangent(TangentData.LeaveTangent)
- , TangentWeightMode(TangentData.TangentWeightMode)
- , ArriveTangentWeight(TangentData.ArriveTangentWeight)
- , LeaveTangentWeight(TangentData.LeaveTangentWeight)
- {
- }
- UPROPERTY()
- float ArriveTangent = 0.f;
- UPROPERTY()
- float LeaveTangent = 0.f;
- UPROPERTY()
- TEnumAsByte<ERichCurveTangentWeightMode> TangentWeightMode = ERichCurveTangentWeightMode();
- UPROPERTY()
- float ArriveTangentWeight = 0.f;
- UPROPERTY()
- float LeaveTangentWeight = 0.f;
- };
- USTRUCT()
- struct FMovieSceneFloatValueSerializationHelper
- {
- GENERATED_BODY()
- FMovieSceneFloatValueSerializationHelper() {}
- FMovieSceneFloatValueSerializationHelper(FMovieSceneFloatValue FloatValue)
- : Value(FloatValue.Value)
- , InterpMode(FloatValue.InterpMode)
- , TangentMode(FloatValue.TangentMode)
- , Tangent(FloatValue.Tangent)
- {
- }
- FMovieSceneFloatValue ToFloatValue()
- {
- FMovieSceneFloatValue ValueToReturn(Value);
- ValueToReturn.InterpMode = InterpMode;
- ValueToReturn.TangentMode = TangentMode;
- ValueToReturn.Tangent.ArriveTangent = Tangent.ArriveTangent;
- ValueToReturn.Tangent.ArriveTangentWeight = Tangent.ArriveTangentWeight;
- ValueToReturn.Tangent.LeaveTangent = Tangent.LeaveTangent;
- ValueToReturn.Tangent.LeaveTangentWeight = Tangent.LeaveTangentWeight;
- ValueToReturn.Tangent.TangentWeightMode = Tangent.TangentWeightMode;
- return ValueToReturn;
- }
- UPROPERTY()
- float Value = 0.f;
- UPROPERTY()
- TEnumAsByte<ERichCurveInterpMode> InterpMode = ERichCurveInterpMode();
- UPROPERTY()
- TEnumAsByte<ERichCurveTangentMode> TangentMode = ERichCurveTangentMode();
- UPROPERTY()
- FMovieSceneTangentDataSerializationHelper Tangent;
- };
- USTRUCT()
- struct FMovieSceneFloatChannelSerializationHelper
- {
- GENERATED_BODY()
- FMovieSceneFloatChannelSerializationHelper() {}
- const FMovieSceneFloatChannelSerializationHelper& operator= (const FMovieSceneFloatChannel& FloatChannel)
- {
- Times.Reset();
- Values.Reset();
-
- PreInfinityExtrap = FloatChannel.PreInfinityExtrap;
- PostInfinityExtrap = FloatChannel.PostInfinityExtrap;
- auto FloatChannelTimes = FloatChannel.GetTimes();
- auto FloatChannelValues = FloatChannel.GetValues();
- for (int i = 0; i < FloatChannelTimes.Num(); i++)
- {
- Times.Add(FloatChannelTimes[i].Value);
- Values.Add(FMovieSceneFloatValueSerializationHelper(FloatChannelValues[i]));
- }
- bHasDefaultValue = FloatChannel.GetDefault().IsSet();
- if (bHasDefaultValue)
- {
- DefaultValue = FloatChannel.GetDefault().GetValue();
- }
- return *this;
- }
- void ToFloatChannel(FMovieSceneFloatChannel& FloatChannel)
- {
- FloatChannel.Reset();
- FloatChannel.PreInfinityExtrap = PreInfinityExtrap;
- FloatChannel.PostInfinityExtrap = PostInfinityExtrap;
- TArray<FFrameNumber> FloatChannelTimes;
- TArray<FMovieSceneFloatValue> FloatChannelValues;
- for (int i = 0; i < Times.Num(); i++)
- {
- FloatChannelTimes.Add(Times[i]);
- FloatChannelValues.Add(Values[i].ToFloatValue());
- }
- FloatChannel.Set(FloatChannelTimes, FloatChannelValues);
- if (bHasDefaultValue)
- {
- FloatChannel.SetDefault(DefaultValue);
- }
- }
- UPROPERTY()
- TEnumAsByte<ERichCurveExtrapolation> PreInfinityExtrap = ERichCurveExtrapolation();
- UPROPERTY()
- TEnumAsByte<ERichCurveExtrapolation> PostInfinityExtrap = ERichCurveExtrapolation();
- UPROPERTY()
- TArray<int32> Times;
- UPROPERTY()
- TArray<FMovieSceneFloatValueSerializationHelper> Values;
- UPROPERTY()
- float DefaultValue = 0.f;
- UPROPERTY()
- bool bHasDefaultValue = false;
- };
|