Massive sunshine/viewer-dev catchup. Further implemented serverside baking and added/updated metrics feedback.

This commit is contained in:
Shyotl
2013-02-19 01:50:46 -06:00
parent c3c34deb10
commit 76f3dc9e19
72 changed files with 3945 additions and 994 deletions

View File

@@ -127,30 +127,73 @@ BOOL LLHandMotion::onUpdate(F32 time, U8* joint_mask)
mLastTime = time;
requestedHandPose = (eHandPose *)mCharacter->getAnimationData("Hand Pose");
// <edit>
if(requestedHandPose && *requestedHandPose >= NUM_HAND_POSES)
{
llwarns << "requested hand pose >= NUM_HAND_POSES" << llendl;
requestedHandPose = &mCurrentPose;
}
// </edit>
// check to see if requested pose has changed
if (!requestedHandPose)
{
if (mNewPose != HAND_POSE_RELAXED && mNewPose != mCurrentPose)
{
mCharacter->setVisualParamWeight(gHandPoseNames[mNewPose], 0.f);
// Only set param weight for poses other than
// default (HAND_POSE_SPREAD); HAND_POSE_SPREAD
// is not an animatable morph!
if (mNewPose != HAND_POSE_SPREAD)
{
mCharacter->setVisualParamWeight(gHandPoseNames[mNewPose], 0.f);
}
// Reset morph weight for current pose back to its
// full extend or it might be stuck somewhere in the middle if a
// pose is requested and the old pose is requested again shortly
// after while still blending to the other pose!
if (mCurrentPose != HAND_POSE_SPREAD)
{
mCharacter->setVisualParamWeight(gHandPoseNames[mCurrentPose], 1.f);
}
// Update visual params now if we won't blend
if (mCurrentPose == HAND_POSE_RELAXED)
{
mCharacter->updateVisualParams();
}
}
mNewPose = HAND_POSE_RELAXED;
}
else
{
// this is a new morph we didn't know about before
if (*requestedHandPose != mNewPose && mNewPose != mCurrentPose && mNewPose != HAND_POSE_SPREAD)
// Sometimes we seem to get garbage here, with poses that are out of bounds.
// So check for a valid pose first.
if (*requestedHandPose >= 0 && *requestedHandPose < NUM_HAND_POSES)
{
mCharacter->setVisualParamWeight(gHandPoseNames[mNewPose], 0.f);
// This is a new morph we didn't know about before:
// Reset morph weight for both current and new pose
// back their starting values while still blending.
if (*requestedHandPose != mNewPose && mNewPose != mCurrentPose)
{
if (mNewPose != HAND_POSE_SPREAD)
{
mCharacter->setVisualParamWeight(gHandPoseNames[mNewPose], 0.f);
}
// Reset morph weight for current pose back to its full extend
// or it might be stuck somewhere in the middle if a pose is
// requested and the old pose is requested again shortly after
// while still blending to the other pose!
if (mCurrentPose != HAND_POSE_SPREAD)
{
mCharacter->setVisualParamWeight(gHandPoseNames[mCurrentPose], 1.f);
}
// Update visual params now if we won't blend
if (mCurrentPose == *requestedHandPose)
{
mCharacter->updateVisualParams();
}
}
mNewPose = *requestedHandPose;
}
else
{
llwarns << "Requested hand pose out of range. Ignoring requested pose." << llendl;
}
mNewPose = *requestedHandPose;
}
mCharacter->removeAnimationData("Hand Pose");

View File

@@ -50,6 +50,7 @@ const U32 MAX_MOTION_INSTANCES = 32;
//-----------------------------------------------------------------------------
// Constants and statics
//-----------------------------------------------------------------------------
F32 LLMotionController::sCurrentTimeFactor = 1.f;
LLMotionRegistry LLMotionController::sRegistry;
//-----------------------------------------------------------------------------
@@ -133,7 +134,7 @@ LLMotion *LLMotionRegistry::createMotion( const LLUUID &id )
// Class Constructor
//-----------------------------------------------------------------------------
LLMotionController::LLMotionController()
: mTimeFactor(1.f),
: mTimeFactor(sCurrentTimeFactor),
mCharacter(NULL),
mAnimTime(0.f),
mPrevTimerElapsed(0.f),

View File

@@ -174,6 +174,9 @@ public:
const LLFrameTimer& getFrameTimer() { return mTimer; }
static F32 getCurrentTimeFactor() { return sCurrentTimeFactor; };
static void setCurrentTimeFactor(F32 factor) { sCurrentTimeFactor = factor; };
protected:
// internal operations act on motion instances directly
// as there can be duplicate motions per id during blending overlap
@@ -193,7 +196,8 @@ protected:
void deactivateStoppedMotions();
protected:
F32 mTimeFactor;
F32 mTimeFactor; // 1.f for normal speed
static F32 sCurrentTimeFactor; // Value to use for initialization
static LLMotionRegistry sRegistry;
LLPoseBlender mPoseBlender;