本文整理汇总了C++中FTransform::Blend方法的典型用法代码示例。如果您正苦于以下问题:C++ FTransform::Blend方法的具体用法?C++ FTransform::Blend怎么用?C++ FTransform::Blend使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FTransform
的用法示例。
在下文中一共展示了FTransform::Blend方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TLerp
FTransform UKismetMathLibrary::TLerp(const FTransform& A, const FTransform& B, float Alpha)
{
FTransform Result;
FTransform NA = A;
FTransform NB = B;
NA.NormalizeRotation();
NB.NormalizeRotation();
Result.Blend(NA, NB, Alpha);
return Result;
}
示例2: FactoryCreateText
//.........这里部分代码省略.........
}
int32 UpperKeyIndex = LowerKeyIndex + 1;
float UpperKeyTime = 0.0f;
if (UpperKeyIndex >= Timeline.Keys.Num())
{
UpperKeyTime = DurationInSeconds;
if (Animation.bIsLooping)
{
UpperKeyIndex = 0;
}
else
{
UpperKeyIndex = Timeline.Keys.Num() - 1;
}
}
else
{
UpperKeyTime = Timeline.Keys[UpperKeyIndex].TimeInMS * 0.001f;
}
const FSpriterFatTimelineKey& TimelineKey0 = Timeline.Keys[LowerKeyIndex];
const FSpriterFatTimelineKey& TimelineKey1 = Timeline.Keys[UpperKeyIndex];
const float LowerKeyTime = TimelineKey0.TimeInMS * 0.001f;
const FTransform LocalTransform0 = TimelineKey0.Info.ConvertToTransform();
const FTransform LocalTransform1 = TimelineKey1.Info.ConvertToTransform();
FTransform LocalTransform = LocalTransform0;
if (LowerKeyIndex != UpperKeyIndex)
{
const float Alpha = (CurrentSampleTime - LowerKeyTime) / (UpperKeyTime - LowerKeyTime);
LocalTransform.Blend(LocalTransform0, LocalTransform1, Alpha);
}
RawTrack.ScaleKeys.Add(LocalTransform.GetScale3D());
RawTrack.PosKeys.Add(LocalTransform.GetTranslation());
RawTrack.RotKeys.Add(LocalTransform.GetRotation());
++NumKeysForTrack;
CurrentSampleTime += TimePerKey;
}
//
// for (const FSpriterFatTimelineKey& TimelineKey : Timeline.Keys)
// {
// //@TODO: Ignoring TimeInMS
// const FTransform LocalTransform = TimelineKey.Info.ConvertToTransform();
//
// RawTrack.ScaleKeys.Add(LocalTransform.GetScale3D());
// RawTrack.PosKeys.Add(LocalTransform.GetTranslation());
// RawTrack.RotKeys.Add(LocalTransform.GetRotation());
//
// ++NumKeysForTrack;
// }
//
RawAnimationData.Add(RawTrack);
AnimationAsset->AnimationTrackNames.Add(BoneName);
// add mapping to skeleton bone track
AnimationAsset->TrackToSkeletonMapTable.Add(FTrackToSkeletonMap(RefBoneIndex));
TotalNumKeys = FMath::Max(TotalNumKeys, NumKeysForTrack);