mirror of
https://github.com/simtactics/niotso.git
synced 2025-03-22 02:52:18 +00:00
Fixed writing to Skeleton.Bones[-1] when FindBone() returns -1 because, say, PELVISPOLY does not exist
This commit is contained in:
parent
e3f6880ed2
commit
6df7a494a1
1 changed files with 17 additions and 14 deletions
|
@ -217,20 +217,23 @@ void AdvanceFrame(Skeleton_t& Skeleton, Animation_t& Animation){
|
||||||
static unsigned Frame = 0;
|
static unsigned Frame = 0;
|
||||||
|
|
||||||
for(unsigned i=0; i<Animation.MotionsCount; i++){
|
for(unsigned i=0; i<Animation.MotionsCount; i++){
|
||||||
Bone_t& Bone = Skeleton.Bones[FindBone(Skeleton, Animation.Motions[i].BoneName, Skeleton.BoneCount)];
|
unsigned BoneIndex = FindBone(Skeleton, Animation.Motions[i].BoneName, Skeleton.BoneCount);
|
||||||
|
if(BoneIndex != (unsigned)-1){
|
||||||
if(Animation.Motions[i].HasTranslation){
|
Bone_t& Bone = Skeleton.Bones[BoneIndex];
|
||||||
Translation_t& Translation = Animation.Motions[i].Translations[Frame];
|
|
||||||
Bone.Translation.x = Translation.x;
|
if(Animation.Motions[i].HasTranslation){
|
||||||
Bone.Translation.y = Translation.y;
|
Translation_t& Translation = Animation.Motions[i].Translations[Frame];
|
||||||
Bone.Translation.z = Translation.z;
|
Bone.Translation.x = Translation.x;
|
||||||
}
|
Bone.Translation.y = Translation.y;
|
||||||
if(Animation.Motions[i].HasRotation){
|
Bone.Translation.z = Translation.z;
|
||||||
Rotation_t& Rotation = Animation.Motions[i].Rotations[Frame];
|
}
|
||||||
Bone.Rotation.x = Rotation.x;
|
if(Animation.Motions[i].HasRotation){
|
||||||
Bone.Rotation.y = Rotation.y;
|
Rotation_t& Rotation = Animation.Motions[i].Rotations[Frame];
|
||||||
Bone.Rotation.z = Rotation.z;
|
Bone.Rotation.x = Rotation.x;
|
||||||
Bone.Rotation.w = Rotation.w;
|
Bone.Rotation.y = Rotation.y;
|
||||||
|
Bone.Rotation.z = Rotation.z;
|
||||||
|
Bone.Rotation.w = Rotation.w;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue