diff options
Diffstat (limited to 'indra/llcharacter')
-rwxr-xr-x | indra/llcharacter/llanimationstates.h | 2 | ||||
-rwxr-xr-x | indra/llcharacter/llcharacter.h | 2 | ||||
-rwxr-xr-x | indra/llcharacter/llgesture.cpp | 41 | ||||
-rwxr-xr-x | indra/llcharacter/llgesture.h | 17 | ||||
-rwxr-xr-x | indra/llcharacter/lljoint.cpp | 2 | ||||
-rwxr-xr-x | indra/llcharacter/lljoint.h | 2 | ||||
-rwxr-xr-x | indra/llcharacter/lljointsolverrp3.cpp | 74 | ||||
-rwxr-xr-x | indra/llcharacter/llkeyframemotion.cpp | 5 | ||||
-rwxr-xr-x | indra/llcharacter/llkeyframemotionparam.h | 1 | ||||
-rwxr-xr-x | indra/llcharacter/llmotion.cpp | 2 | ||||
-rwxr-xr-x | indra/llcharacter/llpose.h | 1 |
11 files changed, 58 insertions, 91 deletions
diff --git a/indra/llcharacter/llanimationstates.h b/indra/llcharacter/llanimationstates.h index 84185c3f92..79cbcabdc1 100755 --- a/indra/llcharacter/llanimationstates.h +++ b/indra/llcharacter/llanimationstates.h @@ -29,7 +29,7 @@ #include <map> -#include "string_table.h" +#include "llstringtable.h" #include "lluuid.h" //----------------------------------------------------------------------------- diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index 5740dbce77..43fb68bb5c 100755 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -35,7 +35,7 @@ #include "lljoint.h" #include "llmotioncontroller.h" #include "llvisualparam.h" -#include "string_table.h" +#include "llstringtable.h" #include "llpointer.h" #include "llthread.h" diff --git a/indra/llcharacter/llgesture.cpp b/indra/llcharacter/llgesture.cpp index c23694639e..aeb65eb10f 100755 --- a/indra/llcharacter/llgesture.cpp +++ b/indra/llcharacter/llgesture.cpp @@ -173,27 +173,7 @@ S32 LLGesture::getMaxSerialSize() LLGestureList::LLGestureList() : mList(0) -{ - // add some gestures for debugging -// LLGesture *gesture = NULL; -/* - gesture = new LLGesture(KEY_F2, MASK_NONE, ":-)", - SND_CHIRP, "dance2", ":-)" ); - mList.put(gesture); - - gesture = new LLGesture(KEY_F3, MASK_NONE, "/dance", - SND_OBJECT_CREATE, "dance3", "(dances)" ); - mList.put(gesture); - - gesture = new LLGesture(KEY_F4, MASK_NONE, "/boogie", - LLUUID::null, "dance4", LLStringUtil::null ); - mList.put(gesture); - - gesture = new LLGesture(KEY_F5, MASK_SHIFT, "/tongue", - LLUUID::null, "Express_Tongue_Out", LLStringUtil::null ); - mList.put(gesture); - */ -} +{} LLGestureList::~LLGestureList() { @@ -203,12 +183,7 @@ LLGestureList::~LLGestureList() void LLGestureList::deleteAll() { - S32 count = mList.count(); - for (S32 i = 0; i < count; i++) - { - delete mList.get(i); - } - mList.reset(); + delete_and_clear(mList); } // Iterates through space delimited tokens in string, triggering any gestures found. @@ -235,9 +210,9 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin std::string cur_token_lower = *token_iter; LLStringUtil::toLower(cur_token_lower); - for (S32 i = 0; i < mList.count(); i++) + for (U32 i = 0; i < mList.size(); i++) { - gesture = mList.get(i); + gesture = mList.at(i); if (gesture->trigger(cur_token_lower)) { if( !gesture->getOutputString().empty() ) @@ -286,9 +261,9 @@ BOOL LLGestureList::triggerAndReviseString(const std::string &string, std::strin BOOL LLGestureList::trigger(KEY key, MASK mask) { - for (S32 i = 0; i < mList.count(); i++) + for (U32 i = 0; i < mList.size(); i++) { - LLGesture* gesture = mList.get(i); + LLGesture* gesture = mList.at(i); if( gesture ) { if (gesture->trigger(key, mask)) @@ -308,7 +283,7 @@ BOOL LLGestureList::trigger(KEY key, MASK mask) U8 *LLGestureList::serialize(U8 *buffer) const { // a single S32 serves as the header that tells us how many to read - S32 count = mList.count(); + U32 count = mList.size(); htonmemcpy(buffer, &count, MVT_S32, 4); buffer += sizeof(count); @@ -345,7 +320,7 @@ U8 *LLGestureList::deserialize(U8 *buffer, S32 max_size) tmp += sizeof(count); - mList.reserve_block(count); + mList.resize(count); for (S32 i = 0; i < count; i++) { diff --git a/indra/llcharacter/llgesture.h b/indra/llcharacter/llgesture.h index 66b618c473..cfb489f727 100755 --- a/indra/llcharacter/llgesture.h +++ b/indra/llcharacter/llgesture.h @@ -31,7 +31,6 @@ #include "llanimationstates.h" #include "lluuid.h" #include "llstring.h" -#include "lldarray.h" class LLGesture { @@ -67,12 +66,12 @@ public: static S32 getMaxSerialSize(); protected: - KEY mKey; // usually a function key - MASK mMask; // usually MASK_NONE, or MASK_SHIFT + KEY mKey; // usually a function key + MASK mMask; // usually MASK_NONE, or MASK_SHIFT std::string mTrigger; // string, no whitespace allowed std::string mTriggerLower; // lowercase version of mTrigger - LLUUID mSoundItemID; // ItemID of sound to play, LLUUID::null if none - std::string mAnimation; // canonical name of animation or face animation + LLUUID mSoundItemID; // ItemID of sound to play, LLUUID::null if none + std::string mAnimation; // canonical name of animation or face animation std::string mOutputString; // string to say static const S32 MAX_SERIAL_SIZE; @@ -91,9 +90,9 @@ public: BOOL triggerAndReviseString(const std::string &string, std::string* revised_string); // Used for construction from UI - S32 count() const { return mList.count(); } - virtual LLGesture* get(S32 i) const { return mList.get(i); } - virtual void put(LLGesture* gesture) { mList.put( gesture ); } + S32 count() const { return mList.size(); } + virtual LLGesture* get(S32 i) const { return mList.at(i); } + virtual void put(LLGesture* gesture) { mList.push_back( gesture ); } void deleteAll(); // non-endian-neutral serialization @@ -106,7 +105,7 @@ protected: virtual LLGesture *create_gesture(U8 **buffer, S32 max_size); protected: - LLDynamicArray<LLGesture*> mList; + std::vector<LLGesture*> mList; static const S32 SERIAL_HEADER_SIZE; }; diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp index 09a7c11a22..83bd62e8fa 100755 --- a/indra/llcharacter/lljoint.cpp +++ b/indra/llcharacter/lljoint.cpp @@ -560,7 +560,7 @@ void LLJoint::clampRotation(LLQuaternion old_rot, LLQuaternion new_rot) // LLVector3 old_axis = main_axis * old_rot; // LLVector3 new_axis = main_axis * new_rot; -// for (S32 i = 0; i < mConstraintSilhouette.count() - 1; i++) +// for (S32 i = 0; i < mConstraintSilhouette.size() - 1; i++) // { // LLVector3 vert1 = mConstraintSilhouette[i]; // LLVector3 vert2 = mConstraintSilhouette[i + 1]; diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h index 07374b7814..6efa13aeb5 100755 --- a/indra/llcharacter/lljoint.h +++ b/indra/llcharacter/lljoint.h @@ -33,13 +33,11 @@ #include <string> #include <list> -#include "linked_lists.h" #include "v3math.h" #include "v4math.h" #include "m4math.h" #include "llquaternion.h" #include "xform.h" -#include "lldarray.h" const S32 LL_CHARACTER_MAX_JOINTS_PER_MESH = 15; const U32 LL_CHARACTER_MAX_JOINTS = 32; // must be divisible by 4! diff --git a/indra/llcharacter/lljointsolverrp3.cpp b/indra/llcharacter/lljointsolverrp3.cpp index 1331900791..69a7e3dc6e 100755 --- a/indra/llcharacter/lljointsolverrp3.cpp +++ b/indra/llcharacter/lljointsolverrp3.cpp @@ -135,8 +135,6 @@ void LLJointSolverRP3::setTwist( F32 twist ) //----------------------------------------------------------------------------- void LLJointSolverRP3::solve() { -// llinfos << llendl; -// llinfos << "LLJointSolverRP3::solve()" << llendl; //------------------------------------------------------------------------- // setup joints in their base rotations @@ -152,15 +150,15 @@ void LLJointSolverRP3::solve() LLVector3 cPos = mJointC->getWorldPosition(); LLVector3 gPos = mJointGoal->getWorldPosition(); -// llinfos << "bPosLocal = " << mJointB->getPosition() << llendl; -// llinfos << "cPosLocal = " << mJointC->getPosition() << llendl; -// llinfos << "bRotLocal = " << mJointB->getRotation() << llendl; -// llinfos << "cRotLocal = " << mJointC->getRotation() << llendl; - -// llinfos << "aPos : " << aPos << llendl; -// llinfos << "bPos : " << bPos << llendl; -// llinfos << "cPos : " << cPos << llendl; -// llinfos << "gPos : " << gPos << llendl; + LL_DEBUGS("JointSolver") << "LLJointSolverRP3::solve()" << LL_NEWLINE + << "bPosLocal = " << mJointB->getPosition() << LL_NEWLINE + << "cPosLocal = " << mJointC->getPosition() << LL_NEWLINE + << "bRotLocal = " << mJointB->getRotation() << LL_NEWLINE + << "cRotLocal = " << mJointC->getRotation() << LL_NEWLINE + << "aPos : " << aPos << LL_NEWLINE + << "bPos : " << bPos << LL_NEWLINE + << "cPos : " << cPos << LL_NEWLINE + << "gPos : " << gPos << LL_ENDL; //------------------------------------------------------------------------- // get the poleVector in world space @@ -184,11 +182,6 @@ void LLJointSolverRP3::solve() LLVector3 acVec = cPos - aPos; LLVector3 agVec = gPos - aPos; -// llinfos << "abVec : " << abVec << llendl; -// llinfos << "bcVec : " << bcVec << llendl; -// llinfos << "acVec : " << acVec << llendl; -// llinfos << "agVec : " << agVec << llendl; - //------------------------------------------------------------------------- // compute needed lengths of those vectors //------------------------------------------------------------------------- @@ -196,16 +189,19 @@ void LLJointSolverRP3::solve() F32 bcLen = bcVec.magVec(); F32 agLen = agVec.magVec(); -// llinfos << "abLen : " << abLen << llendl; -// llinfos << "bcLen : " << bcLen << llendl; -// llinfos << "agLen : " << agLen << llendl; - //------------------------------------------------------------------------- // compute component vector of (A->B) orthogonal to (A->C) //------------------------------------------------------------------------- LLVector3 abacCompOrthoVec = abVec - acVec * ((abVec * acVec)/(acVec * acVec)); -// llinfos << "abacCompOrthoVec : " << abacCompOrthoVec << llendl; + LL_DEBUGS("JointSolver") << "abVec : " << abVec << LL_NEWLINE + << "bcVec : " << bcVec << LL_NEWLINE + << "acVec : " << acVec << LL_NEWLINE + << "agVec : " << agVec << LL_NEWLINE + << "abLen : " << abLen << LL_NEWLINE + << "bcLen : " << bcLen << LL_NEWLINE + << "agLen : " << agLen << LL_NEWLINE + << "abacCompOrthoVec : " << abacCompOrthoVec << LL_ENDL; //------------------------------------------------------------------------- // compute the normal of the original ABC plane (and store for later) @@ -273,13 +269,17 @@ void LLJointSolverRP3::solve() LLQuaternion bRot(theta - abbcAng, abbcOrthoVec); -// llinfos << "abbcAng : " << abbcAng << llendl; -// llinfos << "abbcOrthoVec : " << abbcOrthoVec << llendl; -// llinfos << "agLenSq : " << agLenSq << llendl; -// llinfos << "cosTheta : " << cosTheta << llendl; -// llinfos << "theta : " << theta << llendl; -// llinfos << "bRot : " << bRot << llendl; -// llinfos << "theta abbcAng theta-abbcAng: " << theta*180.0/F_PI << " " << abbcAng*180.0f/F_PI << " " << (theta - abbcAng)*180.0f/F_PI << llendl; + LL_DEBUGS("JointSolver") << "abbcAng : " << abbcAng << LL_NEWLINE + << "abbcOrthoVec : " << abbcOrthoVec << LL_NEWLINE + << "agLenSq : " << agLenSq << LL_NEWLINE + << "cosTheta : " << cosTheta << LL_NEWLINE + << "theta : " << theta << LL_NEWLINE + << "bRot : " << bRot << LL_NEWLINE + << "theta abbcAng theta-abbcAng: " + << theta*180.0/F_PI << " " + << abbcAng*180.0f/F_PI << " " + << (theta - abbcAng)*180.0f/F_PI + << LL_ENDL; //------------------------------------------------------------------------- // compute rotation that rotates new A->C to A->G @@ -293,9 +293,9 @@ void LLJointSolverRP3::solve() LLQuaternion cgRot; cgRot.shortestArc( acVec, agVec ); -// llinfos << "bcVec : " << bcVec << llendl; -// llinfos << "acVec : " << acVec << llendl; -// llinfos << "cgRot : " << cgRot << llendl; + LL_DEBUGS("JointSolver") << "bcVec : " << bcVec << LL_NEWLINE + << "acVec : " << acVec << LL_NEWLINE + << "cgRot : " << cgRot << LL_ENDL; // update A->B and B->C with rotation from C to G abVec = abVec * cgRot; @@ -353,18 +353,16 @@ void LLJointSolverRP3::solve() pRot.shortestArc( abcNorm, apgNorm ); } -// llinfos << "abcNorm = " << abcNorm << llendl; -// llinfos << "apgNorm = " << apgNorm << llendl; -// llinfos << "pRot = " << pRot << llendl; - //------------------------------------------------------------------------- // compute twist rotation //------------------------------------------------------------------------- LLQuaternion twistRot( mTwist, agVec ); -// llinfos << "twist : " << mTwist*180.0/F_PI << llendl; -// llinfos << "agNormVec: " << agNormVec << llendl; -// llinfos << "twistRot : " << twistRot << llendl; + 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; //------------------------------------------------------------------------- // compute rotation of A diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index 831a0a6719..1352c9d592 100755 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -1263,7 +1263,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) if (mJointMotionList->mBasePriority >= LLJoint::ADDITIVE_PRIORITY) { - mJointMotionList->mBasePriority = (LLJoint::JointPriority)((int)LLJoint::ADDITIVE_PRIORITY-1); + mJointMotionList->mBasePriority = (LLJoint::JointPriority)((S32)LLJoint::ADDITIVE_PRIORITY-1); mJointMotionList->mMaxPriority = mJointMotionList->mBasePriority; } else if (mJointMotionList->mBasePriority < LLJoint::USE_MOTION_PRIORITY) @@ -2288,8 +2288,7 @@ LLKeyframeMotion::JointConstraint::JointConstraint(JointConstraintSharedData* sh mTargetVolume = NULL; mFixupDistanceRMS = 0.f; - int i; - for (i=0; i<MAX_CHAIN_LENGTH; ++i) + for (S32 i=0; i<MAX_CHAIN_LENGTH; ++i) { mJointLengths[i] = 0.f; mJointLengthFractions[i] = 0.f; diff --git a/indra/llcharacter/llkeyframemotionparam.h b/indra/llcharacter/llkeyframemotionparam.h index 24e8141753..0fac3724d1 100755 --- a/indra/llcharacter/llkeyframemotionparam.h +++ b/indra/llcharacter/llkeyframemotionparam.h @@ -37,7 +37,6 @@ #include "lljointstate.h" #include "v3math.h" #include "llquaternion.h" -#include "linked_lists.h" #include "llkeyframemotion.h" //----------------------------------------------------------------------------- diff --git a/indra/llcharacter/llmotion.cpp b/indra/llcharacter/llmotion.cpp index af2e10220a..094cf87167 100755 --- a/indra/llcharacter/llmotion.cpp +++ b/indra/llcharacter/llmotion.cpp @@ -54,7 +54,7 @@ LLMotion::LLMotion( const LLUUID &id ) : mDeactivateCallback(NULL), mDeactivateCallbackUserData(NULL) { - for (int i=0; i<3; ++i) + for (S32 i=0; i<3; ++i) memset(&mJointSignature[i][0], 0, sizeof(U8) * LL_CHARACTER_MAX_JOINTS); } diff --git a/indra/llcharacter/llpose.h b/indra/llcharacter/llpose.h index b486852605..c004a0f3b7 100755 --- a/indra/llcharacter/llpose.h +++ b/indra/llcharacter/llpose.h @@ -33,7 +33,6 @@ #include "lljointstate.h" #include "lljoint.h" -#include "llmap.h" #include "llpointer.h" #include <map> |