diff options
Diffstat (limited to 'indra/newview/llfloatermodelpreview.h')
-rw-r--r-- | indra/newview/llfloatermodelpreview.h | 52 |
1 files changed, 41 insertions, 11 deletions
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index dc6a33d0ab..186bf114d1 100644 --- 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 |