summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorHoward Stearns <aech@lindenlab.com>2022-01-28 20:15:17 +0000
committerHoward Stearns <aech@lindenlab.com>2022-01-28 20:15:17 +0000
commit3c5712f13ea4d4b40ef5d0f1cba667c667723d81 (patch)
tree56c53f8c1fb5905ee3e6872ee2c71dbb117ad180 /indra
parentee238855d180cf6bf533ff44e6af29d540de5b66 (diff)
parent80eb6e60f88a5c6353ed98363b7d4f6dbdfc078d (diff)
Merged in SL-316-a (pull request #848)
SL-316 (A) retain screw-case behavior Approved-by: Andrey Lihatskiy
Diffstat (limited to 'indra')
-rw-r--r--indra/llcharacter/llbvhloader.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp
index 7f99d22a17..c38614b0b4 100644
--- a/indra/llcharacter/llbvhloader.cpp
+++ b/indra/llcharacter/llbvhloader.cpp
@@ -874,6 +874,8 @@ ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 &
}
// If the user only supplies one animation frame (after the ignored reference frame 0), hold for mFrameTime.
+ // If the user supples exactly one total frame, it isn't clear if that is a pose or reference frame, and the
+ // behavior is not defined. In this case, retain historical undefined behavior.
mDuration = llmax((F32)(mNumFrames - NUMBER_OF_UNPLAYED_FRAMES), 1.0f) * mFrameTime;
if (!mLoop)
{
@@ -1383,11 +1385,7 @@ BOOL LLBVHLoader::serialize(LLDataPacker& dp)
continue;
}
- if (frame == 0) {
- LL_WARNS("BVH") << "ERROR: [line: " << getLineNumber() << "] Joint " << ki - joint->mKeys.begin() << " not marked to ignore rotation for initial frame. Not serializing." << LL_ENDL;
- return FALSE;
- }
- time = (F32)(frame - NUMBER_OF_IGNORED_FRAMES_AT_START) * mFrameTime; // Time elapsed before this frame starts.
+ time = llmax((F32)(frame - NUMBER_OF_IGNORED_FRAMES_AT_START), 0.0f) * mFrameTime; // Time elapsed before this frame starts.
if (mergeParent)
{
@@ -1463,11 +1461,7 @@ BOOL LLBVHLoader::serialize(LLDataPacker& dp)
continue;
}
- if (frame == 0) {
- LL_WARNS("BVH") << "ERROR: [line: " << getLineNumber() << "] Joint " << ki - joint->mKeys.begin() << " not marked to ignore position for initial frame. Not serializing." << LL_ENDL;
- return FALSE;
- }
- time = (F32)(frame - NUMBER_OF_IGNORED_FRAMES_AT_START) * mFrameTime; // Time elapsed before this frame starts.
+ time = llmax((F32)(frame - NUMBER_OF_IGNORED_FRAMES_AT_START), 0.0f) * mFrameTime; // Time elapsed before this frame starts.
LLVector3 inPos = (LLVector3(ki->mPos) - relKey) * ~first_frame_rot;// * fixup_rot;
LLVector3 outPos = inPos * frameRot * offsetRot;