本文整理汇总了C++中GetMatrix函数的典型用法代码示例。如果您正苦于以下问题:C++ GetMatrix函数的具体用法?C++ GetMatrix怎么用?C++ GetMatrix使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetMatrix函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: string
inline void TAligner_SW<CQuery,CSubject>::x_PrintMatrix()
{
cerr << "\x1b[31mNULL\t\x1b[32mIdentity\t\x1b[33mMismatch\t\x1b[34mInsertion\t\x1b[35mDeletion\t\x1b[36mOTHER\x1b[0m\n";
cerr << string(78,'=') << endl;
for( int q = -1; q < (int)((*m_matrix)[0].size() - 1); ++q ) {
for( int s = -1; s < (int)((*m_matrix)[0].size() - 1); ++s ) {
if( s >= 0 ) cerr << "\t";
switch( GetMatrix( q, s, false ).second ) {
case eNull:
cerr << "\x1b[31m";
break;
case eIdentity:
cerr << "\x1b[32m";
break;
case eMismatch:
cerr << "\x1b[33m";
break;
case eInsertion:
cerr << "\x1b[34m";
break;
case eDeletion:
cerr << "\x1b[35m";
break;
default:
cerr << "\x1b[36m";
break;
}
cerr << GetMatrix( q, s, false ).first << "\x1b[0m";
}
cerr << "\n";
}
}
示例2: vector3f_t
const CameraDesc& Camera::GetDesc() const
{
m_desc.EyePosition = vector3f_t(GetMatrix(CoordType::Global) * vector4f_t(m_originalDesc.EyePosition, 1));
m_desc.Direction = vector3f_t(GetMatrix(CoordType::Global) * GetMatrix(CoordType::Local) * vector4f_t(m_originalDesc.Direction, 0));
m_desc.Up = vector3f_t(GetMatrix(CoordType::Global) * GetMatrix(CoordType::Local) * vector4f_t(m_originalDesc.Up, 0));
return m_desc;
}
示例3: ForceSetWorldMatrix
void MatrixMoveable::OnUpdateWorldMatrix(Matrix4& transform, int32 dirtyFlag)
{
if (mParentMoveable != nullptr&&mParentMoveable->IsWorldMatrixDirty())
{
ForceSetWorldMatrix(GetMatrix()*(mParentMoveable->WorldMatrix()));
}
else
{
ForceSetWorldMatrix(GetMatrix());
}
}
示例4: ForceSetWorldMatrix
void TransformMoveable::OnUpdateWorldMatrix( Matrix4& transform )
{
TransformMoveable* parent=GetParentMoveable();
if (parent!=NULL&&parent->IsWorldMatrixDirty())
{
ForceSetWorldMatrix(GetMatrix()*(parent->GetWorldMatrix()));
}
else
{
ForceSetWorldMatrix(GetMatrix());
}
}
示例5: wxSVGRect
wxSVGRect wxSVGVideoElement::GetBBox(wxSVG_COORDINATES coordinates) {
wxSVGRect bbox = wxSVGRect(GetX().GetAnimVal(), GetY().GetAnimVal(), GetWidth().GetAnimVal(),
GetHeight().GetAnimVal());
if (coordinates != wxSVG_COORDINATES_USER)
bbox.MatrixTransform(GetMatrix(coordinates));
return bbox;
}
示例6: MgTest
void MGPreconditioner :: MgTest () const
{
cout << "Compute eigenvalues" << endl;
const BaseMatrix & amat = GetAMatrix();
const BaseMatrix & pre = GetMatrix();
int eigenretval;
EigenSystem eigen (amat, pre);
eigen.SetPrecision(1e-30);
eigen.SetMaxSteps(1000);
eigenretval = eigen.Calc();
eigen.PrintEigenValues (*testout);
(cout) << " Min Eigenvalue : " << eigen.EigenValue(mgnumber) << endl;
(cout) << " Max Eigenvalue : " << eigen.MaxEigenValue() << endl;
(cout) << " Condition " << eigen.MaxEigenValue()/eigen.EigenValue(mgnumber) << endl;
(*testout) << " Min Eigenvalue : " << eigen.EigenValue(mgnumber) << endl;
(*testout) << " Max Eigenvalue : " << eigen.MaxEigenValue() << endl;
(*testout) << " Condition " << eigen.MaxEigenValue()/eigen.EigenValue(mgnumber) << endl;
static ofstream condout (mgfile.c_str());
// double cond;
condout << bfa->GetFESpace()->GetNDof() << "\t" << bfa->GetFESpace()->GetOrder() << "\t" << eigen.EigenValue(mgnumber) << "\t" << eigen.MaxEigenValue() << "\t"
<< eigen.MaxEigenValue()/eigen.EigenValue(mgnumber) << "\t" << endl;
if(testresult_ok) *testresult_ok = eigenretval;
if(testresult_min) *testresult_min = eigen.EigenValue(mgnumber);
if(testresult_max) *testresult_max = eigen.MaxEigenValue();
}
示例7: D3DXVECTOR2
/**
@brief 바운딩박스를 계산해 돌려준다.
*/
XE::xRECT XLayerImage::GetBoundBox( const D3DXMATRIX& mParent ) const
{
// 이미지의 4귀퉁이를 이 매트릭스로 트랜스폼
XSprite *pSpr = m_pSpriteCurr;
if( pSpr ) {
const D3DXVECTOR2 vAdj = pSpr->GetAdjust();
const auto vSize = pSpr->GetSize();
D3DXVECTOR2 vLT = vAdj;
D3DXVECTOR2 vRT = D3DXVECTOR2( vAdj.x + vSize.w, vAdj.y );
D3DXVECTOR2 vLB = D3DXVECTOR2( vAdj.x , vAdj.y + vSize.h );
D3DXVECTOR2 vRB = D3DXVECTOR2( vAdj.x + vSize.w, vAdj.y + vSize.h );
XE::VEC2 vtLT, vtRT, vtLB, vtRB;
D3DXVECTOR4 vResult;
const auto mWorld = GetMatrix() * mParent;
D3DXVec2Transform( &vResult, &vLT, &mWorld ); vtLT.Set( vResult.x, vResult.y );
D3DXVec2Transform( &vResult, &vRT, &mWorld ); vtRT.Set( vResult.x, vResult.y );
D3DXVec2Transform( &vResult, &vLB, &mWorld ); vtLB.Set( vResult.x, vResult.y );
D3DXVec2Transform( &vResult, &vRB, &mWorld ); vtRB.Set( vResult.x, vResult.y );
XE::xRECT rectBB;
rectBB.UpdateBoundBox( vtLT );
rectBB.UpdateBoundBox( vtRT );
rectBB.UpdateBoundBox( vtLB );
rectBB.UpdateBoundBox( vtRB );
return rectBB;
}
return XE::xRECT();
}
示例8: CheckValid
void nuiSprite::GetSpritesAtPoint(float x, float y, std::vector<nuiSprite*>& rSprites)
{
CheckValid();
nuiVector ov(x, y, 0);
nuiMatrix m;
GetMatrix(m);
m.Invert();
nuiVector v = m * ov;
x = v[0];
y = v[1];
const nuiSpriteAnimation* pAnim = mpSpriteDef->GetAnimation(mCurrentAnimation);
const nuiSpriteFrame* pFrame = pAnim->GetFrame(ToBelow(mCurrentFrame));
nuiRect dst(pFrame->GetRect());
dst.Move(-pFrame->GetHandleX(), -pFrame->GetHandleY());
if (dst.IsInside(x, y))
rSprites.push_back(this);
uint32 s = mpChildren.size();
for (size_t i = 0; i < s; i++)
{
mpChildren[i]->GetSpritesAtPoint(x, y, rSprites);
}
}
示例9: Inversion
void Inversion(FunctionCall fc)
{
int i, j, index, exist = 0;
Matrix a, c;
char name[MAXSIZE_NAME] = {0};
index = IndexMatrix(fc->name);
if (index==-1)
{
index = cur_mat;
mats[index] = (StrMatObject*)malloc(sizeof(StrMatObject));
if (mats[index] == NULL)
{
printf("NewMatrix(): Could not allocate the new matrix\n");
return;
}
for (i = 0; i < MAXSIZE_NAME; i++)
{
mats[index]->name[i] = fc->name[i];
if (fc->name[i]=='\0') break;
}
}
else exist = 1;
j = 0;
// searching for matrix name
for (i = 0; i < MAXSIZE_NAME; i++)
{
name[j] = fc->args[i];
if (name[j] == '\0') break;
j++;
}
a = GetMatrix(name);
if (a==NULL)
{
printf("\tMatrix %s Not Found\n", name);
if (!exist) free(mats[index]);
return;
}
c = invert(a);
if (c==NULL)
{
printf("\tMatrix %s Not Invertible\n", name);
if (!exist) free(mats[index]);
return;
}
if (exist) deleteMatrix(mats[index]->mat);
mats[index]->mat = c;
// test: display the result
displayMatrix(mats[index]->mat);
if (!exist) cur_mat++;
}
示例10: SVGMatrix
already_AddRefed<SVGMatrix>
SVGMatrix::Translate(float x, float y)
{
nsRefPtr<SVGMatrix> matrix =
new SVGMatrix(gfxMatrix(GetMatrix()).Translate(gfxPoint(x, y)));
return matrix.forget();
}
示例11: D3DXVec3Length
void CBurnBot::CollisionResponse(IBaseObject* pObj)
{
int nType = pObj->GetID();
Sphere tempSphere = pObj->GetSphere();
D3DXVECTOR3 V = tempSphere.m_Center - this->GetSphere().m_Center;
float Mag = D3DXVec3Length(&V);
float Distance = tempSphere.m_Radius + GetSphere().m_Radius;
float X = Distance/Mag + EPISILON;
V = V * X;
D3DXMATRIX tempMat = pObj->GetMatrix();
if(nType == OBJ_TUNNEL)
tempMat._43 *= 0.85f;
D3DXMATRIX tempSetMat = GetMatrix();
tempSetMat._41 = tempMat._41 - V.x;
tempSetMat._43 = tempMat._43 - V.z;
this->SetMatrix(tempSetMat);
if( nType == OBJ_PLAYER )
{
if(!m_bCloseToTarget)
{
m_bCloseToTarget = true;
m_fExplodeTimer = BURN_CHARGETIME;
SetBeingHit(BURNEXPLODE);
WwiseNS::PlaySFX(WwiseNS::EVENT_SOUND_BURNALERT);
ChangeAnimation(0);
}
}
}
示例12: GLCheck
////////////////////////////////////////////////////////////
/// Draw the object into the specified window
////////////////////////////////////////////////////////////
void Drawable::Draw(RenderTarget& Target) const
{
// Save the current modelview matrix and set the new one
GLCheck(glMatrixMode(GL_MODELVIEW));
GLCheck(glPushMatrix());
GLCheck(glMultMatrixf(GetMatrix().Get4x4Elements()));
// Setup alpha-blending
if (myBlendMode == Blend::None)
{
GLCheck(glDisable(GL_BLEND));
}
else
{
GLCheck(glEnable(GL_BLEND));
switch (myBlendMode)
{
case Blend::Alpha : GLCheck(glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); break;
case Blend::Add : GLCheck(glBlendFunc(GL_SRC_ALPHA, GL_ONE)); break;
case Blend::Multiply : GLCheck(glBlendFunc(GL_DST_COLOR, GL_ZERO)); break;
default : break;
}
}
// Set color
GLCheck(glColor4f(myColor.r / 255.f, myColor.g / 255.f, myColor.b / 255.f, myColor.a / 255.f));
// Let the derived class render the object geometry
Render(Target);
// Restore the previous modelview matrix
GLCheck(glMatrixMode(GL_MODELVIEW));
GLCheck(glPopMatrix());
}
示例13: GetPos
void CObject::Explode()
{
CVector pos = GetPos();
pos.z += 0.5;
CExplosion::AddExplosion(this, GetPlayerPed(-1), 9, pos, 100, 1, -1.0, 0);
if (m_colDamageEffect == 202 || m_colDamageEffect == 200)
{
pos.z -= 1.0;
ObjectDamage(10000.0f, pos, 0, GetPlayerPed(-1), 51);
}
else if (!m_disableFriction)
{
m_linearVelocity.z += 0.5;
m_linearVelocity.x += (rand() - 128) * 0.000199999994947575;
m_linearVelocity.y += (rand() - 128) * 0.000199999994947575;
if (bIsStatic || bIsStaticWaitingForCollision)
{
SetIsStatic(false);
AddToMovingList();
}
}
if (m_objectInfo->fxType == 2)
{
CMatrix pos = GetMatrix();
// to object space
CVector fxObjPos = Multiply3x3(pos, m_objectInfo->fxOffset);
fxObjPos += GetPos(); // to world space
FxSystem_c *sys = FxManager.InitialiseFxSystem(m_objectInfo->fxSystem, fxObjPos, 0, 0);
if (sys)
{
sys->Start();
}
}
}
示例14: SVGMatrix
already_AddRefed<SVGMatrix>
SVGMatrix::Rotate(float angle)
{
nsRefPtr<SVGMatrix> matrix =
new SVGMatrix(gfxMatrix(GetMatrix()).Rotate(angle*radPerDegree));
return matrix.forget();
}
示例15: GetMatrix
// TODO: This could actually be strided?
const char* NDMask::DataBuffer() const
{
// First make sure that the underlying matrix is on the right device
auto matrix = GetMatrix();
matrix->TransferToDeviceIfNotThere(AsCNTKImplDeviceId(m_device), true);
return matrix->Data();
}