本文整理汇总了C++中FRotator::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ FRotator::Set方法的具体用法?C++ FRotator::Set怎么用?C++ FRotator::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FRotator
的用法示例。
在下文中一共展示了FRotator::Set方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConvertRuneAnimations
static void ConvertRuneAnimations(UMeshAnimation &Anim, const TArray<RJoint> &Bones,
const TArray<FRSkelAnimSeq> &Seqs)
{
guard(ConvertRuneAnimations);
int i, j;
int numBones = Bones.Num();
// create RefBones
Anim.RefBones.Empty(Bones.Num());
for (i = 0; i < Bones.Num(); i++)
{
const RJoint &SB = Bones[i];
FNamedBone *B = new(Anim.RefBones) FNamedBone;
B->Name = SB.name;
B->Flags = 0;
B->ParentIndex = SB.parent;
}
// create AnimSeqs
Anim.AnimSeqs.Empty(Seqs.Num());
Anim.Moves.Empty(Seqs.Num());
for (i = 0; i < Seqs.Num(); i++)
{
// create FMeshAnimSeq
const FRSkelAnimSeq &SS = Seqs[i];
FMeshAnimSeq *S = new(Anim.AnimSeqs) FMeshAnimSeq;
S->Name = SS.Name;
CopyArray(S->Groups, SS.Groups);
S->StartFrame = 0;
S->NumFrames = SS.NumFrames;
S->Rate = SS.Rate;
//?? S->Notifys
// create MotionChunk
MotionChunk *M = new(Anim.Moves) MotionChunk;
M->TrackTime = SS.NumFrames;
// dummy bone remap
M->AnimTracks.Empty(numBones);
// convert animation data
const byte *data = &SS.animdata[0];
for (j = 0; j < numBones; j++)
{
// prepare AnalogTrack
AnalogTrack *A = new(M->AnimTracks) AnalogTrack;
A->KeyQuat.Empty(SS.NumFrames);
A->KeyPos.Empty(SS.NumFrames);
A->KeyTime.Empty(SS.NumFrames);
}
for (int frame = 0; frame < SS.NumFrames; frame++)
{
for (int joint = 0; joint < numBones; joint++)
{
AnalogTrack &A = M->AnimTracks[joint];
FVector pos, scale;
pos.Set(0, 0, 0);
scale.Set(1, 1, 1);
FRotator rot;
rot.Set(0, 0, 0);
byte f = *data++;
int16 d;
#define GET d = data[0] + (data[1] << 8); data += 2;
#define GETF(v) { GET; v = (float)d / 256.0f; }
#define GETI(v) { GET; v = d; }
// decode position
if (f & 1) GETF(pos.X);
if (f & 2) GETF(pos.Y);
if (f & 4) GETF(pos.Z);
// decode scale
if (f & 8) { GETF(scale.X); GETF(scale.Z); }
if (f & 0x10) GETF(scale.Y);
// decode rotation
if (f & 0x20) GETI(rot.Pitch);
if (f & 0x40) GETI(rot.Yaw);
if (f & 0x80) GETI(rot.Roll);
#undef GET
#undef GETF
#undef GETI
A.KeyQuat.Add(EulerToQuat(rot));
A.KeyPos.Add(pos);
//?? notify about scale!=(1,1,1)
}
}
assert(data == &SS.animdata[0] + SS.animdata.Num());
}
unguard;
}