Conflicts:
	indra/newview/llnetmap.cpp - Thankies Shyotl~
This commit is contained in:
Inusaito Sayori
2014-07-21 23:31:59 -04:00
111 changed files with 2419 additions and 3960 deletions

View File

@@ -72,21 +72,11 @@ LLCharacter::~LLCharacter()
delete param;
}
U32 i ;
U32 size = sInstances.size() ;
for(i = 0 ; i < size ; i++)
{
if(sInstances[i] == this)
{
break ;
}
}
bool erased = vector_replace_with_last(sInstances,this);
llassert_always(i < size) ;
llassert_always(erased) ;
llassert_always(sAllowInstancesChange) ;
sInstances[i] = sInstances[size - 1] ;
sInstances.pop_back() ;
}

View File

@@ -312,19 +312,15 @@ void LLJoint::setWorldPosition( const LLVector3& pos )
return;
}
LLMatrix4 temp_matrix = getWorldMatrix();
temp_matrix.mMatrix[VW][VX] = pos.mV[VX];
temp_matrix.mMatrix[VW][VY] = pos.mV[VY];
temp_matrix.mMatrix[VW][VZ] = pos.mV[VZ];
LLMatrix4a temp_matrix = getWorldMatrix();
temp_matrix.setTranslate_affine(pos);
LLMatrix4 parentWorldMatrix = mParent->getWorldMatrix();
LLMatrix4 invParentWorldMatrix = parentWorldMatrix.invert();
LLMatrix4a invParentWorldMatrix = mParent->getWorldMatrix();
invParentWorldMatrix.invert();
temp_matrix *= invParentWorldMatrix;
invParentWorldMatrix.mul(temp_matrix);
LLVector3 localPos( temp_matrix.mMatrix[VW][VX],
temp_matrix.mMatrix[VW][VY],
temp_matrix.mMatrix[VW][VZ] );
LLVector3 localPos( invParentWorldMatrix.getRow<LLMatrix4a::ROW_TRANS>().getF32ptr() );
setPosition( localPos );
}
@@ -383,19 +379,19 @@ void LLJoint::setWorldRotation( const LLQuaternion& rot )
this->setRotation( rot );
return;
}
LLMatrix4a parentWorldMatrix = mParent->getWorldMatrix();
LLQuaternion2 rota(rot);
LLMatrix4a temp_mat(rota);
LLMatrix4 temp_mat(rot);
LLMatrix4a invParentWorldMatrix = mParent->getWorldMatrix();
invParentWorldMatrix.setTranslate_affine(LLVector3(0.f));
LLMatrix4 parentWorldMatrix = mParent->getWorldMatrix();
parentWorldMatrix.mMatrix[VW][VX] = 0;
parentWorldMatrix.mMatrix[VW][VY] = 0;
parentWorldMatrix.mMatrix[VW][VZ] = 0;
invParentWorldMatrix.invert();
LLMatrix4 invParentWorldMatrix = parentWorldMatrix.invert();
invParentWorldMatrix.mul(temp_mat);
temp_mat *= invParentWorldMatrix;
setRotation(LLQuaternion(temp_mat));
setRotation(LLQuaternion(LLMatrix4(invParentWorldMatrix.getF32ptr())));
}
@@ -425,7 +421,7 @@ void LLJoint::setScale( const LLVector3& scale )
//--------------------------------------------------------------------
// getWorldMatrix()
//--------------------------------------------------------------------
const LLMatrix4 &LLJoint::getWorldMatrix()
const LLMatrix4a &LLJoint::getWorldMatrix()
{
updateWorldMatrixParent();

View File

@@ -162,7 +162,7 @@ public:
void setScale( const LLVector3& scale );
// get/set world matrix
const LLMatrix4 &getWorldMatrix();
const LLMatrix4a &getWorldMatrix();
void setWorldMatrix( const LLMatrix4& mat );
void updateWorldMatrixChildren();

View File

@@ -171,12 +171,14 @@ void LLJointSolverRP3::solve()
//-------------------------------------------------------------------------
// get the poleVector in world space
//-------------------------------------------------------------------------
LLMatrix4 worldJointAParentMat;
LLVector3 poleVec = mPoleVector;
if ( mJointA->getParent() )
{
worldJointAParentMat = mJointA->getParent()->getWorldMatrix();
LLVector4a pole_veca;
pole_veca.load3(mPoleVector.mV);
mJointA->getParent()->getWorldMatrix().rotate(pole_veca,pole_veca);
poleVec.set(pole_veca.getF32ptr());
}
LLVector3 poleVec = rotate_vector( mPoleVector, worldJointAParentMat );
//-------------------------------------------------------------------------
// compute the following:

View File

@@ -286,40 +286,38 @@ BOOL LLKeyframeStandMotion::onUpdate(F32 time, U8* joint_mask)
//-------------------------------------------------------------------------
if ( mTrackAnkles )
{
LLVector4 dirLeft4 = mAnkleLeftJoint.getWorldMatrix().getFwdRow4();
LLVector4 dirRight4 = mAnkleRightJoint.getWorldMatrix().getFwdRow4();
LLVector3 dirLeft = vec4to3( dirLeft4 );
LLVector3 dirRight = vec4to3( dirRight4 );
const LLVector4a& dirLeft4 = mAnkleLeftJoint.getWorldMatrix().getRow<LLMatrix4a::ROW_FWD>();
const LLVector4a& dirRight4 = mAnkleRightJoint.getWorldMatrix().getRow<LLMatrix4a::ROW_FWD>();
LLVector3 up;
LLVector3 dir;
LLVector3 left;
LLVector4a up;
LLVector4a dir;
LLVector4a left;
up = mNormalLeft;
up.normVec();
up.load3(mNormalLeft.mV);
up.normalize3fast();
if (mFlipFeet)
{
up *= -1.0f;
up.negate();
}
dir = dirLeft;
dir.normVec();
left = up % dir;
left.normVec();
dir = left % up;
mRotationLeft = LLQuaternion( dir, left, up );
dir = dirLeft4;
dir.normalize3fast();
left.setCross3(up,dir);
left.normalize3fast();
dir.setCross3(left,up);
mRotationLeft = LLQuaternion( LLVector3(dir.getF32ptr()), LLVector3(left.getF32ptr()), LLVector3(up.getF32ptr()));
up = mNormalRight;
up.normVec();
up.load3(mNormalRight.mV);
up.normalize3fast();
if (mFlipFeet)
{
up *= -1.0f;
up.negate();
}
dir = dirRight;
dir.normVec();
left = up % dir;
left.normVec();
dir = left % up;
mRotationRight = LLQuaternion( dir, left, up );
dir = dirRight4;
dir.normalize3fast();
left.setCross3(up,dir);
left.normalize3fast();
dir.setCross3(left,up);
mRotationRight = LLQuaternion( LLVector3(dir.getF32ptr()), LLVector3(left.getF32ptr()), LLVector3(up.getF32ptr()));
}
mAnkleLeftJoint.setWorldRotation( mRotationLeft );
mAnkleRightJoint.setWorldRotation( mRotationRight );