summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermodelpreview.h
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-04-19 12:37:27 -0500
committerDave Parks <davep@lindenlab.com>2011-04-19 12:37:27 -0500
commit12b0b52b99e6f6a6538feba8589566d2f73f82c6 (patch)
treeb4053044a9d9f95aa7fea445ce8873ae744f74b1 /indra/newview/llfloatermodelpreview.h
parent3cb97cb4d75c40d9519d796dd52d0741d354fc97 (diff)
parentc494e5c0d55b2da2f5aa5ea18fbccb670b2f3107 (diff)
merge
Diffstat (limited to 'indra/newview/llfloatermodelpreview.h')
-rwxr-xr-xindra/newview/llfloatermodelpreview.h52
1 files changed, 41 insertions, 11 deletions
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index dc6a33d0ab..186bf114d1 100755
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -53,6 +53,9 @@ class domTranslate;
class LLMenuButton;
class LLToggleableMenu;
+typedef std::map<std::string, LLMatrix4> JointTransformMap;
+typedef std::map<std::string, LLMatrix4>:: iterator JointTransformMapIt;
+
const S32 NUM_LOD = 4;
class LLModelLoader : public LLThread
@@ -94,8 +97,8 @@ public:
//queue of models that need a physics rep
model_queue mPhysicsQ;
- LLModelLoader(std::string filename, S32 lod, LLModelPreview* preview);
-
+ LLModelLoader( std::string filename, S32 lod, LLModelPreview* preview, JointTransformMap& jointMap,
+ std::deque<std::string>& jointsFromNodes );
virtual void run();
bool doLoadModel();
bool loadFromSLM(const std::string& filename);
@@ -115,17 +118,19 @@ public:
void extractTranslation( domTranslate* pTranslate, LLMatrix4& transform );
void extractTranslationViaElement( daeElement* pTranslateElement, LLMatrix4& transform );
- bool doesJointArrayContainACompleteRig( const std::vector<std::string> &modelJointList );
- bool checkForCompleteRig( const std::vector<std::string> &jointListFromModel );
-
void handlePivotPoint( daeElement* pRoot );
bool isNodeAPivotPoint( domNode* pNode );
void setLoadState(U32 state);
+ void buildJointToNodeMappingFromScene( daeElement* pRoot );
+ void processJointToNodeMapping( domNode* pNode );
+
+
//map of avatar joints as named in COLLADA assets to internal joint names
std::map<std::string, std::string> mJointMap;
- std::deque<std::string> mMasterJointList;
+ JointTransformMap& mJointList;
+ std::deque<std::string>& mJointsFromNode;
};
class LLFloaterModelPreview : public LLFloater
@@ -297,12 +302,28 @@ public:
void updateStatusMessages();
void clearGLODGroup();
void onLODParamCommit(bool enforce_tri_limit);
+
const bool getModelPivot( void ) const { return mHasPivot; }
void setHasPivot( bool val ) { mHasPivot = val; }
void setModelPivot( const LLVector3& pivot ) { mModelPivot = pivot; }
- const bool isRigValid( void ) const { return mRigValid; }
- void setRigValid( bool rigValid ) { mRigValid = rigValid; }
-
+
+ //Sets the current avatars joints to new positions
+ //Makes in world go to shit, however
+ void changeAvatarsJointPositions( LLModel* pModel );
+ //Determines the viability of an asset to be used as an avatar rig (w or w/o joint upload caps)
+ void critiqueRigForUploadApplicability( const std::vector<std::string> &jointListFromAsset );
+ void critiqueJointToNodeMappingFromScene( void );
+ //Is a rig valid so that it can be used as a criteria for allowing for uploading of joint positions
+ //Accessors for joint position upload friendly rigs
+ const bool isRigValidForJointPositionUpload( void ) const { return mRigValidJointUpload; }
+ void setRigValidForJointPositionUpload( bool rigValid ) { mRigValidJointUpload = rigValid; }
+ bool isRigSuitableForJointPositionUpload( const std::vector<std::string> &jointListFromAsset );
+ //Determines if a rig is a legacy from the joint list
+ bool isRigLegacy( const std::vector<std::string> &jointListFromAsset );
+ //Accessors for the legacy rigs
+ const bool isLegacyRigValid( void ) const { return mLegacyRigValid; }
+ void setLegacyRigValid( bool rigValid ) { mLegacyRigValid = rigValid; }
+
static void textureLoadedCallback( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* src_aux, S32 discard_level, BOOL final, void* userdata );
boost::signals2::connection setDetailsCallback( const details_signal_t::slot_type& cb ){ return mDetailsSignal.connect(cb); }
@@ -314,6 +335,8 @@ public:
void setResetJointFlag( bool state ) { mResetJoints = state; }
bool getResetJointFlag( void ) { return mResetJoints; }
+ LLVector3 getTranslationForJointOffset( std::string joint );
+
protected:
friend class LLModelLoader;
friend class LLFloaterModelPreview;
@@ -377,8 +400,15 @@ public:
float mPelvisZOffset;
- bool mRigValid;
-};
+ bool mRigValidJointUpload;
+ bool mLegacyRigValid;
+ bool mLastJointUpdate;
+
+ std::deque<std::string> mMasterJointList;
+ std::deque<std::string> mMasterLegacyJointList;
+ std::deque<std::string> mJointsFromNode;
+ JointTransformMap mJointTransformMap;
+};
#endif // LL_LLFLOATERMODELPREVIEW_H