diff options
Diffstat (limited to 'indra/llcharacter')
-rw-r--r-- | indra/llcharacter/llcharacter.cpp | 2 | ||||
-rw-r--r-- | indra/llcharacter/llheadrotmotion.cpp | 4 | ||||
-rw-r--r-- | indra/llcharacter/lljointsolverrp3.cpp | 17 | ||||
-rw-r--r-- | indra/llcharacter/llkeyframefallmotion.cpp | 2 | ||||
-rw-r--r-- | indra/llcharacter/llkeyframemotion.cpp | 2 | ||||
-rw-r--r-- | indra/llcharacter/llmotioncontroller.cpp | 14 |
6 files changed, 28 insertions, 13 deletions
diff --git a/indra/llcharacter/llcharacter.cpp b/indra/llcharacter/llcharacter.cpp index 8874df32f5..376f096642 100644 --- a/indra/llcharacter/llcharacter.cpp +++ b/indra/llcharacter/llcharacter.cpp @@ -190,7 +190,7 @@ void LLCharacter::requestStopMotion( LLMotion* motion) //----------------------------------------------------------------------------- void LLCharacter::updateMotions(e_update_t update_type) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; if (update_type == HIDDEN_UPDATE) { mMotionController.updateMotionsMinimal(); diff --git a/indra/llcharacter/llheadrotmotion.cpp b/indra/llcharacter/llheadrotmotion.cpp index fdf97266a3..07a3aaebb6 100644 --- a/indra/llcharacter/llheadrotmotion.cpp +++ b/indra/llcharacter/llheadrotmotion.cpp @@ -175,7 +175,7 @@ BOOL LLHeadRotMotion::onActivate() //----------------------------------------------------------------------------- BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; LLQuaternion targetHeadRotWorld; LLQuaternion currentRootRotWorld = mRootJoint->getWorldRotation(); LLQuaternion currentInvRootRotWorld = ~currentRootRotWorld; @@ -459,7 +459,7 @@ void LLEyeMotion::adjustEyeTarget(LLVector3* targetPos, LLJointState& left_eye_s //----------------------------------------------------------------------------- BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; //calculate jitter if (mEyeJitterTimer.getElapsedTimeF32() > mEyeJitterTime) { diff --git a/indra/llcharacter/lljointsolverrp3.cpp b/indra/llcharacter/lljointsolverrp3.cpp index 69a7e3dc6e..f3d5e2e324 100644 --- a/indra/llcharacter/lljointsolverrp3.cpp +++ b/indra/llcharacter/lljointsolverrp3.cpp @@ -1,6 +1,6 @@ /** * @file lljointsolverrp3.cpp - * @brief Implementation of LLJointSolverRP3 class. + * @brief Implementation of Joint Solver in 3D Real Projective space (RP3). See: https://en.wikipedia.org/wiki/Real_projective_space * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code @@ -35,6 +35,11 @@ #define F_EPSILON 0.00001f +#if LL_RELEASE + #define DEBUG_JOINT_SOLVER 0 +#else + #define DEBUG_JOINT_SOLVER 1 +#endif //----------------------------------------------------------------------------- // Constructor @@ -150,6 +155,7 @@ void LLJointSolverRP3::solve() LLVector3 cPos = mJointC->getWorldPosition(); LLVector3 gPos = mJointGoal->getWorldPosition(); +#if DEBUG_JOINT_SOLVER LL_DEBUGS("JointSolver") << "LLJointSolverRP3::solve()" << LL_NEWLINE << "bPosLocal = " << mJointB->getPosition() << LL_NEWLINE << "cPosLocal = " << mJointC->getPosition() << LL_NEWLINE @@ -159,6 +165,7 @@ void LLJointSolverRP3::solve() << "bPos : " << bPos << LL_NEWLINE << "cPos : " << cPos << LL_NEWLINE << "gPos : " << gPos << LL_ENDL; +#endif //------------------------------------------------------------------------- // get the poleVector in world space @@ -194,6 +201,7 @@ void LLJointSolverRP3::solve() //------------------------------------------------------------------------- LLVector3 abacCompOrthoVec = abVec - acVec * ((abVec * acVec)/(acVec * acVec)); +#if DEBUG_JOINT_SOLVER LL_DEBUGS("JointSolver") << "abVec : " << abVec << LL_NEWLINE << "bcVec : " << bcVec << LL_NEWLINE << "acVec : " << acVec << LL_NEWLINE @@ -202,6 +210,7 @@ void LLJointSolverRP3::solve() << "bcLen : " << bcLen << LL_NEWLINE << "agLen : " << agLen << LL_NEWLINE << "abacCompOrthoVec : " << abacCompOrthoVec << LL_ENDL; +#endif //------------------------------------------------------------------------- // compute the normal of the original ABC plane (and store for later) @@ -269,6 +278,7 @@ void LLJointSolverRP3::solve() LLQuaternion bRot(theta - abbcAng, abbcOrthoVec); +#if DEBUG_JOINT_SOLVER LL_DEBUGS("JointSolver") << "abbcAng : " << abbcAng << LL_NEWLINE << "abbcOrthoVec : " << abbcOrthoVec << LL_NEWLINE << "agLenSq : " << agLenSq << LL_NEWLINE @@ -280,6 +290,7 @@ void LLJointSolverRP3::solve() << abbcAng*180.0f/F_PI << " " << (theta - abbcAng)*180.0f/F_PI << LL_ENDL; +#endif //------------------------------------------------------------------------- // compute rotation that rotates new A->C to A->G @@ -293,9 +304,11 @@ void LLJointSolverRP3::solve() LLQuaternion cgRot; cgRot.shortestArc( acVec, agVec ); +#if DEBUG_JOINT_SOLVER LL_DEBUGS("JointSolver") << "bcVec : " << bcVec << LL_NEWLINE << "acVec : " << acVec << LL_NEWLINE << "cgRot : " << cgRot << LL_ENDL; +#endif // update A->B and B->C with rotation from C to G abVec = abVec * cgRot; @@ -358,11 +371,13 @@ void LLJointSolverRP3::solve() //------------------------------------------------------------------------- LLQuaternion twistRot( mTwist, agVec ); +#if DEBUG_JOINT_SOLVER LL_DEBUGS("JointSolver") << "abcNorm = " << abcNorm << LL_NEWLINE << "apgNorm = " << apgNorm << LL_NEWLINE << "pRot = " << pRot << LL_NEWLINE << "twist : " << mTwist*180.0/F_PI << LL_NEWLINE << "twistRot : " << twistRot << LL_ENDL; +#endif //------------------------------------------------------------------------- // compute rotation of A diff --git a/indra/llcharacter/llkeyframefallmotion.cpp b/indra/llcharacter/llkeyframefallmotion.cpp index 9a41ba4d3d..e8bb2bf95d 100644 --- a/indra/llcharacter/llkeyframefallmotion.cpp +++ b/indra/llcharacter/llkeyframefallmotion.cpp @@ -121,7 +121,7 @@ BOOL LLKeyframeFallMotion::onActivate() //----------------------------------------------------------------------------- BOOL LLKeyframeFallMotion::onUpdate(F32 activeTime, U8* joint_mask) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; BOOL result = LLKeyframeMotion::onUpdate(activeTime, joint_mask); F32 slerp_amt = clamp_rescale(activeTime / getDuration(), 0.5f, 0.75f, 0.f, 1.f); diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index 5a5aa2c83e..a25ff16786 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -677,7 +677,7 @@ BOOL LLKeyframeMotion::onActivate() //----------------------------------------------------------------------------- BOOL LLKeyframeMotion::onUpdate(F32 time, U8* joint_mask) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; // llassert(time >= 0.f); // This will fire time = llmax(0.f, time); diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index d4546ce901..e66714388a 100644 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -503,7 +503,7 @@ void LLMotionController::resetJointSignatures() //----------------------------------------------------------------------------- void LLMotionController::updateIdleMotion(LLMotion* motionp) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; if (motionp->isStopped() && mAnimTime > motionp->getStopTime() + motionp->getEaseOutDuration()) { deactivateMotionInstance(motionp); @@ -542,7 +542,7 @@ void LLMotionController::updateIdleMotion(LLMotion* motionp) //----------------------------------------------------------------------------- void LLMotionController::updateIdleActiveMotions() { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; for (motion_list_t::iterator iter = mActiveMotions.begin(); iter != mActiveMotions.end(); ) { @@ -557,7 +557,7 @@ void LLMotionController::updateIdleActiveMotions() //----------------------------------------------------------------------------- void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_type) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; BOOL update_result = TRUE; U8 last_joint_signature[LL_CHARACTER_MAX_ANIMATED_JOINTS]; @@ -768,7 +768,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty //----------------------------------------------------------------------------- void LLMotionController::updateLoadingMotions() { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; // query pending motions for completion for (motion_set_t::iterator iter = mLoadingMotions.begin(); iter != mLoadingMotions.end(); ) @@ -816,7 +816,7 @@ void LLMotionController::updateLoadingMotions() //----------------------------------------------------------------------------- void LLMotionController::updateMotions(bool force_update) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; // SL-763: "Distant animated objects run at super fast speed" // The use_quantum optimization or possibly the associated code in setTimeStamp() // does not work as implemented. @@ -909,7 +909,7 @@ void LLMotionController::updateMotions(bool force_update) //----------------------------------------------------------------------------- void LLMotionController::updateMotionsMinimal() { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; // Always update mPrevTimerElapsed mPrevTimerElapsed = mTimer.getElapsedTimeF32(); @@ -927,7 +927,7 @@ void LLMotionController::updateMotionsMinimal() //----------------------------------------------------------------------------- BOOL LLMotionController::activateMotionInstance(LLMotion *motion, F32 time) { - LL_PROFILE_ZONE_SCOPED; + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; // It's not clear why the getWeight() line seems to be crashing this, but // hopefully this fixes it. if (motion == NULL || motion->getPose() == NULL) |