Skip to content
Snippets Groups Projects
Commit 25609cd9 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Various fixes to wearable and appearance code

parent 51f73f5f
No related branches found
No related tags found
2 merge requests!3Update to main branch,!2Rebase onto current main branch
......@@ -445,7 +445,8 @@ LLVector4a LLPolyMorphTarget::getVertexDistortion(S32 requested_index, LLPolyMes
//-----------------------------------------------------------------------------
const LLVector4a *LLPolyMorphTarget::getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh)
{
if (!mMorphData) return nullptr;
static LLVector4a zero = LLVector4a::getZero();
if (!mMorphData) return &zero;
LLVector4a* resultVec;
mMorphData->mCurrentIndex = 0;
......@@ -471,7 +472,8 @@ const LLVector4a *LLPolyMorphTarget::getFirstDistortion(U32 *index, LLPolyMesh *
//-----------------------------------------------------------------------------
const LLVector4a *LLPolyMorphTarget::getNextDistortion(U32 *index, LLPolyMesh **poly_mesh)
{
if (!mMorphData) return nullptr;
static LLVector4a zero = LLVector4a::getZero();
if (!mMorphData) return &zero;
LLVector4a* resultVec;
mMorphData->mCurrentIndex++;
......
......@@ -104,8 +104,8 @@ class alignas(16) LLPolySkeletalDistortion : public LLViewerVisualParam
/*virtual*/ const LLVector4a& getAvgDistortion() override { return mDefaultVec; }
/*virtual*/ F32 getMaxDistortion() override { return 0.1f; }
/*virtual*/ LLVector4a getVertexDistortion(S32 index, LLPolyMesh *poly_mesh) override {return LLVector4a(0.001f, 0.001f, 0.001f);}
/*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) override {index = 0; poly_mesh = NULL; return &mDefaultVec;};
/*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) override {index = 0; poly_mesh = NULL; return NULL;};
/*virtual*/ const LLVector4a* getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh) override { if( index ){ *index = 0;} if( poly_mesh ){ *poly_mesh = NULL; } return &mDefaultVec; };
/*virtual*/ const LLVector4a* getNextDistortion(U32 *index, LLPolyMesh **poly_mesh) override { if( index ){ *index = 0;} if( poly_mesh ){ *poly_mesh = NULL; } return NULL; };
protected:
LLPolySkeletalDistortion(const LLPolySkeletalDistortion& pOther) = default;
......
......@@ -734,8 +734,7 @@ void LLWearable::writeToAvatar(LLAvatarAppearance* avatarp)
{
// cross-wearable parameters are not authoritative, as they are driven by a different wearable. So don't copy the values to the
// avatar object if cross wearable. Cross wearable params get their values from the avatar, they shouldn't write the other way.
LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param;
if((viewer_param->getWearableType() == mType) && (!viewer_param->getCrossWearable()) )
if( (((LLViewerVisualParam*)param)->getWearableType() == mType) && (!((LLViewerVisualParam*)param)->getCrossWearable()) )
{
S32 param_id = param->getID();
F32 weight = getVisualParamWeight(param_id);
......
......@@ -195,10 +195,11 @@ void LLWearableData::pullCrossWearableValues(const LLWearableType::EType type)
{
if( param )
{
if(param->isDriverParam())
LLDriverParam *driver_param = dynamic_cast<LLDriverParam*>(param);
if(driver_param)
{
// parameter is a driver parameter, have it update its cross-driven params
static_cast<LLDriverParam*>(param)->updateCrossDrivenParams(type);
driver_param->updateCrossDrivenParams(type);
}
}
}
......
......@@ -110,6 +110,12 @@ class LLWearableType final : public LLParamSingleton<LLWearableType>
public:
LLWearableDictionary(LLTranslationBridge::ptr_t& trans);
~LLWearableDictionary() = default;
// [RLVa:KB] - Checked: 2010-03-03 (RLVa-1.2.0a) | Added: RLVa-1.2.0a
protected:
// The default implementation asserts on 'notFound()' and returns -1 which isn't a valid EWearableType
virtual LLWearableType::EType notFound() const { return LLWearableType::WT_INVALID; }
// [/RLVa:KB]
};
LLWearableDictionary mDictionary;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment