diff options
author | Nyx (Neal Orman) <nyx@lindenlab.com> | 2011-03-21 17:56:11 -0400 |
---|---|---|
committer | Nyx (Neal Orman) <nyx@lindenlab.com> | 2011-03-21 17:56:11 -0400 |
commit | 955b727550e8595fd67c55775d8f0fe249826277 (patch) | |
tree | f4ac70eb36bcb14d44fad4199811d365eb4b788f /indra/llprimitive | |
parent | 77fff26431671ffef8cf482044b1fcd98262d3e0 (diff) | |
parent | 5b9ee2a9d5687eae6fd48ee6038cd2f7ed1d9a53 (diff) |
merge
Diffstat (limited to 'indra/llprimitive')
-rwxr-xr-x | indra/llprimitive/llmodel.cpp | 20 | ||||
-rwxr-xr-x | indra/llprimitive/llmodel.h | 3 | ||||
-rw-r--r-- | indra/llprimitive/lltextureentry.cpp | 22 |
3 files changed, 26 insertions, 19 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 3d03209eaf..eed82f924b 100755 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -57,6 +57,7 @@ const int MODEL_NAMES_LENGTH = sizeof(model_names) / sizeof(std::string); LLModel::LLModel(LLVolumeParams& params, F32 detail) : LLVolume(params, detail), mNormalizedScale(1,1,1), mNormalizedTranslation(0,0,0) + , mPelvisOffset( 0.0f ) { mDecompID = -1; } @@ -810,6 +811,22 @@ BOOL LLModel::createVolumeFacesFromFile(const std::string& file_name) return FALSE; } +void LLModel::offsetMesh( const LLVector3& pivotPoint ) +{ + LLVector4a pivot( pivotPoint[VX], pivotPoint[VY], pivotPoint[VZ] ); + + for (std::vector<LLVolumeFace>::iterator faceIt = mVolumeFaces.begin(); faceIt != mVolumeFaces.end(); ) + { + std::vector<LLVolumeFace>:: iterator currentFaceIt = faceIt++; + LLVolumeFace& face = *currentFaceIt; + LLVector4a *pos = (LLVector4a*) face.mPositions; + + for (U32 i=0; i<face.mNumVertices; ++i ) + { + pos[i].add( pivot ); + } + } +} void LLModel::optimizeVolumeFaces() { @@ -1481,6 +1498,7 @@ LLSD LLModel::writeModel( } } + if ( upload_joints && high->mAlternateBindMatrix.size() > 0 ) { for (U32 i = 0; i < high->mJointList.size(); ++i) @@ -1493,6 +1511,8 @@ LLSD LLModel::writeModel( } } } + + mdl["skin"]["pelvis_offset"] = high->mPelvisOffset; } } diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index ebf37904d4..e9e33bdee5 100755 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -123,7 +123,7 @@ public: void normalizeVolumeFaces(); void optimizeVolumeFaces(); - + void offsetMesh( const LLVector3& pivotPoint ); void getNormalizedScaleTranslation(LLVector3& scale_out, LLVector3& translation_out); std::vector<std::string> mMaterialList; @@ -194,6 +194,7 @@ public: LLVector3 mNormalizedScale; LLVector3 mNormalizedTranslation; + float mPelvisOffset; // convex hull decomposition S32 mDecompID; convex_hull_decomposition mConvexHullDecomp; diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp index 861bde5c89..34eff17519 100644 --- a/indra/llprimitive/lltextureentry.cpp +++ b/indra/llprimitive/lltextureentry.cpp @@ -423,24 +423,10 @@ S32 LLTextureEntry::setBumpShinyFullbright(U8 bump) S32 LLTextureEntry::setMediaTexGen(U8 media) { - if (mMediaFlags != media) - { - mMediaFlags = media; - - // Special code for media handling - if( hasMedia() && mMediaEntry == NULL) - { - mMediaEntry = new LLMediaEntry; - } - else if ( ! hasMedia() && mMediaEntry != NULL) - { - delete mMediaEntry; - mMediaEntry = NULL; - } - - return TEM_CHANGE_MEDIA; - } - return TEM_CHANGE_NONE; + S32 result = TEM_CHANGE_NONE; + result |= setTexGen(media & TEM_TEX_GEN_MASK); + result |= setMediaFlags(media & TEM_MEDIA_MASK); + return result; } S32 LLTextureEntry::setBumpmap(U8 bump) |