Slight llcharacter updates from v2 (should be safe)

This commit is contained in:
Shyotl
2011-05-15 22:22:22 -05:00
parent 37c5016c2f
commit e3435d7ef9
5 changed files with 9 additions and 10 deletions

View File

@@ -48,10 +48,10 @@ using namespace std;
#define INCHES_TO_METERS 0.02540005f
const F32 POSITION_KEYFRAME_THRESHOLD = 0.03f;
const F32 POSITION_KEYFRAME_THRESHOLD_SQUARED = 0.03f * 0.03f;
const F32 ROTATION_KEYFRAME_THRESHOLD = 0.01f;
const F32 POSITION_MOTION_THRESHOLD = 0.001f;
const F32 POSITION_MOTION_THRESHOLD_SQUARED = 0.001f * 0.001f;
const F32 ROTATION_MOTION_THRESHOLD = 0.001f;
char gInFile[1024]; /* Flawfinder: ignore */
@@ -1202,7 +1202,7 @@ void LLBVHLoader::optimize()
if (ki_prev == ki_last_good_pos)
{
joint->mNumPosKeys++;
if (dist_vec(LLVector3(ki_prev->mPos), first_frame_pos) > POSITION_MOTION_THRESHOLD)
if (dist_vec_squared(LLVector3(ki_prev->mPos), first_frame_pos) > POSITION_MOTION_THRESHOLD_SQUARED)
{
pos_changed = TRUE;
}
@@ -1215,12 +1215,12 @@ void LLBVHLoader::optimize()
LLVector3 current_pos(ki->mPos);
LLVector3 interp_pos = lerp(current_pos, last_good_pos, 1.f / (F32)numPosFramesConsidered);
if (dist_vec(current_pos, first_frame_pos) > POSITION_MOTION_THRESHOLD)
if (dist_vec_squared(current_pos, first_frame_pos) > POSITION_MOTION_THRESHOLD_SQUARED)
{
pos_changed = TRUE;
}
if (dist_vec(interp_pos, test_pos) < POSITION_KEYFRAME_THRESHOLD)
if (dist_vec_squared(interp_pos, test_pos) < POSITION_KEYFRAME_THRESHOLD_SQUARED)
{
ki_prev->mIgnorePos = TRUE;
numPosFramesConsidered++;

View File

@@ -261,7 +261,7 @@ public:
}
return 0;
}
S32 getVisualParamCount() { return (S32)mVisualParamIndexMap.size(); }
S32 getVisualParamCount() const { return (S32)mVisualParamIndexMap.size(); }
LLVisualParam* getVisualParam(const char *name);

View File

@@ -47,7 +47,6 @@
#include "llquaternion.h"
#include "v3dmath.h"
#include "v3math.h"
#include "llapr.h"
#include "llbvhconsts.h"
class LLKeyframeDataCache;

View File

@@ -190,7 +190,7 @@ BOOL LLKeyframeStandMotion::onUpdate(F32 time, U8* joint_mask)
if (dot(mPelvisState->getJoint()->getWorldRotation(), mLastGoodPelvisRotation) < ROTATION_THRESHOLD)
{
mLastGoodPelvisRotation = mPelvisState->getJoint()->getWorldRotation();
mLastGoodPelvisRotation.normQuat();
mLastGoodPelvisRotation.normalize();
mTrackAnkles = TRUE;
}
else if ((mCharacter->getCharacterPosition() - mLastGoodPosition).magVecSquared() > POSITION_THRESHOLD)

View File

@@ -36,12 +36,12 @@
//-----------------------------------------------------------------------------
// Header Files
//-----------------------------------------------------------------------------
#include <string>
#include "llmap.h"
#include "lljointstate.h"
#include "lljoint.h"
#include "llmap.h"
#include <map>
#include <string>
//-----------------------------------------------------------------------------