Slight llcharacter updates from v2 (should be safe)
This commit is contained in:
@@ -48,10 +48,10 @@ using namespace std;
|
|||||||
|
|
||||||
#define INCHES_TO_METERS 0.02540005f
|
#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 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;
|
const F32 ROTATION_MOTION_THRESHOLD = 0.001f;
|
||||||
|
|
||||||
char gInFile[1024]; /* Flawfinder: ignore */
|
char gInFile[1024]; /* Flawfinder: ignore */
|
||||||
@@ -1202,7 +1202,7 @@ void LLBVHLoader::optimize()
|
|||||||
if (ki_prev == ki_last_good_pos)
|
if (ki_prev == ki_last_good_pos)
|
||||||
{
|
{
|
||||||
joint->mNumPosKeys++;
|
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;
|
pos_changed = TRUE;
|
||||||
}
|
}
|
||||||
@@ -1215,12 +1215,12 @@ void LLBVHLoader::optimize()
|
|||||||
LLVector3 current_pos(ki->mPos);
|
LLVector3 current_pos(ki->mPos);
|
||||||
LLVector3 interp_pos = lerp(current_pos, last_good_pos, 1.f / (F32)numPosFramesConsidered);
|
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;
|
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;
|
ki_prev->mIgnorePos = TRUE;
|
||||||
numPosFramesConsidered++;
|
numPosFramesConsidered++;
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ public:
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
S32 getVisualParamCount() { return (S32)mVisualParamIndexMap.size(); }
|
S32 getVisualParamCount() const { return (S32)mVisualParamIndexMap.size(); }
|
||||||
LLVisualParam* getVisualParam(const char *name);
|
LLVisualParam* getVisualParam(const char *name);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,6 @@
|
|||||||
#include "llquaternion.h"
|
#include "llquaternion.h"
|
||||||
#include "v3dmath.h"
|
#include "v3dmath.h"
|
||||||
#include "v3math.h"
|
#include "v3math.h"
|
||||||
#include "llapr.h"
|
|
||||||
#include "llbvhconsts.h"
|
#include "llbvhconsts.h"
|
||||||
|
|
||||||
class LLKeyframeDataCache;
|
class LLKeyframeDataCache;
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ BOOL LLKeyframeStandMotion::onUpdate(F32 time, U8* joint_mask)
|
|||||||
if (dot(mPelvisState->getJoint()->getWorldRotation(), mLastGoodPelvisRotation) < ROTATION_THRESHOLD)
|
if (dot(mPelvisState->getJoint()->getWorldRotation(), mLastGoodPelvisRotation) < ROTATION_THRESHOLD)
|
||||||
{
|
{
|
||||||
mLastGoodPelvisRotation = mPelvisState->getJoint()->getWorldRotation();
|
mLastGoodPelvisRotation = mPelvisState->getJoint()->getWorldRotation();
|
||||||
mLastGoodPelvisRotation.normQuat();
|
mLastGoodPelvisRotation.normalize();
|
||||||
mTrackAnkles = TRUE;
|
mTrackAnkles = TRUE;
|
||||||
}
|
}
|
||||||
else if ((mCharacter->getCharacterPosition() - mLastGoodPosition).magVecSquared() > POSITION_THRESHOLD)
|
else if ((mCharacter->getCharacterPosition() - mLastGoodPosition).magVecSquared() > POSITION_THRESHOLD)
|
||||||
|
|||||||
@@ -36,12 +36,12 @@
|
|||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Header Files
|
// Header Files
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "llmap.h"
|
|
||||||
#include "lljointstate.h"
|
#include "lljointstate.h"
|
||||||
#include "lljoint.h"
|
#include "lljoint.h"
|
||||||
|
#include "llmap.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user