MAINT-646: Vectorize LLPolyMesh https://bitbucket.org/davep/viewer-development/changeset/668dcacd6e76
This commit is contained in:
@@ -155,6 +155,7 @@ LLDriverParam::LLDriverParam(LLVOAvatar *avatarp) :
|
||||
mAvatarp(avatarp),
|
||||
mWearablep(NULL)
|
||||
{
|
||||
mDefaultVec.clear();
|
||||
}
|
||||
|
||||
LLDriverParam::LLDriverParam(LLWearable *wearablep) :
|
||||
@@ -162,6 +163,7 @@ LLDriverParam::LLDriverParam(LLWearable *wearablep) :
|
||||
mAvatarp(NULL),
|
||||
mWearablep(wearablep)
|
||||
{
|
||||
mDefaultVec.clear();
|
||||
}
|
||||
|
||||
LLDriverParam::~LLDriverParam()
|
||||
@@ -341,18 +343,19 @@ F32 LLDriverParam::getTotalDistortion()
|
||||
return sum;
|
||||
}
|
||||
|
||||
const LLVector3 &LLDriverParam::getAvgDistortion()
|
||||
const LLVector4a &LLDriverParam::getAvgDistortion()
|
||||
{
|
||||
// It's not actually correct to take the average of averages, but it good enough here.
|
||||
LLVector3 sum;
|
||||
LLVector4a sum;
|
||||
sum.clear();
|
||||
S32 count = 0;
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
|
||||
{
|
||||
LLDrivenEntry* driven = &(*iter);
|
||||
sum += driven->mParam->getAvgDistortion();
|
||||
sum.add(driven->mParam->getAvgDistortion());
|
||||
count++;
|
||||
}
|
||||
sum /= (F32)count;
|
||||
sum.mul( 1.f/(F32)count);
|
||||
|
||||
mDefaultVec = sum;
|
||||
return mDefaultVec;
|
||||
@@ -375,21 +378,22 @@ F32 LLDriverParam::getMaxDistortion()
|
||||
}
|
||||
|
||||
|
||||
LLVector3 LLDriverParam::getVertexDistortion(S32 index, LLPolyMesh *poly_mesh)
|
||||
LLVector4a LLDriverParam::getVertexDistortion(S32 index, LLPolyMesh *poly_mesh)
|
||||
{
|
||||
LLVector3 sum;
|
||||
LLVector4a sum;
|
||||
sum.clear();
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
|
||||
{
|
||||
LLDrivenEntry* driven = &(*iter);
|
||||
sum += driven->mParam->getVertexDistortion( index, poly_mesh );
|
||||
sum.add(driven->mParam->getVertexDistortion( index, poly_mesh ));
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
const LLVector3* LLDriverParam::getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh)
|
||||
const LLVector4a* LLDriverParam::getFirstDistortion(U32 *index, LLPolyMesh **poly_mesh)
|
||||
{
|
||||
mCurrentDistortionParam = NULL;
|
||||
const LLVector3* v = NULL;
|
||||
const LLVector4a* v = NULL;
|
||||
for( entry_list_t::iterator iter = mDriven.begin(); iter != mDriven.end(); iter++ )
|
||||
{
|
||||
LLDrivenEntry* driven = &(*iter);
|
||||
@@ -404,7 +408,7 @@ const LLVector3* LLDriverParam::getFirstDistortion(U32 *index, LLPolyMesh **poly
|
||||
return v;
|
||||
};
|
||||
|
||||
const LLVector3* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **poly_mesh)
|
||||
const LLVector4a* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **poly_mesh)
|
||||
{
|
||||
llassert( mCurrentDistortionParam );
|
||||
if( !mCurrentDistortionParam )
|
||||
@@ -432,7 +436,7 @@ const LLVector3* LLDriverParam::getNextDistortion(U32 *index, LLPolyMesh **poly_
|
||||
}
|
||||
|
||||
// We're already in the middle of a param's distortions, so get the next one.
|
||||
const LLVector3* v = driven->mParam->getNextDistortion( index, poly_mesh );
|
||||
const LLVector4a* v = driven->mParam->getNextDistortion( index, poly_mesh );
|
||||
if( (!v) && (iter != mDriven.end()) )
|
||||
{
|
||||
// This param is finished, so start the next param. It might not have any
|
||||
|
||||
Reference in New Issue
Block a user